|
@@ -3,31 +3,29 @@ package com.caimei365.tools.task;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei365.tools.mapper.MessageCenterMapper;
|
|
|
import com.caimei365.tools.mapper.OrderClubMapper;
|
|
|
-import com.caimei365.tools.model.po.CmCouponPo;
|
|
|
-import com.caimei365.tools.model.po.CmUserPo;
|
|
|
-import com.caimei365.tools.model.po.MessageCenterPo;
|
|
|
-import com.caimei365.tools.model.po.OrderVo;
|
|
|
+import com.caimei365.tools.model.dto.message.InsideMessage;
|
|
|
+import com.caimei365.tools.model.dto.message.MessageModel;
|
|
|
+import com.caimei365.tools.model.dto.message.WechatTemplateMessage;
|
|
|
+import com.caimei365.tools.model.dto.message.enums.MessageType;
|
|
|
+import com.caimei365.tools.model.po.*;
|
|
|
+import com.caimei365.tools.service.MessageSender;
|
|
|
import com.caimei365.tools.service.WeChatService;
|
|
|
import com.caimei365.tools.utils.SmsUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
-import org.apache.juli.logging.Log;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
-import redis.clients.jedis.Jedis;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
-import java.util.concurrent.ScheduledExecutorService;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
|
/**
|
|
|
* Description
|
|
@@ -46,181 +44,151 @@ public class ShopMessTask {
|
|
|
|
|
|
@Resource
|
|
|
private OrderClubMapper orderClubMapper;
|
|
|
- @Resource
|
|
|
- private WeChatService weChatService;
|
|
|
-
|
|
|
-// @SneakyThrows
|
|
|
-// public static void main(String[] args) {
|
|
|
-// Calendar calendar = Calendar.getInstance();
|
|
|
-//
|
|
|
-// Date d = new Date();
|
|
|
-// Date time=new Date();
|
|
|
-// //1.日期格式
|
|
|
-// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH");
|
|
|
-// String receiptDate="2022-08-02 19:07:46";
|
|
|
-//// if(!receiptDate.contains(":")){
|
|
|
-//// receiptDate+=" 00:00:01";
|
|
|
-//// }
|
|
|
-//
|
|
|
-// Date s= sdf.parse(receiptDate);
|
|
|
-//
|
|
|
-// calendar.setTime(time);
|
|
|
-// calendar.add(Calendar.HOUR, -1);
|
|
|
-// String hTime= sdf.format(calendar.getTime());
|
|
|
-// Integer i= hTime.compareTo(sdf.format(s));
|
|
|
-// System.out.println(i);
|
|
|
-// System.out.println(hTime);
|
|
|
-// System.out.println(s);
|
|
|
-////if(i==0){
|
|
|
-////
|
|
|
-////}
|
|
|
-//// time = sdf.parse(receiptDate);
|
|
|
-////
|
|
|
-//// calendar.setTime(time);
|
|
|
-////// calendar.add(Calendar.YEAR, 1);
|
|
|
-//// String dateStrings = sdf.format(calendar.getTime());
|
|
|
-//// //2.到期时间
|
|
|
-////
|
|
|
-//// Date da1 = da1 = sdf.parse(dateStrings);
|
|
|
-//// //到期时间-当前时间=还剩多少天
|
|
|
-//// Long s = (da1.getTime() - d.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
-//// System.out.println(da1);
|
|
|
-//// System.out.println(d);
|
|
|
-//// System.out.println(s);
|
|
|
-// }
|
|
|
-
|
|
|
- @Scheduled(cron = "0 0 15 * * ?")
|
|
|
-// @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
- public void Timesjf() {
|
|
|
- log.info("上架费过期推送开始");
|
|
|
- //1.获取下午3点的时间
|
|
|
- List<Integer> shopIDs = messageCenterMapper.receiptShopID();
|
|
|
- shopIDs.forEach(shopID -> {
|
|
|
- if (shopID != null) {
|
|
|
- String receiptDate = messageCenterMapper.receiptDate(shopID);
|
|
|
- Double receiptAmount = messageCenterMapper.receiptAmount(shopID);
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
- String firsts = "";
|
|
|
+ @Resource
|
|
|
+ private MessageSender messageSender;
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 15 * * ?")
|
|
|
+ public void outTimePutAwayFee() {
|
|
|
+ log.info("-------------------------------上架费过期推送开始-------------------------------");
|
|
|
+ putAwayFee(0);
|
|
|
+ putAwayFee(7);
|
|
|
+ putAwayFee(30);
|
|
|
+ log.info("-------------------------------上架费过期推送结束-------------------------------");
|
|
|
+ }
|
|
|
|
|
|
- Date d = new Date();
|
|
|
- Date time = new Date();
|
|
|
- //1.日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- if (!receiptDate.contains(":")) {
|
|
|
- receiptDate += " 00:00:01";
|
|
|
- }
|
|
|
- try {
|
|
|
- time = sdf.parse(receiptDate);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- calendar.setTime(time);
|
|
|
- calendar.add(Calendar.YEAR, 1);
|
|
|
- String dateStrings = sdf.format(calendar.getTime());
|
|
|
- //2.到期时间
|
|
|
- Date da1 = new Date();
|
|
|
- try {
|
|
|
- da1 = sdf.parse(dateStrings);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- //到期时间-当前时间=还剩多少天
|
|
|
- Long s = (da1.getTime() - d.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- //3.输出间隔天数 getTime获取的是毫秒
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String current = dateFormat.format(new Date());
|
|
|
- MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
- //推送信息中心-上架费服务通知
|
|
|
- if (s <= 0) {
|
|
|
- messageCenter.setShopId(shopID);
|
|
|
- messageCenter.setClubId(null);
|
|
|
- messageCenter.setUserType(2);
|
|
|
- messageCenter.setMessageType(3);
|
|
|
- messageCenter.setShopTieredType(1);
|
|
|
- messageCenter.setContent("已过期");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- } else if (s == 1) {
|
|
|
- messageCenter.setShopId(shopID);
|
|
|
- messageCenter.setClubId(null);
|
|
|
- messageCenter.setUserType(2);
|
|
|
- messageCenter.setMessageType(3);
|
|
|
- messageCenter.setShopTieredType(1);
|
|
|
- messageCenter.setContent("今日后到期");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String mobile = messageCenterMapper.contractMobiles(shopID);
|
|
|
- String content = "您的供应商账号上架费将于今日后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, mobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(mobile + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(mobile + "发送失败");
|
|
|
- }
|
|
|
- firsts = "尊敬的采美供应商用户,您的账号维护费用今天后即将到期!";
|
|
|
- } else if (s == 7) {
|
|
|
- messageCenter.setShopId(shopID);
|
|
|
- messageCenter.setClubId(null);
|
|
|
- messageCenter.setUserType(2);
|
|
|
- messageCenter.setMessageType(3);
|
|
|
- messageCenter.setShopTieredType(1);
|
|
|
- messageCenter.setContent("7日后到期");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String mobile = messageCenterMapper.contractMobiles(shopID);
|
|
|
- String content = "您的供应商账号上架费将于7日后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, mobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(mobile + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(mobile + "发送失败");
|
|
|
- }
|
|
|
- firsts = "尊敬的采美供应商用户,您的账号维护费用7天后即将到期!";
|
|
|
- } else if (s == 30) {
|
|
|
- messageCenter.setShopId(shopID);
|
|
|
- messageCenter.setClubId(null);
|
|
|
- messageCenter.setUserType(2);
|
|
|
- messageCenter.setMessageType(3);
|
|
|
- messageCenter.setShopTieredType(1);
|
|
|
- messageCenter.setContent("30日后到期");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String mobile = messageCenterMapper.contractMobiles(shopID);
|
|
|
- String content = "您的供应商账号上架费将于30日后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, mobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(mobile + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(mobile + "发送失败");
|
|
|
- }
|
|
|
- firsts = "尊敬的采美供应商用户,您的账号维护费用30天后即将到期!";
|
|
|
- }
|
|
|
- try {
|
|
|
- Integer userId = messageCenterMapper.userIds(shopID);
|
|
|
- String accessToken = weChatService.getAccessToken();
|
|
|
- String openid = messageCenterMapper.getOpenidListByPermission(messageCenterMapper.FromUnionId(userId));
|
|
|
- // 跳转到【小程序付款-选择支付方式页面】
|
|
|
- String pagePath = "https://www.caimei365.com/";
|
|
|
- // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
|
|
|
- weChatService.messtemes(accessToken, openid, firsts, receiptDate, sdf.format(da1), receiptAmount, pagePath);
|
|
|
- } catch (Exception e) {
|
|
|
+// @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
+ @Scheduled(cron = "0 0 11 * * ?")
|
|
|
+ public void outTimeQualification() {
|
|
|
+ log.info("---------------------------开始检测商品资质证书是否过期-------------------------------");
|
|
|
+ //1,7,30,90
|
|
|
+ qualification(0);
|
|
|
+ qualification(7);
|
|
|
+ qualification(30);
|
|
|
+ qualification(91);
|
|
|
+ log.info("---------------------------检测商品资质证书是否过期结束-------------------------------");
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ public void qualification(Integer day) {
|
|
|
+ StringBuilder productNames = new StringBuilder();
|
|
|
+ StringBuilder productIds = new StringBuilder();
|
|
|
+ List<QualificationPo> pro = messageCenterMapper.findOutTimeQualification(day);
|
|
|
+ log.info(day+"天证书过期的有-------------------》"+pro.toString());
|
|
|
+ String contentDay = 0 == day ? "今天" : 7 == day ? "7天" : 30 == day ? "一个月" : "三个月";
|
|
|
+ String content = "该商品的资质证书将于" + contentDay + "后失效,请及时登录采美网站上传新证书。";
|
|
|
+ String theme = "以下械字号商品的资质证书将于" + contentDay + "后失效,请及时提醒供应商更换证书。";
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ messageCenter.userType(2).messageType(2).shopMessType(5).content(content);
|
|
|
+ WechatTemplateMessage wechat = new WechatTemplateMessage();
|
|
|
+ wechat.templateId("gpD9TqBpkgaw3YSM_JPk4WSTwKZY0hxrBCH0SjzNKY4").url("https://www.caimei365.com/").appid("wxf3cd4ae0cdd11c36")
|
|
|
+ .first("您好,您有商品资质证书即将到期。").pagePath("");
|
|
|
+ pro.forEach(p -> {
|
|
|
+ productNames.append("(").append(p.productId()).append(")").append(p.productName());
|
|
|
+ productIds.append(p.productId()).append(",");
|
|
|
+ messageCenter.productId(p.productId());
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
|
+ strings.add(p.shopName());
|
|
|
+ strings.add("医疗器械注册证");
|
|
|
+ strings.add(p.qualificationNo());
|
|
|
+ strings.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+ //todo 傻逼写法,拿不到值,有空再改
|
|
|
+ String openid = messageCenterMapper.getOpenidListByPermission(p.shopId());
|
|
|
+ wechat.remark(p.productName()).openId(openid).keyWords(strings);
|
|
|
+ MessageModel<WechatTemplateMessage> we = new MessageModel<>();
|
|
|
+ messageSender.messageSend(we.code(MessageType.WECHAT_TEMPLATE_MESSAGE).info(wechat));
|
|
|
+ log.info("资质证书" + day + "天-----productNames------------>" + productNames + "productIds----------->" + productIds);
|
|
|
+ });
|
|
|
+ if (null != pro && pro.size() > 0) {
|
|
|
+ String names = productNames.toString();
|
|
|
+ String ids = productIds.toString();
|
|
|
+ names = names.endsWith(",") ? names.substring(0, names.lastIndexOf(",")) : names;
|
|
|
+ ids = ids.endsWith(",") ? ids.substring(0, ids.lastIndexOf(",")) : ids;
|
|
|
+ if (names.length() > 10) {
|
|
|
+ names = StringUtils.strip(names.substring(0, 11));
|
|
|
+ names += "...";
|
|
|
}
|
|
|
- log.info("上架费过期推送结束");
|
|
|
+ Notification notification = new Notification();
|
|
|
+ notification.theme(theme).shopContent(names).productId(ids);
|
|
|
+ messageCenterMapper.addNotification(notification);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void putAwayFee(Integer day) {
|
|
|
+ List<ShopReceiptVo> shopIds = messageCenterMapper.findExpireShopId(day);
|
|
|
+ String contentDay = day > 7 ? "30" : 7 == day ? "7" : "今";
|
|
|
+ StringBuilder shopNames = new StringBuilder();
|
|
|
+ StringBuilder shopsId = new StringBuilder();
|
|
|
+ String firsts = "尊敬的采美供应商用户,您的账号维护费用" + contentDay + "天后即将到期!";
|
|
|
+ String content = "您的供应商账号上架费将于" + contentDay + "日后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365。退订回T";
|
|
|
+ shopIds.forEach(s -> {
|
|
|
+ //站内信
|
|
|
+ MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
|
|
|
+ insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE).info(new InsideMessage().shopId(s.getShopId()).userType(2)
|
|
|
+ .messageType(3).shopTieredType(1).content("今日后到期"));
|
|
|
+ messageSender.messageSend(insideMessageMessageModel);
|
|
|
+ //短信
|
|
|
+ String mobile = messageCenterMapper.contractMobiles(s.getShopId());
|
|
|
+ String result = SmsUtil.sendSms(3, mobile, content);
|
|
|
+ log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
+ //微信模板消息
|
|
|
+ MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<>();
|
|
|
+ String pagePath = "https://www.caimei365.com/";
|
|
|
+ //todo 傻逼写法,拿不到值,有空再改
|
|
|
+ String openid = messageCenterMapper.getOpenidListByPermission(s.getShopId());
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
|
+ strings.add("维护费");
|
|
|
+ strings.add("年付");
|
|
|
+ strings.add(s.getValidityDate());
|
|
|
+ strings.add(s.getDateStrings());
|
|
|
+ strings.add(s.getReceiptAmount().toString());
|
|
|
+ WechatTemplateMessage weChat = new WechatTemplateMessage().first(firsts).openId(openid).pagePath(pagePath).keyWords(strings)
|
|
|
+ .templateId("jYUIq63wP6mGFvkgNHgTOXAgF7j6h_VZKgST_-2fqCo").remark("为了更好给您服务,请及时联系采美客服缴费!").appid("wx91c4152b60ca91a3").url(pagePath);
|
|
|
+ MessageModel<WechatTemplateMessage> weChatMessage = wechatTemplateMessageMessageModel.code(MessageType.WECHAT_TEMPLATE_MESSAGE).info(weChat);
|
|
|
+ messageSender.messageSend(weChatMessage);
|
|
|
+ shopNames.append(s.getShopName()).append(",");
|
|
|
+ shopsId.append(s.getShopId()).append(",");
|
|
|
+ log.info("上架费" + day + "天--shopName---------------->" + shopNames + "shopIds---------------->" + shopIds);
|
|
|
});
|
|
|
+ if (null != shopIds && shopIds.size() > 0) {
|
|
|
+ String s = shopNames.toString();
|
|
|
+ String sn = shopsId.toString();
|
|
|
+ String shopDay = 0 == day ? "今天" : 7 == day ? "7天" : "一个月";
|
|
|
+ String theme = "以下供应商的上架费将于" + shopDay + "后到期,请及时提醒供应商续费。";
|
|
|
+ s = s.endsWith(",") ? s.substring(0, s.lastIndexOf(",")) : s;
|
|
|
+ sn = sn.endsWith(",") ? sn.substring(0, sn.lastIndexOf(",")) : sn;
|
|
|
+ Notification notification = new Notification();
|
|
|
+ notification.theme(theme).shopContent(s).shopId(sn);
|
|
|
+ messageCenterMapper.addNotification(notification);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ @Scheduled(cron = "0 0 15 * * ?")
|
|
|
+ public void putAwayFeeForManager() {
|
|
|
+ log.info("---------------------------上架费三个月过期推送开始-------------------------------");
|
|
|
+ //后台上架费三个月过期推送
|
|
|
+ List<ShopReceiptVo> shopIds = messageCenterMapper.findExpireShopId(90);
|
|
|
+ log.info("上架费三个月过期的有----------------》" + shopIds.toString());
|
|
|
+ StringBuilder shopNames = new StringBuilder();
|
|
|
+ StringBuilder shopsId = new StringBuilder();
|
|
|
+ shopIds.forEach(s -> {
|
|
|
+ shopNames.append(s.getShopName()).append(",");
|
|
|
+ shopsId.append(s.getShopId()).append(",");
|
|
|
+ log.info("上架费三个月----------------->shopName---------------->" + shopNames + "shopIds---------------->" + shopIds);
|
|
|
+ });
|
|
|
+ if (null != shopIds && shopIds.size() > 0) {
|
|
|
+ String s = shopNames.toString();
|
|
|
+ String sn = shopsId.toString();
|
|
|
+ s = s.endsWith(",") ? s.substring(0, s.lastIndexOf(",")) : s;
|
|
|
+ sn = sn.endsWith(",") ? sn.substring(0, sn.lastIndexOf(",")) : sn;
|
|
|
+ Notification notification = new Notification();
|
|
|
+ notification.theme("以下供应商的上架费将于3个月后到期,请及时提醒供应商续费。").shopContent(s).shopId(sn);
|
|
|
+ messageCenterMapper.addNotification(notification);
|
|
|
+ }
|
|
|
+ log.info("---------------------------上架费三个月过期推送结束-------------------------------");
|
|
|
+ }
|
|
|
|
|
|
@Scheduled(cron = "0 0 10 15 * ?")
|
|
|
-//@Scheduled(cron = "0 0/10 * * * ?")
|
|
|
public void gwc() {
|
|
|
log.info("------------开始推送购物车相关短信------------------------>");
|
|
|
List<Integer> userId = orderClubMapper.userIds();
|
|
@@ -249,354 +217,71 @@ public class ShopMessTask {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
log.info("------------推送购物车相关短信-结束----------------------->");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @Scheduled(cron = "0 0 15 * * ?")
|
|
|
- public void ConSumertime() {
|
|
|
- log.info("》》》》》》》》》》》开始检测优惠券是否生效");
|
|
|
- List<CmCouponPo> coupons = messageCenterMapper.couponTime();
|
|
|
- coupons.forEach(cmCoupon -> {
|
|
|
- List<Integer> clubIds = messageCenterMapper.ClubIds();
|
|
|
- new Thread(() -> clubIds.forEach(clubId -> {
|
|
|
- Jedis jedis = null;
|
|
|
- String constraint = "";
|
|
|
- if (clubId != null) {
|
|
|
- MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
- Date date = new Date();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- CmUserPo user = messageCenterMapper.clubList(clubId);
|
|
|
- int coumt = 0;//计数五种消息只推送一条
|
|
|
- String catego = "";
|
|
|
- Integer ts = (date.compareTo(cmCoupon.getStartDate()));
|
|
|
- if (ts >= 0) {
|
|
|
- if ("90".equals(user.getClubStatus()) && 0 == cmCoupon.getCouponType()) {
|
|
|
- CmCouponPo coupon = messageCenterMapper.CouponList(0);//查询优惠券信息
|
|
|
- if (coupon != null) {
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setContent(null);
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenter.setCouponType(0);
|
|
|
- messageCenter.setCouponMessageType(1);
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String content = "采美平台送您" + coupon.getCouponAmount() + "元优惠券,众多大牌正品等着您,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取下单吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, user.getBindMobile(), content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- coumt++;
|
|
|
- }
|
|
|
- }
|
|
|
- if ("90".equals(user.getClubStatus()) && coumt == 0 && 1 == cmCoupon.getCouponType()) {
|
|
|
- CmCouponPo coupon = messageCenterMapper.CouponList(1);//查询优惠券信息
|
|
|
- if (coupon != null) {
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- if (coupon != null && "1".equals(coupon.getCategoryType())) {
|
|
|
- catego = "产品";
|
|
|
- }
|
|
|
- if (coupon != null && "2".equals(coupon.getCategoryType())) {
|
|
|
- catego = "仪器";
|
|
|
- }
|
|
|
- messageCenter.setContent(catego);
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenter.setCouponType(1);
|
|
|
- messageCenter.setCouponMessageType(1);
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String content = "采美平台" + catego + "类商品大优惠,采美平台送您" + coupon.getCouponAmount() + "元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, user.getBindMobile(), content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- coumt++;
|
|
|
- }
|
|
|
- }
|
|
|
- if (coumt == 0 && 2 == cmCoupon.getCouponType()) {
|
|
|
- CmCouponPo coupon = messageCenterMapper.CouponList(2);//查询优惠券信息
|
|
|
- if (coupon != null) {
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- if (coupon != null && coupon.getUserId() != null) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setContent(null);
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenter.setCouponType(2);
|
|
|
- messageCenter.setCouponMessageType(1);
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
-
|
|
|
- String content = "为了答谢您对采美平台的支持,采美平台送您" + coupon.getCouponAmount() + "元优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, user.getBindMobile(), content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- coumt++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if ("90".equals(user.getClubStatus()) && coumt == 0 && 3 == cmCoupon.getCouponType()) {
|
|
|
- CmCouponPo coupon = messageCenterMapper.CouponList(3);//查询优惠券信息
|
|
|
- if (coupon != null) {
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setContent(user.getName());
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenter.setCouponType(3);
|
|
|
- messageCenter.setCouponMessageType(1);
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
-
|
|
|
- String content = "采美平台为了回馈客户,赠送您" + coupon.getCouponAmount() + "元的店铺专属优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, user.getBindMobile(), content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- coumt++;
|
|
|
- }
|
|
|
- }
|
|
|
- if (coumt == 0 && 4 == cmCoupon.getCouponType()) {
|
|
|
- CmCouponPo coupon = messageCenterMapper.CouponList(4);//查询优惠券信息
|
|
|
- if (coupon != null) {
|
|
|
- String startDate = sdf.format(coupon.getStartDate());
|
|
|
- int num = startDate.compareTo(user.getRegisterTime());
|
|
|
- if (num > 0) {
|
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
|
- if (coupon != null && coupon.getUserId() != null) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setContent(null);
|
|
|
- messageCenter.setTime(curDateStr);
|
|
|
- messageCenter.setCouponType(4);
|
|
|
- messageCenter.setCouponMessageType(1);
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
-
|
|
|
- String content = "恭喜成功注册采美平台。采美平台赠送您" + coupon.getCouponAmount() + "元新用户优惠券,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台领取吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, user.getBindMobile(), content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- coumt++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }));
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 每天12点推送
|
|
|
+ * 优惠券领取后离失效日只剩7天还没使用,在当天中午12点推送给领取了该优惠券的用户(谁领的给谁发短信)
|
|
|
+ * <p>
|
|
|
+ * 若优惠券有限期小于15天,则上述情况不推送
|
|
|
+ * <p>
|
|
|
+ * 短信模板:【采美365】您有100元优惠券将于7日后过期,快戳采美网站链接www.caimei365.com
|
|
|
+ * 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。
|
|
|
*/
|
|
|
@Scheduled(cron = "0 0 12 * * ?")
|
|
|
-// @Scheduled(cron = "0 0/10 * * * ?")
|
|
|
private void Timerw() {
|
|
|
- log.info(">>>>>7天后下架");
|
|
|
- List<Integer> userIds = messageCenterMapper.CouponUserId();
|
|
|
- userIds.forEach(userId -> {
|
|
|
- List<CmCouponPo> coupons = messageCenterMapper.CouponLists(userId);
|
|
|
- coupons.forEach(coupon -> {
|
|
|
- if (userId != null) {
|
|
|
- CmUserPo user = messageCenterMapper.clubLists(userId);
|
|
|
- String contractMobile = messageCenterMapper.contractMobile(userId);
|
|
|
- Date date = new Date();
|
|
|
- Date d = coupon.getStartDate();
|
|
|
- //1.日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- String endTime = sdf.format(coupon.getEndDate());
|
|
|
- //2.某天的日期
|
|
|
- Date da1 = null;
|
|
|
- try {
|
|
|
- da1 = sdf.parse(endTime);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- Long s = (da1.getTime() - d.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- Long t = (date.getTime() - da1.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String current = dateFormat.format(new Date());
|
|
|
- MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
- //推送信息中心-账户通知
|
|
|
- if (s > 15) {
|
|
|
- if (t == 7) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(Integer.parseInt(user.getClubID()));
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setCouponType(2);
|
|
|
- messageCenter.setCouponMessageType(3);
|
|
|
- messageCenter.setContent("7天");
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String content = "您有" + coupon.getCouponAmount() + "元优惠券将于7日后过期,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, contractMobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ log.info("----------------------------优惠券七天后过期---------------------------------");
|
|
|
+ List<CmCouponPo> coupons = messageCenterMapper.findOutTimeCoupons(7);
|
|
|
+ log.info("优惠券七天过期的有----------------》" + coupons.toString());
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("7天");
|
|
|
+ coupons.forEach(c -> {
|
|
|
+ messageCenter.clubId(c.getClubId()).couponFee(c.getCouponAmount().doubleValue()).couponType(c.getCouponType());
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ String content = "您有" + c.getCouponAmount() + "元优惠券将于7日后过期," +
|
|
|
+ "快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
+ SmsUtil.sendSms(3, content, c.getBindMobile());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 每天10点判断
|
|
|
+ * 优惠券领取后没有使用,在失效日当天,上午10推送给领取了该优惠券的用户(谁领的给谁发短信)
|
|
|
+ * <p>
|
|
|
+ * 短信模板:【采美365】您有100元优惠券今日过期,快戳采美网站链接www.caimei365.com/M2Tr98CG
|
|
|
+ * 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。
|
|
|
*/
|
|
|
@Scheduled(cron = "0 0 10 * * ?")
|
|
|
-// @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
private void Timeto() {
|
|
|
- log.info(">>>>>1天后下架");
|
|
|
- List<Integer> userIds = messageCenterMapper.CouponUserId();
|
|
|
- userIds.forEach(userId -> {
|
|
|
- String contractMobile = messageCenterMapper.contractMobile(userId);
|
|
|
- List<CmCouponPo> coupons = messageCenterMapper.CouponLists(userId);
|
|
|
- coupons.forEach(coupon -> {
|
|
|
- if (userId != null) {
|
|
|
- CmUserPo user = messageCenterMapper.clubLists(userId);
|
|
|
- Date d = new Date();
|
|
|
- //1.日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- String endTime = sdf.format(coupon.getEndDate());
|
|
|
- //2.某天的日期
|
|
|
- Date da1 = null;
|
|
|
- try {
|
|
|
- da1 = sdf.parse(endTime);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- Long s = (da1.getTime() - d.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String current = dateFormat.format(new Date());
|
|
|
- MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
- //推送信息中心-账户通知
|
|
|
- if (s == 1) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(Integer.parseInt(user.getClubID()));
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setCouponType(2);
|
|
|
- messageCenter.setCouponMessageType(3);
|
|
|
- messageCenter.setContent("今日");
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String content = "您有" + coupon.getCouponAmount() + "元优惠券今日过期,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, contractMobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ log.info("----------------------------优惠券一天后过期---------------------------------");
|
|
|
+ List<CmCouponPo> coupons = messageCenterMapper.findOutTimeCoupons(1);
|
|
|
+ log.info("优惠券一天过期的有-----------------》" + coupons.toString());
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("7天");
|
|
|
+ coupons.forEach(c -> {
|
|
|
+ messageCenter.clubId(c.getClubId()).couponFee(c.getCouponAmount().doubleValue()).couponType(c.getCouponType());
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ String content = "您有" + c.getCouponAmount() + "元优惠券将于7日后过期," +
|
|
|
+ "快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
+ SmsUtil.sendSms(3, content, c.getBindMobile());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
- @Scheduled(cron = "0 0 15 * * ?")
|
|
|
- private void Timeth() {
|
|
|
- log.info(">>>>>三天后下架");
|
|
|
- List<Integer> userIds = messageCenterMapper.CouponUserId();
|
|
|
- userIds.forEach(userId -> {
|
|
|
- String contractMobile = messageCenterMapper.contractMobile(userId);
|
|
|
- List<CmCouponPo> coupons = messageCenterMapper.CouponLists(userId);
|
|
|
- coupons.forEach(coupon -> {
|
|
|
- if (userId != null) {
|
|
|
- CmUserPo user = messageCenterMapper.clubLists(userId);
|
|
|
- Date date = new Date();
|
|
|
- Date d = coupon.getStartDate();
|
|
|
- //1.日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- String endTime = sdf.format(coupon.getEndDate());
|
|
|
- //2.某天的日期
|
|
|
- Date da1 = null;
|
|
|
- try {
|
|
|
- da1 = sdf.parse(endTime);
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- Long s = (da1.getTime() - d.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- Long t = (date.getTime() - da1.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String current = dateFormat.format(new Date());
|
|
|
- MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
- //推送信息中心-账户通知
|
|
|
- if (t == 3) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(Integer.parseInt(user.getClubID()));
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(4);
|
|
|
- messageCenter.setCouponType(2);
|
|
|
- messageCenter.setCouponMessageType(3);
|
|
|
- messageCenter.setContent("3天");
|
|
|
- messageCenter.setCouponFee(coupon.getCouponAmount().doubleValue());
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String content = "您有" + coupon.getCouponAmount() + "元优惠券3日后过期,快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
- String result = SmsUtil.sendSms(3, contractMobile, content);
|
|
|
- JSONObject json = (JSONObject) JSONObject.parse(result);
|
|
|
- log.info("发送结果:" + result + ",短信内容:" + content);
|
|
|
- if (null != json && json.getInteger("code") == 0) {
|
|
|
- log.info(user.getBindMobile() + "发送成功");
|
|
|
- } else {
|
|
|
- log.error(user.getBindMobile() + "发送失败");
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
+// @Scheduled(cron = "0 0 15 * * ?")
|
|
|
+ private void Timeth() {
|
|
|
+ log.info("----------------------------优惠券三天后过期---------------------------------");
|
|
|
+ List<CmCouponPo> coupons = messageCenterMapper.findOutTimeCoupons(3);
|
|
|
+ log.info("优惠券三天过期的有-------------------》" + coupons.toString());
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("3天");
|
|
|
+ coupons.forEach(c -> {
|
|
|
+ messageCenter.clubId(c.getClubId()).couponFee(c.getCouponAmount().doubleValue()).couponType(c.getCouponType());
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ String content = "您有" + c.getCouponAmount() + "元优惠券将于3日后过期," +
|
|
|
+ "快戳采美网站链接www.caimei365.com/M2Tr98CG 或微信搜索“采美采购商城”小程序登录采美平台查看使用吧。关注公众号“采美网”获取更多优惠和精彩资讯。退订回T";
|
|
|
+ SmsUtil.sendSms(3, content, c.getBindMobile());
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -632,14 +317,8 @@ public class ShopMessTask {
|
|
|
if (num == 0) {
|
|
|
MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
//推送信息中心-交易物流-待确认超时
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(order.getClubId());
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(1);
|
|
|
- messageCenter.setOrderId(order.getOrderId());
|
|
|
- messageCenter.setOrderMessageType(4);
|
|
|
- messageCenter.setContent("您的订单因超时未付款,系统已自动取消订单!");
|
|
|
- messageCenter.setTime(current);
|
|
|
+ messageCenter.clubId(order.getClubId()).userType(1).messageType(1).orderId(order.getOrderId()).orderMessageType(4)
|
|
|
+ .content("您的订单因超时未付款,系统已自动取消订单!").time(current);
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
}
|
|
|
});
|
|
@@ -664,14 +343,8 @@ public class ShopMessTask {
|
|
|
if (num == 0) {
|
|
|
MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
//推送信息中心-账户通知
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(order.getClubId());
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(1);
|
|
|
- messageCenter.setOrderId(order.getOrderId());
|
|
|
- messageCenter.setOrderMessageType(6);
|
|
|
- messageCenter.setContent(null);
|
|
|
- messageCenter.setTime(current);
|
|
|
+ messageCenter.clubId(order.getClubId()).userType(1).messageType(1).orderId(order.getOrderId()).
|
|
|
+ orderMessageType(6).time(current);
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
}
|
|
|
});
|
|
@@ -695,18 +368,10 @@ public class ShopMessTask {
|
|
|
if (num == 0) {
|
|
|
MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
//推送信息中心-账户通知
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(order.getClubId());
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(1);
|
|
|
- messageCenter.setOrderId(order.getOrderId());
|
|
|
- messageCenter.setOrderMessageType(6);
|
|
|
- messageCenter.setContent("您的订单因超时已被系统自动确认收货!");
|
|
|
- messageCenter.setTime(current);
|
|
|
+ messageCenter.clubId(order.getClubId()).userType(1).messageType(1).orderId(order.getOrderId())
|
|
|
+ .orderMessageType(6).content("您的订单因超时已被系统自动确认收货!").time(current);
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
}
|