|
@@ -111,20 +111,20 @@ public class LoginServiceImpl implements LoginService {
|
|
|
if (count >= 5) {
|
|
|
long s = Long.parseLong(split[1]);
|
|
|
int l = (int) Math.floor((System.currentTimeMillis() - s) / 1000 / 60);
|
|
|
- return ResponseJson.error("该账号暂时被冻结,请" + (30-l) + "分钟后重试或直接修改密码", null);
|
|
|
+ return ResponseJson.error("该账号暂时被冻结,请" + (30 - l) + "分钟后重试或直接修改密码", null);
|
|
|
}
|
|
|
}
|
|
|
// 如果前端传入unionId,则存入返回前端
|
|
|
baseUser.setUnionId(unionId);
|
|
|
|
|
|
- Integer clubId=messageCenterMapper.clubIdCule(baseUser.getUserId());
|
|
|
- Integer savedCount=null;
|
|
|
- if(baseUser.getUserId()!=null){
|
|
|
- Integer shopID=messageCenterMapper.shopID(baseUser.getUserId());
|
|
|
- Integer newReceiptType= messageCenterMapper.newReceiptType(shopID);
|
|
|
- Timerw(baseUser.getUserId());
|
|
|
- Timesjf(baseUser.getUserId());
|
|
|
- }
|
|
|
+ Integer clubId = messageCenterMapper.clubIdCule(baseUser.getUserId());
|
|
|
+ Integer savedCount = null;
|
|
|
+ if (baseUser.getUserId() != null) {
|
|
|
+ Integer shopID = messageCenterMapper.shopID(baseUser.getUserId());
|
|
|
+ Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
|
|
|
+ Timerw(baseUser.getUserId());
|
|
|
+ Timesjf(baseUser.getUserId());
|
|
|
+ }
|
|
|
|
|
|
// 比对密码
|
|
|
String md5Password = Md5Util.md5(password);
|
|
@@ -201,17 +201,17 @@ public class LoginServiceImpl implements LoginService {
|
|
|
log.info("小程序授权登录,返回unionId给前端,用户数据存入Redis,key:wxInfo:applets:" + unionId);
|
|
|
// 协销授权登录
|
|
|
UserLoginVo seller = loginMapper.getServiceProviderUserByOpenId(openId);
|
|
|
- Integer userID=messageCenterMapper.userId(openId);
|
|
|
- Integer clubId=messageCenterMapper.clubIdCule(userID);
|
|
|
- Integer savedCount=null;
|
|
|
-if(userID!=null) {
|
|
|
- Integer shopID = messageCenterMapper.shopID(userID);
|
|
|
- log.info(">>>>>"+shopID);
|
|
|
- Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
|
|
|
- log.info(">>>>>"+newReceiptType);
|
|
|
- Timerw(userID);
|
|
|
- Timesjf(userID);
|
|
|
- }
|
|
|
+ Integer userID = messageCenterMapper.userId(openId);
|
|
|
+ Integer clubId = messageCenterMapper.clubIdCule(userID);
|
|
|
+ Integer savedCount = null;
|
|
|
+ if (userID != null) {
|
|
|
+ Integer shopID = messageCenterMapper.shopID(userID);
|
|
|
+ log.info(">>>>>" + shopID);
|
|
|
+ Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
|
|
|
+ log.info(">>>>>" + newReceiptType);
|
|
|
+ Timerw(userID);
|
|
|
+ Timesjf(userID);
|
|
|
+ }
|
|
|
if (null != seller) {
|
|
|
loginMapper.updateServiceProviderUnionId(seller.getUserId(), unionId);
|
|
|
String token = JwtUtil.createToken(seller.getUserId());
|
|
@@ -232,49 +232,49 @@ if(userID!=null) {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType,Integer commonId){
|
|
|
+ public ResponseJson<Map<String, Object>> ClubMessageCount(Integer messageType, Integer commonId) {
|
|
|
|
|
|
- Integer count=messageCenterMapper.Count(1,commonId);
|
|
|
- Integer tradeCount= messageCenterMapper.MessageCount(1,1,commonId);
|
|
|
- Integer accountCount=messageCenterMapper.MessageCount(1,2,commonId);
|
|
|
- Integer notificationCount= messageCenterMapper.MessageCount(1,3,commonId);
|
|
|
- Integer promotionCount=messageCenterMapper.MessageCount(1,4,commonId);
|
|
|
+ Integer count = messageCenterMapper.Count(1, commonId);
|
|
|
+ Integer tradeCount = messageCenterMapper.MessageCount(1, 1, commonId);
|
|
|
+ Integer accountCount = messageCenterMapper.MessageCount(1, 2, commonId);
|
|
|
+ Integer notificationCount = messageCenterMapper.MessageCount(1, 3, commonId);
|
|
|
+ Integer promotionCount = messageCenterMapper.MessageCount(1, 4, commonId);
|
|
|
Map<String, Object> map = new HashMap(10);
|
|
|
map.put("count", count);
|
|
|
map.put("tradeCount", tradeCount);
|
|
|
- map.put("account",accountCount);
|
|
|
+ map.put("account", accountCount);
|
|
|
map.put("notificationCount", notificationCount);
|
|
|
- map.put("promotionCount",promotionCount);
|
|
|
-
|
|
|
-
|
|
|
+ map.put("promotionCount", promotionCount);
|
|
|
return ResponseJson.success(map);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType,Integer commonId){
|
|
|
- Integer count=messageCenterMapper.Count(2,commonId);
|
|
|
- Integer tradeCount= messageCenterMapper.MessageCount(2,1,commonId);
|
|
|
- Integer accountCount=messageCenterMapper.MessageCount(2,2,commonId);
|
|
|
- Integer notificationCount= messageCenterMapper.MessageCount(2,3,commonId);
|
|
|
- Integer promotionCount=messageCenterMapper.MessageCount(2,4,commonId);
|
|
|
+ public ResponseJson<Map<String, Object>> shopMessageCount(Integer messageType, Integer commonId) {
|
|
|
+ Integer count = messageCenterMapper.Count(2, commonId);
|
|
|
+ Integer tradeCount = messageCenterMapper.MessageCount(2, 1, commonId);
|
|
|
+ Integer accountCount = messageCenterMapper.MessageCount(2, 2, commonId);
|
|
|
+ Integer notificationCount = messageCenterMapper.MessageCount(2, 3, commonId);
|
|
|
+ Integer promotionCount = messageCenterMapper.MessageCount(2, 4, commonId);
|
|
|
Map<String, Object> map = new HashMap(10);
|
|
|
map.put("count", count);
|
|
|
map.put("tradeCount", tradeCount);
|
|
|
- map.put("accountCount",accountCount);
|
|
|
+ map.put("accountCount", accountCount);
|
|
|
map.put("notificationCount", notificationCount);
|
|
|
- map.put("promotionCount",promotionCount);
|
|
|
+ map.put("promotionCount", promotionCount);
|
|
|
return ResponseJson.success(map);
|
|
|
}
|
|
|
- @Override
|
|
|
- public ResponseJson<Map<String, Object>> ShopCount(Integer messageType,Integer commonId){
|
|
|
- Integer count=messageCenterMapper.Count(2,commonId);
|
|
|
- Map<String, Object> map = new HashMap(10);
|
|
|
- map.put("count", count);
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> ShopCount(Integer messageType, Integer commonId) {
|
|
|
+ Integer count = messageCenterMapper.Count(2, commonId);
|
|
|
+ Map<String, Object> map = new HashMap(10);
|
|
|
+ map.put("count", count);
|
|
|
return ResponseJson.success(map);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> ClubCount(Integer messageType,Integer commonId){
|
|
|
- Integer count=messageCenterMapper.Count(1,commonId);
|
|
|
+ public ResponseJson<Map<String, Object>> ClubCount(Integer messageType, Integer commonId) {
|
|
|
+ Integer count = messageCenterMapper.Count(1, commonId);
|
|
|
Map<String, Object> map = new HashMap(10);
|
|
|
map.put("count", count);
|
|
|
return ResponseJson.success(map);
|
|
@@ -282,91 +282,84 @@ if(userID!=null) {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Integer updateMessageAsRead(Integer messageType,Integer commonId){
|
|
|
-
|
|
|
-
|
|
|
- return messageCenterMapper.updateMessageAsRead(1,messageType,commonId);
|
|
|
+ public Integer updateMessageAsRead(Integer messageType, Integer commonId) {
|
|
|
+ return messageCenterMapper.updateMessageAsRead(1, messageType, commonId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Integer updateShopMessageAsRead(Integer messageType,Integer commonId){
|
|
|
-
|
|
|
- return messageCenterMapper.updateMessageAsRead(2,messageType,commonId);
|
|
|
- }
|
|
|
- @Override
|
|
|
- public Integer deleteMessage(String id){
|
|
|
- Integer num=0;
|
|
|
- String[] IdArr = id.split(",");
|
|
|
- for (int i = 0; i < IdArr.length; i++) {
|
|
|
- num= messageCenterMapper.deleteMessage(IdArr[i]);
|
|
|
- }
|
|
|
- return num;
|
|
|
+ public Integer updateShopMessageAsRead(Integer messageType, Integer commonId) {
|
|
|
+ return messageCenterMapper.updateMessageAsRead(2, messageType, commonId);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public Integer updateRead(Integer userType,String Id){
|
|
|
- Integer num=0;
|
|
|
- String[] IdArr = Id.split(",");
|
|
|
- for (int i = 0; i < IdArr.length; i++) {
|
|
|
- num= messageCenterMapper.updateRead(userType,IdArr[i]);
|
|
|
- }
|
|
|
+ public Integer deleteMessage(String id) {
|
|
|
+ Integer num = 0;
|
|
|
+ String[] IdArr = id.split(",");
|
|
|
+ for (int i = 0; i < IdArr.length; i++) {
|
|
|
+ num = messageCenterMapper.deleteMessage(IdArr[i]);
|
|
|
+ }
|
|
|
+ return num;
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public Integer updateRead(Integer userType, String Id) {
|
|
|
+ Integer num = 0;
|
|
|
+ String[] IdArr = Id.split(",");
|
|
|
+ for (int i = 0; i < IdArr.length; i++) {
|
|
|
+ num = messageCenterMapper.updateRead(userType, IdArr[i]);
|
|
|
+ }
|
|
|
return num;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId,Integer messageType,Integer source,int pageNum, int pageSize){
|
|
|
-
|
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<MessageCenter> list=messageCenterMapper.MessageList(1,messageType,commonId);
|
|
|
- list.forEach(mess -> {
|
|
|
- if(mess.getClubId()!=null){
|
|
|
- MessageCenter messageCenter= messageCenterMapper.MainImage(1,commonId);
|
|
|
- if(messageCenter!=null){
|
|
|
- mess.setMainImage(messageCenter.getMainImage());
|
|
|
- mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
|
|
|
- if(messageCenter.getProductName().length()>10){
|
|
|
- mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
|
|
|
- }else {
|
|
|
- mess.setProductName(messageCenter.getProductName());
|
|
|
+ public ResponseJson<PageInfo<MessageCenter>> ClubMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
+ List<MessageCenter> list = messageCenterMapper.MessageList(1, messageType, commonId);
|
|
|
+ list.forEach(mess -> {
|
|
|
+ if (null != mess.getClubId()) {
|
|
|
+ MessageCenter messageCenter = messageCenterMapper.MainImage(1, commonId);
|
|
|
+ if (null != messageCenter) {
|
|
|
+ mess.setMainImage(messageCenter.getMainImage());
|
|
|
+ mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
|
|
|
+ if (messageCenter.getProductName().length() > 10) {
|
|
|
+ mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
|
|
|
+ } else {
|
|
|
+ mess.setProductName(messageCenter.getProductName());
|
|
|
+ }
|
|
|
+ mess.setProductCount(messageCenter.getProductCount());
|
|
|
+ mess.setRefundType(messageCenter.getRefundType());
|
|
|
}
|
|
|
- mess.setProductCount(messageCenter.getProductCount());
|
|
|
- mess.setRefundType(messageCenter.getRefundType());
|
|
|
}
|
|
|
-
|
|
|
+ });
|
|
|
+ if (source == 2) {
|
|
|
+ messageCenterMapper.updateMessageAsRead(1, messageType, commonId);
|
|
|
}
|
|
|
- });
|
|
|
- if(source ==2){
|
|
|
- messageCenterMapper.updateMessageAsRead(1,messageType,commonId);
|
|
|
- }
|
|
|
-
|
|
|
- PageInfo<MessageCenter> pageData = new PageInfo<>(list);
|
|
|
+ PageInfo<MessageCenter> pageData = new PageInfo<>(list);
|
|
|
return ResponseJson.success(pageData);
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
- public ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId,Integer messageType,Integer source, int pageNum, int pageSize){
|
|
|
+ public ResponseJson<PageInfo<MessageCenter>> shopMessageList(Integer commonId, Integer messageType, Integer source, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<MessageCenter> list=messageCenterMapper.MessageList(2,messageType,commonId);
|
|
|
+ List<MessageCenter> list = messageCenterMapper.MessageList(2, messageType, commonId);
|
|
|
list.forEach(mess -> {
|
|
|
- if(mess.getShopId()!=null){
|
|
|
- MessageCenter messageCenter= messageCenterMapper.MainImage(2,commonId);
|
|
|
- if(messageCenter!=null){
|
|
|
+ if (mess.getShopId() != null) {
|
|
|
+ MessageCenter messageCenter = messageCenterMapper.MainImage(2, commonId);
|
|
|
+ if (messageCenter != null) {
|
|
|
mess.setMainImage(messageCenter.getMainImage());
|
|
|
mess.setOnlinePayFlag(messageCenter.getOnlinePayFlag());
|
|
|
- if(messageCenter.getProductName().length()>10){
|
|
|
+ if (messageCenter.getProductName().length() > 10) {
|
|
|
mess.setProductName(StringUtils.strip(messageCenter.getProductName().substring(0, 11)));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
mess.setProductName(messageCenter.getProductName());
|
|
|
}
|
|
|
mess.setProductCount(messageCenter.getProductCount());
|
|
|
mess.setRefundType(messageCenter.getRefundType());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
- if(source ==2) {
|
|
|
+ if (source == 2) {
|
|
|
messageCenterMapper.updateMessageAsRead(2, messageType, commonId);
|
|
|
}
|
|
|
PageInfo<MessageCenter> pageData = new PageInfo<>(list);
|
|
@@ -374,27 +367,24 @@ if(userID!=null) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 当天天下午3点推送
|
|
|
*/
|
|
|
private Void Timesjf(Integer userId) throws ParseException {
|
|
|
//1.获取下午3点的时间
|
|
|
- SimpleDateFormat dnf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
+ SimpleDateFormat dnf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
Calendar time = Calendar.getInstance();
|
|
|
time.set(Calendar.HOUR_OF_DAY, 15);
|
|
|
time.set(Calendar.MINUTE, 00);
|
|
|
time.set(Calendar.SECOND, 00);
|
|
|
-
|
|
|
String times = dnf.format(time.getTime());
|
|
|
System.out.println(times);
|
|
|
//2.某天的日期
|
|
|
- Date date=dnf.parse(times);
|
|
|
+ Date date = dnf.parse(times);
|
|
|
//与当前时间的毫秒数相减得到相差的毫秒用于定时
|
|
|
- Long h=(date.getTime()-date.getTime());
|
|
|
+ Long h = (date.getTime() - date.getTime());
|
|
|
//这里如果当前时间大于下午三点会出现负数所以就不推送
|
|
|
- if(h>0) {
|
|
|
+ if (h > 0) {
|
|
|
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
|
|
executorService.schedule(new Runnable() {
|
|
|
@SneakyThrows
|
|
@@ -403,7 +393,7 @@ if(userID!=null) {
|
|
|
Integer shopID = messageCenterMapper.shopID(userId);
|
|
|
if (shopID != null) {
|
|
|
String receiptDate = messageCenterMapper.receiptDate(shopID);
|
|
|
- Double receiptAmount=messageCenterMapper.receiptAmount(shopID);
|
|
|
+ Double receiptAmount = messageCenterMapper.receiptAmount(shopID);
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
Integer clubId = messageCenterMapper.clubIdCule(userId);
|
|
@@ -474,21 +464,20 @@ if(userID!=null) {
|
|
|
messageCenter.setTime(current);
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
}
|
|
|
-
|
|
|
- try {
|
|
|
- log.info("***********上架费过期微信公众号推送************");
|
|
|
- String accessToken = weChatService.getAccessToken();
|
|
|
- String openid = messageCenterMapper.getOpenidListByPermission(messageCenterMapper.FromUnionId(userId));
|
|
|
- String date=s.toString();
|
|
|
- String remarkText = "如在使用中有任何疑问,请在小程序内联系在线客服";
|
|
|
- // 跳转到【小程序付款-选择支付方式页面】
|
|
|
- String pagePath = "https://www.caimei365.com/";
|
|
|
- // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
|
|
|
- log.error("获取openid>>>>>" + openid);
|
|
|
- weChatService.sendTemplate(accessToken,openid,date,receiptDate,dateStrings,receiptAmount,remarkText, pagePath);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("【上架费过期通知】获取微信公众号access_token异常!", e);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ log.info("***********上架费过期微信公众号推送************");
|
|
|
+ String accessToken = weChatService.getAccessToken();
|
|
|
+ String openid = messageCenterMapper.getOpenidListByPermission(messageCenterMapper.FromUnionId(userId));
|
|
|
+ String date = s.toString();
|
|
|
+ String remarkText = "如在使用中有任何疑问,请在小程序内联系在线客服";
|
|
|
+ // 跳转到【小程序付款-选择支付方式页面】
|
|
|
+ String pagePath = "https://www.caimei365.com/";
|
|
|
+ // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
|
|
|
+ log.error("获取openid>>>>>" + openid);
|
|
|
+ weChatService.sendTemplate(accessToken, openid, date, receiptDate, dateStrings, receiptAmount, remarkText, pagePath);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("【上架费过期通知】获取微信公众号access_token异常!", e);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -498,13 +487,12 @@ if(userID!=null) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 当天天下午3点推送超级会员过期条件
|
|
|
*/
|
|
|
private Void Timerw(Integer userId) throws ParseException {
|
|
|
//1.获取下午3点的时间
|
|
|
- SimpleDateFormat dnf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
+ SimpleDateFormat dnf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
Calendar time = Calendar.getInstance();
|
|
|
time.set(Calendar.HOUR_OF_DAY, 15);
|
|
|
time.set(Calendar.MINUTE, 00);
|
|
@@ -513,72 +501,69 @@ if(userID!=null) {
|
|
|
String times = dnf.format(time.getTime());
|
|
|
System.out.println(times);
|
|
|
//2.某天的日期
|
|
|
- Date date=dnf.parse(times);
|
|
|
+ Date date = dnf.parse(times);
|
|
|
//与当前时间的毫秒数相减得到相差的毫秒用于定时
|
|
|
- Long h=(date.getTime()-date.getTime());
|
|
|
+ Long h = (date.getTime() - date.getTime());
|
|
|
//这里如果当前时间大于下午三点会出现负数所以就不推送
|
|
|
- if(h>0){
|
|
|
- ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
|
|
- executorService.schedule(new Runnable() {
|
|
|
- @SneakyThrows
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- SuperVipPo superVip = vipMapper.findSuperVip(userId);
|
|
|
- Integer clubId = messageCenterMapper.clubIdCule(userId);
|
|
|
- if (clubId != null) {
|
|
|
- if (superVip != null) {
|
|
|
- Date d = new Date();
|
|
|
- //1.日期格式
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
- String endTime = sdf.format(superVip.getEndTime());
|
|
|
- //2.某天的日期
|
|
|
- Date da1 = sdf.parse(endTime);
|
|
|
- Long s = (d.getTime() - da1.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
- //3.输出间隔天数 getTime获取的是毫秒
|
|
|
- log.info("输出间隔天数----------->", s);
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String current = dateFormat.format(new Date());
|
|
|
- MessageCenter messageCenter = new MessageCenter();
|
|
|
- //推送信息中心-账户通知
|
|
|
- if (s == 7) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(2);
|
|
|
- messageCenter.setAccountType(3);
|
|
|
- messageCenter.setContent(s + "日后");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String mobile = messageCenterMapper.contractMobile(clubId);
|
|
|
- String content = "【采美365】您的超级会员将于7日后到期,到期后将无法享受专属会员权益,快戳采美网站链接www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台续费吧。关注公众号“采美网”可获取更多优惠和精彩资讯。";
|
|
|
- remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
+ if (h > 0) {
|
|
|
+ ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
|
|
+ executorService.schedule(new Runnable() {
|
|
|
+ @SneakyThrows
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ SuperVipPo superVip = vipMapper.findSuperVip(userId);
|
|
|
+ Integer clubId = messageCenterMapper.clubIdCule(userId);
|
|
|
+ if (clubId != null) {
|
|
|
+ if (superVip != null) {
|
|
|
+ Date d = new Date();
|
|
|
+ //1.日期格式
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
+ String endTime = sdf.format(superVip.getEndTime());
|
|
|
+ //2.某天的日期
|
|
|
+ Date da1 = sdf.parse(endTime);
|
|
|
+ Long s = (d.getTime() - da1.getTime()) / 24 / 60 / 60 / 1000;
|
|
|
+ //3.输出间隔天数 getTime获取的是毫秒
|
|
|
+ log.info("输出间隔天数----------->", s);
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String current = dateFormat.format(new Date());
|
|
|
+ MessageCenter messageCenter = new MessageCenter();
|
|
|
+ //推送信息中心-账户通知
|
|
|
+ if (s == 7) {
|
|
|
+ messageCenter.setShopId(null);
|
|
|
+ messageCenter.setClubId(clubId);
|
|
|
+ messageCenter.setUserType(1);
|
|
|
+ messageCenter.setMessageType(2);
|
|
|
+ messageCenter.setAccountType(3);
|
|
|
+ messageCenter.setContent(s + "日后");
|
|
|
+ messageCenter.setTime(current);
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ String mobile = messageCenterMapper.contractMobile(clubId);
|
|
|
+ String content = "【采美365】您的超级会员将于7日后到期,到期后将无法享受专属会员权益,快戳采美网站链接www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台续费吧。关注公众号“采美网”可获取更多优惠和精彩资讯。";
|
|
|
+ remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
|
|
|
- }
|
|
|
- if (s == 1) {
|
|
|
- messageCenter.setShopId(null);
|
|
|
- messageCenter.setClubId(clubId);
|
|
|
- messageCenter.setUserType(1);
|
|
|
- messageCenter.setMessageType(2);
|
|
|
- messageCenter.setAccountType(3);
|
|
|
- messageCenter.setContent("今日后");
|
|
|
- messageCenter.setTime(current);
|
|
|
- messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
- String mobile = messageCenterMapper.contractMobile(clubId);
|
|
|
- String content = "【采美365】您的超级会员将于今日到期,到期后将无法享受专属会员权益,快戳采美网站链接www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台续费吧。关注公众号“采美网”可获取更多优惠和精彩资讯。";
|
|
|
- remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
+ }
|
|
|
+ if (s == 1) {
|
|
|
+ messageCenter.setShopId(null);
|
|
|
+ messageCenter.setClubId(clubId);
|
|
|
+ messageCenter.setUserType(1);
|
|
|
+ messageCenter.setMessageType(2);
|
|
|
+ messageCenter.setAccountType(3);
|
|
|
+ messageCenter.setContent("今日后");
|
|
|
+ messageCenter.setTime(current);
|
|
|
+ messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ String mobile = messageCenterMapper.contractMobile(clubId);
|
|
|
+ String content = "【采美365】您的超级会员将于今日到期,到期后将无法享受专属会员权益,快戳采美网站链接www.caimei365.com 或微信搜索“采美采购商城”小程序登录采美平台续费吧。关注公众号“采美网”可获取更多优惠和精彩资讯。";
|
|
|
+ remoteCallService.remoteSendSms(0, 1, mobile, content);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }, h, TimeUnit.MILLISECONDS);
|
|
|
+ }, h, TimeUnit.MILLISECONDS);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 微信公众号授权链接(www)
|
|
|
*
|
|
@@ -804,17 +789,17 @@ if(userID!=null) {
|
|
|
String openId = (String) infoData.get(WeChatService.Keys.OPEN_ID);
|
|
|
log.info(">>>>>>pc商城unionId:" + unionId + " ,openId:" + openId);
|
|
|
|
|
|
- Integer userId=messageCenterMapper.userId(openId);
|
|
|
- Integer clubId=messageCenterMapper.clubIdCule(userId);
|
|
|
- Integer savedCount=null;
|
|
|
- if(userId!=null){
|
|
|
- Integer shopID=messageCenterMapper.shopID(userId);
|
|
|
- Integer newReceiptType= messageCenterMapper.newReceiptType(shopID);
|
|
|
- if(shopID==null){
|
|
|
- savedCount= messageCenterMapper.Count(1,clubId);
|
|
|
+ Integer userId = messageCenterMapper.userId(openId);
|
|
|
+ Integer clubId = messageCenterMapper.clubIdCule(userId);
|
|
|
+ Integer savedCount = null;
|
|
|
+ if (userId != null) {
|
|
|
+ Integer shopID = messageCenterMapper.shopID(userId);
|
|
|
+ Integer newReceiptType = messageCenterMapper.newReceiptType(shopID);
|
|
|
+ if (shopID == null) {
|
|
|
+ savedCount = messageCenterMapper.Count(1, clubId);
|
|
|
System.out.println(savedCount);
|
|
|
- }else {
|
|
|
- savedCount= messageCenterMapper.Count(2,shopID);
|
|
|
+ } else {
|
|
|
+ savedCount = messageCenterMapper.Count(2, shopID);
|
|
|
}
|
|
|
}
|
|
|
Timerw(userId);
|
|
@@ -1000,7 +985,7 @@ if(userID!=null) {
|
|
|
messageCenter.setTime(current);
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
//发短信
|
|
|
- String message = "【采美365】恭喜您成功成为运营人员,您可通过微信直接登录采美商城进行采购。";
|
|
|
+ String message = "【采美365】恭喜您成功成为运营人员,您可通过微信直接登录采美商城进行采购。";
|
|
|
String mobile = messageCenterMapper.contractMobile(operation.getClubId());
|
|
|
if (mobile != null && mobile != "") {
|
|
|
remoteCallService.remoteSendSms(2, 3, mobile, message);
|
|
@@ -1010,19 +995,18 @@ if(userID!=null) {
|
|
|
log.info("***********机构通过邀请码登入微信公众号推送************");
|
|
|
String accessToken = weChatService.getAccessToken();
|
|
|
String openid = messageCenterMapper.getOpenidListByPermission(unionId);
|
|
|
- String time=current;
|
|
|
+ String time = current;
|
|
|
String remarkText = "绑定成功后,您可通过微信直接访问采美商城进行采购。";
|
|
|
// 跳转到【小程序付款-选择支付方式页面】
|
|
|
String pagePath = "https://www.caimei365.com/";
|
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
|
|
|
log.error("获取openid>>>>>" + openid);
|
|
|
- weChatService.sendTemplateMessg(accessToken,openid,nickName,time,remarkText, pagePath);
|
|
|
+ weChatService.sendTemplateMessg(accessToken, openid, nickName, time, remarkText, pagePath);
|
|
|
} catch (Exception e) {
|
|
|
log.error("【机构通过邀请码登入通知】获取微信公众号access_token异常!", e);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
} else {
|
|
|
// 供应商Id
|
|
|
operationPo.setShopId(operation.getShopId());
|
|
@@ -1051,13 +1035,13 @@ if(userID!=null) {
|
|
|
log.info("***********供应商通过邀请码登入微信公众号推送************");
|
|
|
String accessToken = weChatService.getAccessToken();
|
|
|
String openid = messageCenterMapper.getOpenidListByPermission(unionId);
|
|
|
- String time=current;
|
|
|
+ String time = current;
|
|
|
String remarkText = "绑定成功后,您可通过微信登录采美商城管理您的账号";
|
|
|
// 跳转到【小程序付款-选择支付方式页面】
|
|
|
String pagePath = "https://www.caimei365.com/";
|
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接
|
|
|
log.error("获取openid>>>>>" + openid);
|
|
|
- weChatService.sendTemplateMessg(accessToken,openid,nickName,time,remarkText, pagePath);
|
|
|
+ weChatService.sendTemplateMessg(accessToken, openid, nickName, time, remarkText, pagePath);
|
|
|
} catch (Exception e) {
|
|
|
log.error("【供应商通过邀请码登入通知】获取微信公众号access_token异常!", e);
|
|
|
}
|
|
@@ -1172,7 +1156,6 @@ if(userID!=null) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
// 绑定状态
|
|
|
operation.setStatus(2);
|
|
|
// 删除标识
|