huangzhiguo 2 anni fa
parent
commit
faa87866a0

+ 15 - 7
src/main/java/com/caimei365/order/controller/BaseApi.java

@@ -42,12 +42,20 @@ public class BaseApi {
         return ResponseJson.error(-99, "Token失效请重新登录!", null);
     }
 
-//    /**
-//     * 老用户发短信临时接口
-//     */
-//    @GetMapping("/getOld")
-//    public void getOldUser() {
-//        remoteCallService.getOldUser();
-//    }
+    /**
+     * 电穿孔导入仪
+     */
+    /*@GetMapping("/getOld")
+    public void getOldUser() {
+        remoteCallService.getOldUser();
+    }*/
+
+    /**
+     * 水光仪
+     */
+    /*@GetMapping("/getOldTow")
+    public void getOldUserTow() {
+        remoteCallService.getOldUserTow();
+    }*/
 }
 

+ 20 - 18
src/main/java/com/caimei365/order/service/impl/RemoteCallServiceImpl.java

@@ -187,20 +187,18 @@ public class RemoteCallServiceImpl implements RemoteCallService {
 
     @Override
     public void getOldUser() {
-        //ross挑战赛
-        List<PushMessageUserVo> pushUsers =messagePushMapper.findOldUser();
-        String url = "https://zp.caimei365.com/12/ross/activity/challenge";
-        List<String> list = new ArrayList<String>();
-        list.add("15827317748");
-        list.add("15017915300");
-        list.add("17798247695");
 
-        list.add("15917362709");
+//        List<PushMessageUserVo> pushUsers = new ArrayList<>();
+        List<PushMessageUserVo> pushUsers = messagePushMapper.findOldUser();
+        // https://www.caimei365.com/page-388.html 电穿孔导入仪
+        String url = "https://www.caimei365.com/page-388.html";
+        List<String> list = new ArrayList<String>();
+        /*list.add("15917362709");
         list.add("18476937515");
-        list.add("18605868824");
-        list.add("17798247695");
+        list.add("18605868824");*/
         list.add("18670511721");
-        list.add("18229303772");
+        list.add("17798247695");
+        list.add("15017915300");
         list.forEach(l -> {
             PushMessageUserVo pushMessageUserVo = new PushMessageUserVo();
             pushMessageUserVo.setMobile(l);
@@ -212,7 +210,8 @@ public class RemoteCallServiceImpl implements RemoteCallService {
             p.setShortLink(link);
             p.setMarkId(23);
             messagePushMapper.insertNewLink(p);
-            String  content="【西班牙ROSS】抖音视频挑战赛仅剩7天,再不来大奖就是别人的啦!发视频还可赢导胶一瓶,错过不再有!速来报名! caimei365.com/t/"+link+" 退订回T";
+            // 限时福利!买电穿孔导入仪、免费送采美超级会员季卡一张!立省2600元,速领 caimei365.com/t/s{20},退订回T
+            String  content="限时福利!买电穿孔导入仪、免费送采美超级会员季卡一张!立省2600元,速领 caimei365.com/t/"+ link +" ,退订回T";
 //            String content = "【西班牙ROSS】亲,ROSS抖音挑战赛开始啦,发布ROSS仪器视频赢网红探店和千元导胶!戳此 caimei365.com/t/" + link + " 查看视频发布教程,退订回T;";
             getSendSms(3,23, p.getMobile(), content);
             log.info("userId-------------------->" + p.getUserId() + "发送手机号------------------------>" + p.getMobile() + "短信-------------->" + content);
@@ -221,12 +220,14 @@ public class RemoteCallServiceImpl implements RemoteCallService {
 
     @Override
     public void getOldUserTow() {
-//近两年新增、活跃、忠诚、沉默用户,不活跃用户带医用户
+//        List<PushMessageUserVo> pushUsers = new ArrayList<>();
         List<PushMessageUserVo> pushUsers = messagePushMapper.findOldUserTow();
-        //https://www.caimei365.com/user/coupon-collection.html指向领券中心
-        String url = "https://www.caimei365.com/user/coupon-collection.html";
+        // https://www.caimei365.com/product-7729.html水光仪
+        String url = "https://www.caimei365.com/product-7729.html";
         List<String> list = new ArrayList<String>();
-        list.add("15917362709");
+        list.add("15017915300");
+        list.add("18670511721");
+        list.add("17798247695");
 //        list.add("15827317748");
 //        list.add("18476937515");
 //        list.add("18605868824");
@@ -243,8 +244,9 @@ public class RemoteCallServiceImpl implements RemoteCallService {
             p.setShortLink(link);
             p.setMarkId(23);
             messagePushMapper.insertNewLink(p);
-
-            String content = "欢庆元旦,采美平台直接让利,下单立减2000元,限时优惠券发放中,速领!戳https://www.caimei365.com/t/" + link + ",退订回T";
+//水光仪首付2万!国货之光|颜层水光仪|有证一一采美超级会员优享,点击 caimei365.com/t/{s20} 立刻了解详情,退订回T
+//            String content = "欢庆元旦,采美平台直接让利,下单立减2000元,限时优惠券发放中,速领!戳https://www.caimei365.com/t/" + link + ",退订回T";
+            String content = "水光仪首付2万!国货之光|颜层水光仪|有证一一采美超级会员优享,点击 caimei365.com/t/" + link + " 立刻了解详情,退订回T";
             getSendSms(3,23, p.getMobile(), content);
             log.info("userId-------------------->" + p.getUserId() + "发送手机号------------------------>" + p.getMobile() + "短信-------------->" + content);
         });

+ 68 - 30
src/main/resources/mapper/MessagePushMapper.xml

@@ -20,37 +20,75 @@
         WHERE shortLink = #{shortLink}
     </select>
     <select id="findOldUser" resultType="com.caimei365.order.model.vo.PushMessageUserVo">
-        select cb.mobile  as mobile,
-        cb.authUserId as userId
-        from cm_brand_auth ca
-            left join cm_brand_club_user cb on ca.id=cb.authid
-        where cb.mobile
-            is not null and ca.authUserId=12
-          and  ca.`STATUS`=1
-        group by cb.mobile
+        SELECT DISTINCT userID, contractMobile as mobile FROM (
+            SELECT u.userID, c.contractMobile FROM club c
+                   LEFT JOIN USER u ON u.userID = c.userID
+                   LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubID
+            WHERE c.firstClubType = 2 AND ccr.addTime LIKE '%2023%'
+              AND ( ccr.remarks LIKE '%导入仪%' OR ccr.remarks LIKE '%无针水光%' OR ccr.remarks LIKE '%dep%' OR ccr.remarks LIKE '%润月雅%' OR ccr.remarks LIKE '%meso x%' )
+
+            UNION
+
+            SELECT u.userID, c.contractMobile FROM club c
+                   LEFT JOIN USER u ON u.userID = c.userID
+                   LEFT JOIN (SELECT DISTINCT c.clubID,COUNT(ccr.id) AS num FROM club c
+                LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubID WHERE c.addTime LIKE '%2023%' GROUP BY c.clubID HAVING COUNT(ccr.id) = 0) AS xs ON xs.clubID = c.clubID
+            WHERE c.firstClubType = 2 AND xs.num = 0
+
+            UNION
+
+            SELECT DISTINCT u.userID, c.contractMobile FROM USER u
+                            LEFT JOIN club c ON c.userID = u.userID
+                            LEFT JOIN cm_organ_value_system covs ON u.userID = covs.userID
+                            LEFT JOIN cm_behavior_record cbr ON cbr.userID = u.userID
+            WHERE (c.firstClubType = 2 OR firstClubType = 4) AND (covs.activeState = '新增用户' OR covs.activeState = '活跃用户' OR covs.activeState = '不活跃用户' OR covs.activeState = '忠诚用户')
+              AND (cbr.pageLabel LIKE '%meso x%' OR cbr.pageLabel LIKE '%mesocore%'
+                OR cbr.pageLabel LIKE '%润月雅水光仪%'  OR cbr.pageLabel LIKE '%电穿孔导入仪%' OR cbr.pageLabel LIKE '%dep%' OR cbr.pageLabel LIKE '%无针水光%' OR cbr.pageLabel LIKE '%无创水光%')
+
+            UNION
+
+            SELECT u.userID, c.contractMobile
+            FROM USER u
+                 LEFT JOIN club c ON c.userID = u.userID
+                 LEFT JOIN cm_behavior_record cbr ON cbr.userID = u.userID
+            WHERE (c.firstClubType = 2 OR firstClubType = 4) AND cbr.pageType = 28
+              AND u.userID NOT IN ( SELECT userID FROM cm_svip_user WHERE delFlag != 0 OR NOW() BETWEEN beginTime AND endTime)
+        ) b
     </select>
     <select id="findOldUserTow" resultType="com.caimei365.order.model.vo.PushMessageUserVo">
-        SELECT
-            a.clubID AS clubID,
-            u.userID AS userID,
-            a.contractMobile AS mobile
-        FROM club a
-                 LEFT JOIN USER u ON u.userID = a.userID
-        WHERE u.userID IN
-              (6286,6737,7076,7793,8424,9622,10464,10510,10612,10989,10992,11102,11301,11313,12665,11662,11677,
-               12817,12819,12841,12935,12938,12962,12972,12993,12996,13009,13033,13120,13132,13164,13180,13189,13216,13229,13239,13287,13308,13406,
-               13442,13454,13459,13492,13554,13764,13792,13819,13834,13856,13863,13871,13876,13882,13892,13907,13928,13929,13938,13943,13949,13954,
-               13966,14017,14058,14060,14238,14260,14295,14302,14304,14316,14374,14394,14410,14427,14434,14438,14457,14474,14477,14499,14572,14591,
-               14659,14662,14674,14701,14716,14817,14823,14828,14861,14873,14910,14943,15043,15113,15144,15164,15177,15197,15215,15217,15221,15222,
-               15299,15302,15310,15317,15365,15389,15404,15435,15487,15677,15710,15721,15786,15796,15930,15991,15999,16010,16108,16123,16128,16155,
-               16158,16179,16186,16188,16206,16271,16295,16311,16383,16386,16404,16426,16435,16478,16534,16570,16581,16615,16634,16641,16665,16682,
-               16723,16827,16828,16831,16838,16866,16880,16881,16885,16888,16912,16921,16924,16925,16927,16934,16937,16940,16941,16950,16965,16971,
-               16976,16979,16981,16989,16995,17005,17025,17036,17047,17061,17062,17070,17071,17073,17075,17086,17089,17100,17113,17122,17141,17145,
-               17149,17155,17161,17162,17201,17209,17213,17217,17238,17239,17252,17268,17279,17280,17295,17297,17305,17315,17320,17328,17331,17339,
-               17341,17348,17371,17373,17376,17388,17396,17401,17428,17431,17436,17439,17460,17474,17482,17483,17489,17490,17486,17504,17509,17512,
-               17514,17518,17534,17538,17539,17540,17568,17582,17585,17586,17603,17606,17615,17625,17627,17631,17650,17658,17660,17672,17677,17688,17706,
-               17716,17720,17725,17763,17769,17780,17793,17797,17814,17816,17822,17848,17857,17860,17868,17875,17880,17883,17884,17888,17896,17898,
-               17901,17907,17911,17929,17947,17948,17950,17956,17973,17972,17975,17986,17994,17999,18014,18026,18030,18034,18056,18067,18068,18121,
-               18122,18129,18134,18148,18157,18160,18167,18170,18171,18175,18192,18195,18208,18246,18258,18277,10101,10276,10325,10421,11023,11026)
+
+        SELECT DISTINCT userID, contractMobile as mobile FROM (
+            SELECT u.userID, c.contractMobile FROM club c
+                   LEFT JOIN USER u ON c.userID = u.userID
+                   LEFT JOIN cm_organ_value_system covs ON u.userID = covs.userID
+                   LEFT JOIN cm_behavior_record cbr ON cbr.userID = u.userID
+            WHERE c.firstClubType = 1 AND (covs.activeState = '新增用户' OR covs.activeState = '活跃用户' OR covs.activeState = '不活跃用户' OR covs.activeState = '忠诚用户')
+              AND (cbr.pageLabel LIKE '%水光%' OR cbr.pageLabel LIKE '%水光仪%' OR cbr.pageLabel LIKE '%水光针' OR cbr.pageLabel LIKE '%有证水光仪%' OR cbr.pageLabel LIKE '%颜层水光%')
+
+            UNION
+
+            SELECT u.userID, c.contractMobile FROM club  c
+                   LEFT JOIN USER u ON u.userID = c.userID
+                   LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubID
+            WHERE c.firstClubType = 1 AND ccr.addTime LIKE '%2023%' AND (ccr.remarks LIKE '%水光仪%' OR ccr.remarks LIKE '%颜层%' OR ccr.remarks LIKE '%水光针%')
+
+            UNION
+
+            SELECT u.userID, c.contractMobile FROM club c
+                       LEFT JOIN USER u ON u.userID = c.userID
+                       LEFT JOIN
+                (SELECT DISTINCT c.clubID,COUNT(ccr.id) AS num FROM club c
+                LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubID WHERE c.addTime LIKE '%2023%'  GROUP BY c.clubID HAVING COUNT(ccr.id) = 0) AS xs ON xs.clubID = c.clubID
+            WHERE c.firstClubType = 1 AND xs.num = 0
+
+            UNION
+
+            SELECT DISTINCT u.userID, c.contractMobile
+            FROM USER u
+             LEFT JOIN club c ON c.userID = u.userID
+             LEFT JOIN cm_behavior_record cbr ON cbr.userID = u.userID
+            WHERE c.firstClubType = 2 AND cbr.pageType = 28
+              AND u.userID NOT IN ( SELECT userID FROM cm_svip_user WHERE delFlag != 0 OR NOW() BETWEEN beginTime AND endTime)
+        ) b
     </select>
 </mapper>