Browse Source

短信推送,排除对自己发出询价

scr 7 years ago
parent
commit
eda83533fb

+ 3 - 3
src/main/java/com/uas/ps/inquiry/dao/InquiryRemindDao.java

@@ -53,7 +53,7 @@ public interface InquiryRemindDao extends JpaRepository<InquiryRemind, Long>, Jp
      * @param venduseruu
      * @param venduu
      */
-    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -16 hour) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2",nativeQuery = true)
+    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -16 HOUR) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2 and ir_enuu != ir_venduu",nativeQuery = true)
     List<InquiryRemind> findInquiryRemind(BigInteger venduseruu,BigInteger venduu);
 
     /**
@@ -61,7 +61,7 @@ public interface InquiryRemindDao extends JpaRepository<InquiryRemind, Long>, Jp
      * @param venduseruu
      * @param venduu
      */
-    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -5 hour) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2",nativeQuery = true)
+    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -5 hour) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2  and ir_enuu != ir_venduu ",nativeQuery = true)
     List<InquiryRemind> findInquiryRemind1(BigInteger venduseruu,BigInteger venduu);
 
     /**
@@ -69,7 +69,7 @@ public interface InquiryRemindDao extends JpaRepository<InquiryRemind, Long>, Jp
      * @param venduseruu
      * @param venduu
      */
-    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -3 hour) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2",nativeQuery = true)
+    @Query(value = "select * from purc$inquiry$remind where ir_date > date_add(now(),interval -3 hour) and ir_date < now() and ir_venduseruu =?1 and ir_venduu = ?2 and ir_enuu != ir_venduu",nativeQuery = true)
     List<InquiryRemind> findInquiryRemind2(BigInteger venduseruu,BigInteger venduu);
 
     /**

+ 1 - 1
src/main/java/com/uas/ps/inquiry/service/impl/InquiryServiceImpl.java

@@ -306,7 +306,7 @@ public class InquiryServiceImpl implements InquiryService {
     /**
      * 每早9点发送询价通知短信
      */
-    @Scheduled(cron = "0 46 9 * * ?" )
+    @Scheduled(cron = "0 0 9 * * ?" )
     private void sendMessage() throws Exception {
 
             List<BigInteger> list1 = inquiryRemindDao.findvenduseruu();