huangzhiguo преди 2 години
родител
ревизия
a46b8058b0

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

@@ -91,6 +91,12 @@ public interface CmCouponDao extends CrudDao<CmCoupon> {
 
     List<CmCoupon> selconfigure();
 
+    /**
+     * 专属优惠券时间
+     * @return
+     */
+    String selMonthTime();
+
     Integer selCouponId(@Param("couponId") String couponId);
     /**
      * 专属优惠券配置插入

+ 4 - 2
src/main/java/com/caimei/modules/coupon/service/CmVipCouponService.java

@@ -445,14 +445,16 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
                 setSvipcouponForm(svipcouponForm, i, couponList.get(i));
             }
         }
+        svipcouponForm.setMonth(cmCouponDao.selMonthTime());
         return svipcouponForm;
     }
 
     @Transactional(readOnly = false)
     public void saveConfigure(SvipCouponForm svipcouponForm) {
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM");
-        String current = df.format(new Date());
-        svipcouponForm.setMonth(current);
+//        String current = countMonth(df.format(new Date()));
+//        String current = df.format(new Date());
+//        svipcouponForm.setMonth(current);
         Integer integer = cmCouponDao.selCouponId(svipcouponForm.getCouponId1());
         String id = "";
         if (integer == null) {

+ 1 - 1
src/main/java/com/caimei/modules/user/service/SysLogService.java

@@ -106,7 +106,6 @@ public class SysLogService extends CrudService<OperationsDao, OperationalLogs> {
                     String[] split = logs.getCreateTime().split(" ");
                     if (split.length > 0) {
                         String year = split[0].trim();
-                        String time = split[1].trim();
                         // 拼接更换记录信息
                         String count = "";
                         Boolean bool = false;
@@ -116,6 +115,7 @@ public class SysLogService extends CrudService<OperationsDao, OperationalLogs> {
                             // 与外层时间比对,避免重复
                             String[] splitStent = logsList.get(i).getCreateTime().split(" ");
                             String newYear = splitStent[0].trim();
+                            String time = splitStent[1].trim();
                             if (newYear.equals(year)) {
                                 if (i == logsList.size() - 1) {
                                     if ( 0 == logsList.get(i).getIsOneself()) {

+ 6 - 0
src/main/resources/mappings/modules/coupon/CmCouponMapper.xml

@@ -575,6 +575,12 @@
 	<select id="selconfigure" resultType="com.caimei.modules.coupon.entity.CmCoupon">
 		SELECT <include refid="cmCouponColumns"/> FROM cm_coupon a WHERE configure = 1
 	</select>
+	<select id="selMonthTime" resultType="java.lang.String">
+		SELECT cscm.useTime
+		FROM cm_coupon a
+				 LEFT JOIN cm_svip_coupon csc ON a.id = csc.couponId
+				 LEFT JOIN cm_svip_coupon_month cscm ON csc.montId = cscm.id WHERE a.delFlag = 0 AND a.configure = 1 LIMIT 1
+	</select>
 	<select id="selCouponId" resultType="integer">
 		SELECT cscm.id as id FROM cm_svip_coupon_month cscm LEFT JOIN cm_svip_coupon csc ON csc.montId = cscm.id WHERE csc.couponId = #{couponId}
 	</select>

+ 9 - 11
src/main/webapp/WEB-INF/views/modules/info/infoList.jsp

@@ -210,20 +210,18 @@
 					<form:option value="" label=" "/>
 					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
 				</form:select>
+			<label>关联标签库:</label>
+				<form:select path="isRelevance" class="input-medium">
+					<form:option value="" label="请选择"/>
+					<form:option value="1" label="已关联"/>
+					<form:option value="2" label="未关联"/>
+				</form:select>
 			<label>首页置顶:</label>
 			<form:select path="topFlag" class="input-mini">
 				<form:option value="" label="全部"/>
 				<form:option value="1" label="是"/>
 				<form:option value="0" label="否"/>
 			</form:select>
-			<div class="item">
-				<label>关联标签库:</label>
-				<form:select path="isRelevance" class="input-medium">
-					<form:option value="" label="请选择"/>
-					<form:option value="1" label="已关联"/>
-					<form:option value="2" label="未关联"/>
-				</form:select>
-			</div>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
 		</div>
@@ -243,9 +241,9 @@
 				<th>实际阅读量</th>
 				<th>首页置顶位</th>
 				<%--<th>优先级</th>--%>
+				<th>关联标签库</th>
 				<th>发布时间</th>
 				<th>添加时间</th>
-				<th>关联标签库</th>
 				<th>推荐状态</th>
 				<th>状态</th>
 				<shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
@@ -273,8 +271,6 @@
 				<td>${empty info.pv?0:(info.pv)}</td>
 				<td>${info.topPosition}</td>
 				<%--<td>${empty info.priorityIndex?0:(info.priorityIndex)}</td>--%>
-				<td><fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
-				<td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td>
 					<c:if test="${!empty info.labelIds}">
 						已关联
@@ -283,6 +279,8 @@
 						未关联
 					</c:if>
 				</td>
+				<td><fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
+				<td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td>
 					<c:if test="${info.recommendStatus eq 1 }">
 						<a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/svip/cmSvipCouponConfiguration.jsp

@@ -143,6 +143,7 @@
     </div>
     <sys:message content="${message}"/>
     <form:hidden path="id" value="${cmVipCoupon.id}"/>
+    <form:hidden path="month" value="${svipcouponForm.month}"/>
     <div class="coupon-wrap" id="couponWrap1">
         <div class="control-group">
             <label class="control-label"><font color="red">*</font><b>优惠券1:</b></label>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/svip/cmSvipCouponForm.jsp

@@ -146,6 +146,7 @@
 <form:form id="inputForm" modelAttribute="svipcouponForm" action="${ctx}/vip/cmCoupon/save" method="post" class="form-horizontal">
     <sys:message content="${message}"/>
     <form:hidden path="id" value="${cmVipCoupon.id}"/>
+    <form:hidden path="month" value="${useTime}"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>优惠月份:</label>
         <div class="controls">