huangzhiguo 2 years ago
parent
commit
56b5634805

+ 70 - 23
src/main/java/com/caimei/modules/coupon/service/CmVipCouponService.java

@@ -278,7 +278,20 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
             cmCouponVipDao.insertVipCouponMonth(cmVipCoupon);
             cmCouponVipDao.insertVipCouponMonth(cmVipCoupon);
         }
         }
         Date beginTime = DateUtil.getMinDay(svipcouponForm.getMonth());
         Date beginTime = DateUtil.getMinDay(svipcouponForm.getMonth());
-        Date endTime = DateUtil.getMaxDay(svipcouponForm.getMonth());
+        // 结束时间为一个季度
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
+        Date dateMonth = null;
+        try {
+            dateMonth = dateFormat.parse(svipcouponForm.getMonth());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(dateMonth);
+        calendar.add(Calendar.MONTH,2);
+        Date time = calendar.getTime();
+        String format = dateFormat.format(time);
+        Date endTime = DateUtil.getMaxDay(format);
         /*
         /*
          * 第1张券
          * 第1张券
          */
          */
@@ -472,12 +485,29 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
             flag = true;
             flag = true;
             cmCouponVipDao.insertVipCouponMonth(cmVipCoupon);
             cmCouponVipDao.insertVipCouponMonth(cmVipCoupon);
         }
         }
-        Date beginTime = DateUtil.getMinDay(svipcouponForm.getMonth());
-        Date endTime = DateUtil.getMaxDay(svipcouponForm.getMonth());
+        // 结束时间为一个季度
+        Date dateMonth = null;
+        String month = countMonth(svipcouponForm.getMonth());
+        try {
+            dateMonth = df.parse(month);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(dateMonth);
+        calendar.add(Calendar.MONTH,3);
+        Date time = calendar.getTime();
+        String format = df.format(time);
+        Date beginTime = DateUtil.getMinDay(format);
+        calendar.setTime(time);
+        calendar.add(Calendar.MONTH,2);
+        Date timeEnd = calendar.getTime();
+        String formatEnd = df.format(timeEnd);
+        Date endTime = DateUtil.getMaxDay(formatEnd);
         /*
         /*
          * 第1张券
          * 第1张券
          */
          */
-        coupon1.setName("超级会员优惠券"+svipcouponForm.getMonth());
+        coupon1.setName("超级会员优惠券"+format);
         coupon1.setStartDate(beginTime);
         coupon1.setStartDate(beginTime);
         coupon1.setEndDate(endTime);
         coupon1.setEndDate(endTime);
         coupon1.setCouponAmount(svipcouponForm.getCouponAmount1());
         coupon1.setCouponAmount(svipcouponForm.getCouponAmount1());
@@ -504,7 +534,7 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
         /*
         /*
          * 第2张券
          * 第2张券
          */
          */
-        coupon2.setName("超级会员优惠券"+svipcouponForm.getMonth());
+        coupon2.setName("超级会员优惠券"+format);
         coupon2.setStartDate(beginTime);
         coupon2.setStartDate(beginTime);
         coupon2.setEndDate(endTime);
         coupon2.setEndDate(endTime);
         coupon2.setCouponAmount(svipcouponForm.getCouponAmount2());
         coupon2.setCouponAmount(svipcouponForm.getCouponAmount2());
@@ -531,7 +561,7 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
         /*
         /*
          * 第3张券
          * 第3张券
          */
          */
-        coupon3.setName("超级会员优惠券"+svipcouponForm.getMonth());
+        coupon3.setName("超级会员优惠券"+format);
         coupon3.setStartDate(beginTime);
         coupon3.setStartDate(beginTime);
         coupon3.setEndDate(endTime);
         coupon3.setEndDate(endTime);
         coupon3.setCouponAmount(svipcouponForm.getCouponAmount3());
         coupon3.setCouponAmount(svipcouponForm.getCouponAmount3());
@@ -558,7 +588,7 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
         /*
         /*
          * 第4张券
          * 第4张券
          */
          */
-        coupon4.setName("超级会员优惠券"+svipcouponForm.getMonth());
+        coupon4.setName("超级会员优惠券"+format);
         coupon4.setStartDate(beginTime);
         coupon4.setStartDate(beginTime);
         coupon4.setEndDate(endTime);
         coupon4.setEndDate(endTime);
         coupon4.setCouponAmount(svipcouponForm.getCouponAmount4());
         coupon4.setCouponAmount(svipcouponForm.getCouponAmount4());
@@ -675,34 +705,34 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
         if (com.thinkgem.jeesite.common.utils.StringUtils.isNotEmpty(cmVipCoupon.getStartDate())) {
         if (com.thinkgem.jeesite.common.utils.StringUtils.isNotEmpty(cmVipCoupon.getStartDate())) {
             year = cmVipCoupon.getStartDate().substring(0,cmVipCoupon.getStartDate().length() - 2);
             year = cmVipCoupon.getStartDate().substring(0,cmVipCoupon.getStartDate().length() - 2);
             month = cmVipCoupon.getStartDate().substring(cmVipCoupon.getStartDate().length() - 2);
             month = cmVipCoupon.getStartDate().substring(cmVipCoupon.getStartDate().length() - 2);
-            if (month.equals("01") || month.equals("02") || month.equals("03")) {
-                month = "01";
+            if (month.equals("02") || month.equals("03") || month.equals("04")) {
+                month = "02";
             }
             }
-            if (month.equals("04") || month.equals("05") || month.equals("06")) {
-                month = "04";
+            if (month.equals("05") || month.equals("06") || month.equals("07")) {
+                month = "05";
             }
             }
-            if (month.equals("07") || month.equals("08") || month.equals("09")) {
-                month = "07";
+            if (month.equals("08") || month.equals("09") || month.equals("10")) {
+                month = "08";
             }
             }
-            if (month.equals("10") || month.equals("11") || month.equals("12")) {
-                month = "10";
+            if (month.equals("11") || month.equals("12") || month.equals("1")) {
+                month = "11";
             }
             }
             startDate = year + month;
             startDate = year + month;
         }
         }
         if (com.thinkgem.jeesite.common.utils.StringUtils.isNotEmpty(cmVipCoupon.getEndDate())) {
         if (com.thinkgem.jeesite.common.utils.StringUtils.isNotEmpty(cmVipCoupon.getEndDate())) {
             year = cmVipCoupon.getEndDate().substring(0,cmVipCoupon.getEndDate().length() - 2);
             year = cmVipCoupon.getEndDate().substring(0,cmVipCoupon.getEndDate().length() - 2);
             month = cmVipCoupon.getEndDate().substring(cmVipCoupon.getEndDate().length() - 2);
             month = cmVipCoupon.getEndDate().substring(cmVipCoupon.getEndDate().length() - 2);
-            if (month.equals("01") || month.equals("02") || month.equals("03")) {
-                month = "03";
+            if (month.equals("02") || month.equals("03") || month.equals("04")) {
+                month = "02";
             }
             }
-            if (month.equals("04") || month.equals("05") || month.equals("06")) {
-                month = "06";
+            if (month.equals("05") || month.equals("06") || month.equals("07")) {
+                month = "05";
             }
             }
-            if (month.equals("07") || month.equals("08") || month.equals("09")) {
-                month = "09";
+            if (month.equals("08") || month.equals("09") || month.equals("10")) {
+                month = "08";
             }
             }
-            if (month.equals("10") || month.equals("11") || month.equals("12")) {
-                month = "12";
+            if (month.equals("11") || month.equals("12") || month.equals("1")) {
+                month = "11";
             }
             }
             endDate = year + month;
             endDate = year + month;
         }
         }
@@ -710,4 +740,21 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
         cmVipCoupon.setEndDate(endDate);
         cmVipCoupon.setEndDate(endDate);
         return cmVipCoupon;
         return cmVipCoupon;
     }
     }
+    public String countMonth(String countMonth) {
+        String year = countMonth.substring(0,countMonth.length() - 2);
+        String month = countMonth.substring(countMonth.length() - 2);
+        if (month.equals("02") || month.equals("03") || month.equals("04")) {
+            month = "02";
+        }
+        if (month.equals("05") || month.equals("06") || month.equals("07")) {
+            month = "05";
+        }
+        if (month.equals("08") || month.equals("09") || month.equals("10")) {
+            month = "08";
+        }
+        if (month.equals("11") || month.equals("12") || month.equals("1")) {
+            month = "11";
+        }
+        return year + month;
+    }
 }
 }

+ 29 - 0
src/main/java/com/caimei/modules/user/web/jumpLink.java

@@ -0,0 +1,29 @@
+package com.caimei.modules.user.web;
+
+import com.thinkgem.jeesite.common.config.Global;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/3/24
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/user/jumpLink")
+public class jumpLink {
+
+    @RequestMapping("/toOldAdmin")
+    public String link(Integer type , Integer clubId, String clubName, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        if (type == 1) {
+            String path = Global.getAdminPath();
+            return "redirect:" + Global.getAdminPath() + "/new/user/agency/clubPortrait?clubID="+clubId+"&clubName="+clubName+"&dateType=0&type=4";
+        }
+        return "redirect:"+ Global.getAdminPath()+"/new/user/agency/list";
+    }
+}

+ 1 - 0
src/main/resources/mappings/modules/product/SearchFrequencyMapper.xml

@@ -125,6 +125,7 @@
         where trueStatus=1
         where trueStatus=1
           and   delStatus=1
           and   delStatus=1
           and keyword is not null
           and keyword is not null
+        order by frequency desc
     </select>
     </select>
     <select id="getvalueList" resultType="com.caimei.modules.product.entity.SearchFrequencyVo">
     <select id="getvalueList" resultType="com.caimei.modules.product.entity.SearchFrequencyVo">
         select
         select

+ 23 - 0
src/main/webapp/WEB-INF/views/jump/jumlink.jsp

@@ -0,0 +1,23 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+<a href="" id="JUMP_LINK"></a>
+<script>
+    $(function () {
+        var jumpLink = '';
+        var type = window.localStorage.getItem('type');
+        if(type === 1){//机构画像
+            var clubId = window.localStorage.getItem('clubId');
+            var clubName = window.localStorage.getItem('clubName');
+            jumpLink = '${ctx}/new/user/agency/clubPortrait?clubID=${clubId}&clubName=${clubName}&dateType=0&type=4';
+        }
+        $('#JUMP_LINK').attr('href',jumpLink);
+        $('#JUMP_LINK').click();
+    })
+</script>
+</body>
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/consult/type/cmConsulttypeList.jsp

@@ -74,7 +74,7 @@
         <li class="active"><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
         <li class="active"><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
     <shiro:hasPermission name="user:agency:cmrenaksList">
     <shiro:hasPermission name="user:agency:cmrenaksList">
-        <li><a href="${ctx}/new/user/agency/cmrenaksList">关键词库</a></li>
+        <li><a href="${ctx}/new/user/agency/cmrenaksList">咨询关键词库</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
 </ul>
 </ul>
 <form:form id="searchForm" modelAttribute="cmConsulttype" action="${ctx}/consult/type/cmConsulttype/" method="post"
 <form:form id="searchForm" modelAttribute="cmConsulttype" action="${ctx}/consult/type/cmConsulttype/" method="post"

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/userNew/ReportList.jsp

@@ -264,7 +264,7 @@
     <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
     <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
 </shiro:hasPermission>
 </shiro:hasPermission>
 <shiro:hasPermission name="user:agency:cmrenaksList">
 <shiro:hasPermission name="user:agency:cmrenaksList">
-    <li><a href="${ctx}/new/user/agency/cmrenaksList">关键词库</a></li>
+    <li><a href="${ctx}/new/user/agency/cmrenaksList">咨询关键词库</a></li>
 </shiro:hasPermission>
 </shiro:hasPermission>
 </ul>
 </ul>
 <form:form id="searchForm" modelAttribute="cmReport" action="${ctx}/new/user/agency/ReportList" method="post"
 <form:form id="searchForm" modelAttribute="cmReport" action="${ctx}/new/user/agency/ReportList" method="post"

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/userNew/cmRegistRemarksList.jsp

@@ -85,7 +85,7 @@
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
     <shiro:hasPermission name="user:agency:cmrenaksList">
     <shiro:hasPermission name="user:agency:cmrenaksList">
-        <li><a href="${ctx}/new/user/agency/cmrenaksList">关键词库</a></li>
+        <li><a href="${ctx}/new/user/agency/cmrenaksList">咨询关键词库</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
 </ul>
 </ul>
 <br/>
 <br/>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/userNew/cmRemaksList.jsp

@@ -3,7 +3,7 @@
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
 <html>
 <html>
 <head>
 <head>
-    <title>关键词库</title>
+    <title>咨询关键词库</title>
     <meta name="decorator" content="default"/>
     <meta name="decorator" content="default"/>
     <style type="text/css">
     <style type="text/css">
         .table th {
         .table th {
@@ -42,7 +42,7 @@
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
     <shiro:hasPermission name="user:agency:cmrenaksList">
     <shiro:hasPermission name="user:agency:cmrenaksList">
-        <li class="active"><a href="${ctx}/new/user/agency/cmrenaksList">关键词库</a></li>
+        <li class="active"><a href="${ctx}/new/user/agency/cmrenaksList">咨询关键词库</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
 </ul>
 </ul>
 <form:form id="searchForm" modelAttribute="cmRemaks" action="${ctx}/new/user/agency/cmrenaksList" method="post"
 <form:form id="searchForm" modelAttribute="cmRemaks" action="${ctx}/new/user/agency/cmrenaksList" method="post"

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/userNew/cmUnRegistRemarksList.jsp

@@ -57,7 +57,7 @@
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
         <li><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
     <shiro:hasPermission name="user:agency:cmrenaksList">
     <shiro:hasPermission name="user:agency:cmrenaksList">
-        <li><a href="${ctx}/new/user/agency/cmrenaksList">关键词库</a></li>
+        <li><a href="${ctx}/new/user/agency/cmrenaksList">咨询关键词库</a></li>
     </shiro:hasPermission>
     </shiro:hasPermission>
 </ul>
 </ul>
 <br/>
 <br/>