|
@@ -67,18 +67,17 @@ public class ShopMessTask {
|
|
|
log.info("上架费过期推送结束");
|
|
|
}
|
|
|
|
|
|
- public void putawayFee(Integer day){
|
|
|
- List<ShopReceiptVo> shopIds=messageCenterMapper.findExpireShopId(day);
|
|
|
- String contentDay="今";
|
|
|
- if(7==day){
|
|
|
- contentDay="7";
|
|
|
+ public void putawayFee(Integer day) {
|
|
|
+ List<ShopReceiptVo> shopIds = messageCenterMapper.findExpireShopId(day);
|
|
|
+ String contentDay = "今";
|
|
|
+ if (7 == day) {
|
|
|
+ contentDay = "7";
|
|
|
+ } else if (30 == day) {
|
|
|
+ contentDay = "30";
|
|
|
}
|
|
|
- else if (30==day){
|
|
|
- contentDay="30";
|
|
|
- }
|
|
|
- String firsts = "尊敬的采美供应商用户,您的账号维护费用"+contentDay+"天后即将到期!";
|
|
|
- String content = "您的供应商账号上架费将于"+contentDay+"日后到期,到期后将无法发布和编辑商品,同时也会影响到其他采美提供的支持服务。请联系采美工作人员进行续费,联系电话0755-22907771 或15338851365。退订回T";
|
|
|
- shopIds.forEach(s->{
|
|
|
+ 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)
|
|
@@ -141,349 +140,243 @@ public class ShopMessTask {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @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++;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }));
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
+// @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点推送给领取了该优惠券的用户(谁领的给谁发短信)
|
|
|
+ *
|
|
|
+ * 若优惠券有限期小于15天,则上述情况不推送
|
|
|
+ *
|
|
|
+ * 短信模板:【采美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);
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("7天").time(format);
|
|
|
+ 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推送给领取了该优惠券的用户(谁领的给谁发短信)
|
|
|
+ *
|
|
|
+ * 短信模板:【采美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);
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("7天").time(format);
|
|
|
+ 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() + "发送失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ log.info("----------------------------优惠券三天后过期---------------------------------");
|
|
|
+ List<CmCouponPo> coupons=messageCenterMapper.findOutTimeCoupons(3);
|
|
|
+ MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
+ String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
|
+ messageCenter.userType(1).messageType(4).couponMessageType(3).content("3天").time(format);
|
|
|
+ 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());
|
|
|
});
|
|
|
}
|
|
|
|