zhijiezhao 2 年之前
父節點
當前提交
f772d71d90

+ 0 - 14
src/main/java/com/caimei/modules/sys/dao/NotificationDao.java

@@ -17,15 +17,6 @@ import java.util.List;
 @MyBatisDao
 public interface NotificationDao extends CrudDao<Notification> {
 
-    //查询几月后过期
-    List<Product> productTypeCount(Integer yat);
-    //查询几日后过期
-    List<Product> productTypeCount1(Integer yat);
-   //查询上架费几月后过期
-    List<Product> productTypeCount2(Integer yat);
-    //查询上架费几日后过期
-    List<Product> productTypeCount3(Integer yat);
-
     List<Notification>notification(Notification notification);
 
     String notificationId(Notification notification);
@@ -35,9 +26,4 @@ public interface NotificationDao extends CrudDao<Notification> {
     void hide(@Param("hide")Integer hide, @Param("Id") Integer Id);
 
     void hides();
-
-    void addNotification(Notification notification);
-
-    Integer count();
-
 }

+ 0 - 28
src/main/java/com/caimei/modules/sys/web/NotificationController.java

@@ -1,18 +1,12 @@
 package com.caimei.modules.sys.web;
 
-import com.caimei.modules.basesetting.entity.Province;
 import com.caimei.modules.order.dao.NewShopOrderDao;
-import com.caimei.modules.order.entity.NewShopOrder;
 import com.caimei.modules.order.service.NewOrderService;
 import com.caimei.modules.order.service.WeChatService;
-import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.sys.dao.NotificationDao;
 import com.caimei.modules.sys.entity.Notification;
 import com.caimei.modules.sys.service.NotificationService;
-import com.caimei.modules.sys.utils.SMSUtils;
 import com.caimei.modules.user.dao.MessageCenterDao;
-import com.caimei.modules.user.entity.MessageCenter;
-import com.caimei.utils.StringUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.web.BaseController;
@@ -20,19 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
-import redis.clients.jedis.Jedis;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.soap.Addressing;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -51,23 +38,10 @@ public class NotificationController extends BaseController {
     private NotificationDao notificationDao;
     @Autowired
     private NotificationService notificationService;
-    @Autowired
-    private MessageCenterDao messageCenterDao;
-    @Autowired
-    private NewOrderService newOrderService;
-    @Autowired
-    private NewShopOrderDao newShopOrderDao;
-    @Autowired
-    private WeChatService weChatService;
-    @Value("${wwwServer}")
-    private String domain;
 
     @RequestMapping(value = {"list", ""})
     public String list(Notification notifi, HttpServletRequest request, HttpServletResponse response, Model model) {
-
-        List<String> content = new ArrayList<>();
         Page<Notification> page = notificationService.notificationPagen(new Page<Notification>(request, response), notifi);
-
         String[] IdArr = null;
         String[] porductIDs = null;
         String[] shopIDs = null;
@@ -122,11 +96,9 @@ public class NotificationController extends BaseController {
 
     @RequestMapping(value = {"hides"})
     public String hides(Notification notification, HttpServletRequest request, HttpServletResponse response, Model model) {
-
         notificationDao.hides();
         return "redirect:" + Global.getAdminPath() + "/sys/Notification/list";
     }
 
-
 }
 

+ 0 - 7
src/main/java/com/caimei/modules/user/dao/MessageCenterDao.java

@@ -34,17 +34,10 @@ public interface MessageCenterDao extends CrudDao<MessageCenter> {
 
     List<Integer> ClubIds();
 
-    CmCoupon CouponList(Integer couponType);
-
     String contractMobile(String userID);
-    String Mobile(Integer shopID);
-
-    Integer userID(Integer shopID);
 
     String shopName(Integer shopID);
 
-    List<CmCoupon> couponTime();
-
     Integer count();
 
     List<User> getNewUsers();

+ 39 - 64
src/main/resources/mappings/modules/sys/Notification.xml

@@ -2,74 +2,49 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.sys.dao.NotificationDao">
 
-	<select id="productTypeCount" resultType="com.caimei.modules.product.entity.Product">
-		SELECT * FROM `product` WHERE productType=2 AND  DATE_ADD(NOW(), INTERVAL #{yat} MONTH) > qualificationTime AND qualificationTime > NOW()
-	</select>
-
-	<select id="productTypeCount1" resultType="com.caimei.modules.product.entity.Product">
-		SELECT * FROM `product` WHERE productType=2 AND  DATE_ADD(NOW(), INTERVAL #{yat} DAY) > qualificationTime AND qualificationTime > NOW()
-	</select>
-
-	<select id="productTypeCount2" resultType="com.caimei.modules.product.entity.Product">
-		SELECT * FROM `cm_discern_receipt` a
-						  LEFT JOIN cm_receipt s ON s.receiptID = a.id
-						  LEFT JOIN shop c ON a.shopID = c.`shopID`
-		WHERE a.newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} MONTH)>s.dateStrings  AND  s.dateStrings > NOW() AND a.receStatct=0
-	</select>
-
-	<select id="productTypeCount3" resultType="com.caimei.modules.product.entity.Product">
-		SELECT * FROM `cm_discern_receipt` a
-		LEFT JOIN cm_receipt s ON s.receiptID = a.id
-		LEFT JOIN shop c ON a.shopID = c.`shopID`
-		WHERE a.newReceiptType=1 AND DATE_ADD(NOW(), INTERVAL #{yat} DAY)>s.dateStrings  AND  s.dateStrings > NOW() AND a.receStatct=0
-	</select>
-
-	<select id="notification" resultType="com.caimei.modules.sys.entity.Notification">
-		SELECT * FROM `notification`
-		<where>
-			<if test="theme!=null and theme!=''">
-				and theme LIKE CONCAT('%',#{theme},'%')
-			</if>
-		</where>
-		ORDER BY newTime desc
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	<select id="notificationId" resultType="java.lang.String">
-		SELECT shopContent FROM `notification`
-		where id=#{id}
-	</select>
-
-	<update id="Upnotification">
-		UPDATE notification SET saved=1
-		<where>
-		    <if test="id!=null">
-		and	id=#{id}
+    <select id="notification" resultType="com.caimei.modules.sys.entity.Notification">
+        SELECT * FROM `notification`
+        <where>
+            <if test="theme!=null and theme!=''">
+                and theme LIKE CONCAT('%',#{theme},'%')
             </if>
-	   </where>
-	</update>
-
-	<update id="hide">
-		UPDATE notification SET hide=#{hide},saved=1
-		where id=#{Id}
+        </where>
+        ORDER BY newTime desc
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+            </otherwise>
+        </choose>
+    </select>
+    <select id="notificationId" resultType="java.lang.String">
+        SELECT shopContent
+        FROM `notification`
+        where id = #{id}
+    </select>
+
+    <update id="Upnotification">
+        UPDATE notification SET saved=1
+        <where>
+            <if test="id!=null">
+                and id=#{id}
+            </if>
+        </where>
+    </update>
 
-	</update>
+    <update id="hide">
+        UPDATE notification
+        SET hide=#{hide},
+            saved=1
+        where id = #{Id}
 
-	<update id="hides">
-		UPDATE notification SET hide=0
-	</update>
+    </update>
 
-	<insert id="addNotification">
-		INSERT INTO notification(theme,newTime,shopContent,porductID,shopID) VALUES (#{theme},NOW(),#{shopContent},#{porductID},#{shopID})
-	</insert>
+    <update id="hides">
+        UPDATE notification
+        SET hide=0
+    </update>
 
-	<select id="count" resultType="java.lang.Integer">
-		select count(*) from notification where saved=1
-	</select>
 
 </mapper>

+ 4 - 40
src/main/resources/mappings/modules/user/MessageCenter.xml

@@ -1,13 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.user.dao.MessageCenterDao">
-    <!--    <insert id="addMessageCenter">-->
-    <!--        INSERT INTO message_center (shopID, clubID, userType, messageType,content,time,accountType,orderID,orderMessageType,shopMessType)-->
-    <!--        VALUES (#{shopId}, #{clubId}, #{userType}, #{messageType},#{content},#{time},#{accountType},#{orderID},#{orderMessageType},#{shopMessType})-->
-    <!--    </insert>-->
+
     <insert id="addMessageCenter">
         INSERT INTO message_center (shopID, clubID, userType, messageType, content, time, accountType, couponType,
-                                    couponFee, couponMessageType, orderID, orderMessageType, shopMessType, productId)
+                                    couponFee, couponMessageType, orderID, orderMessageType, shopMessType, productID)
         VALUES (#{shopId}, #{clubId}, #{userType}, #{messageType}, #{content}, #{time}, #{accountType}, #{couponType},
                 #{couponFee}, #{couponMessageType}, #{orderId}, #{orderMessageType}, #{shopMessType}, #{productId})
     </insert>
@@ -24,13 +21,6 @@
         WHERE userID = #{UserID}
     </select>
 
-    <select id="Mobile" resultType="java.lang.String">
-        SELECT contractMobile
-        FROM shop
-        WHERE shopID = #{shopID}
-    </select>
-
-
     <select id="clubList" resultType="com.caimei.modules.user.entity.CmUser">
         SELECT *
         FROM `user`
@@ -58,48 +48,22 @@
         ORDER BY logintime DESC
     </select>
 
-    <select id="userID" resultType="java.lang.Integer">
-        select userID
-        from shop
-        where shopID = #{shopID}
-    </select>
-
-    <select id="CouponList" resultType="com.caimei.modules.coupon.entity.CmCoupon">
-        SELECT *
-        FROM cm_coupon
-        WHERE couponType = #{couponType}
-          AND NOW() >= startDate
-          AND endDate >= NOW()
-          AND status = 1
-          AND delFlag = 0
-        ORDER BY id DESC
-        LIMIT 1
-    </select>
-
-    <select id="couponTime" resultType="com.caimei.modules.coupon.entity.CmCoupon">
-        SELECT *
-        FROM `cm_coupon`
-        WHERE NOW() >= startDate
-          AND endDate >= NOW()
-          AND STATUS = 1
-          AND delFlag = 0
-    </select>
-
     <select id="count" resultType="integer">
         SELECT COUNT(*)
         FROM `notification`
         WHERE saved = 0
     </select>
+
     <select id="getNewUsers" resultType="com.caimei.po.User">
         select userID, clubID, bindMobile
         from user
         where DATE_ADD(registerTime, INTERVAL 6 MONTH) > NOW()
     </select>
+
     <select id="getUserInfo" resultType="com.caimei.po.User">
         select userId, clubId, bindMobile
         from user
         where userId = #{userId}
     </select>
 
-
 </mapper>