|
|
@@ -16,6 +16,7 @@ import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
import com.cyksj.mapper.manage.distribute.DistributeWaitingSendPointsMapper;
|
|
|
import com.cyksj.mapper.manage.sys.WorkOrderMapper;
|
|
|
+import com.cyksj.mapper.market.task.UserBindDetailMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
@@ -101,6 +102,8 @@ public class Scheduler {
|
|
|
|
|
|
private final SchedulerService schedulerService;
|
|
|
|
|
|
+ private final UserBindDetailMapper userBindDetailMapper;
|
|
|
+
|
|
|
private final static List<Long> filter_skuIds = List.of(177l);
|
|
|
|
|
|
/**
|
|
|
@@ -502,5 +505,39 @@ public class Scheduler {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 1w条短信 每小时
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0 12,15,17,18 * * ?")
|
|
|
+ public void marketingMsg() {
|
|
|
+ //获取最大条件
|
|
|
+ String key = RedisService.key.MAKERTING_MSG_KEY.getName();
|
|
|
+ Object value = redisService.get(key);
|
|
|
+ Integer max_filter = 0;
|
|
|
+ if (value != null) {
|
|
|
+ max_filter = Integer.parseInt(value.toString());
|
|
|
+ log.info("过滤条数:{}", max_filter);
|
|
|
+ }
|
|
|
+ //获取手机号 每次获取3000次
|
|
|
+ List<String> phones = userBindDetailMapper.selectPhones(max_filter);
|
|
|
+ if (phones.isEmpty()) {
|
|
|
+ log.info("营销短信已发完");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ log.info("营销短信手机号数量大小:{}", phones.size());
|
|
|
+ try {
|
|
|
+ Boolean isSuccess = SmsUtil.batchSendLuoKey2Msg(phones, "618大促流媒体、Ai会员全场9折!续费可用!电视看奈飞方案最多立减100元!登录https://nf.video/立即下单【银河录像局】");
|
|
|
+ if (isSuccess) {
|
|
|
+ if (value != null) {
|
|
|
+ redisService.incr(key, 10000l);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ redisService.set(key, 10000, RedisService.key.MAKERTING_MSG_KEY.getTimeout());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|