|
|
@ -161,9 +161,9 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { |
|
|
|
//判断用户是否有次数
|
|
|
|
Integer count = null; |
|
|
|
if (WxmpMessageConstant.RESI.equals(clientType)) { |
|
|
|
count = wxmpResiUserSubscribeDao.getResiSubscribeInfo(openId, customerId, templateId); |
|
|
|
count = wxmpResiUserSubscribeDao.getResiSubscribeInfo(openId, templateId, customerId); |
|
|
|
} else if (WxmpMessageConstant.WORK.equals(clientType)) { |
|
|
|
count = wxmpWorkUserSubscribeDao.getWorkSubscribeInfo(openId, customerId, templateId); |
|
|
|
count = wxmpWorkUserSubscribeDao.getWorkSubscribeInfo(openId, templateId, customerId); |
|
|
|
} |
|
|
|
if (count == null) { |
|
|
|
//用户未订阅
|
|
|
@ -203,9 +203,9 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { |
|
|
|
//订阅条数-1
|
|
|
|
int decrease = 0; |
|
|
|
if (WxmpMessageConstant.RESI.equals(clientType)) { |
|
|
|
decrease = wxmpResiUserSubscribeDao.decreaseResiSubscribeCount(openId, customerId, templateId, 1); |
|
|
|
decrease = wxmpResiUserSubscribeDao.decreaseResiSubscribeCount(openId, templateId, customerId, 1); |
|
|
|
} else if (WxmpMessageConstant.WORK.equals(clientType)) { |
|
|
|
decrease = wxmpWorkUserSubscribeDao.decreaseWorkSubscribeCount(openId, customerId, templateId, 1); |
|
|
|
decrease = wxmpWorkUserSubscribeDao.decreaseWorkSubscribeCount(openId, templateId, customerId, 1); |
|
|
|
} |
|
|
|
if (decrease == 0) { |
|
|
|
logger.error("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); |
|
|
@ -221,9 +221,9 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { |
|
|
|
if (errcode.equals(WxmpMessageConstant.USER_REFUSED)) { |
|
|
|
int clear = 0; |
|
|
|
if (WxmpMessageConstant.RESI.equals(clientType)) { |
|
|
|
clear = wxmpResiUserSubscribeDao.clearResiSubscribeCount(openId, customerId, templateId); |
|
|
|
clear = wxmpResiUserSubscribeDao.clearResiSubscribeCount(openId, templateId, customerId); |
|
|
|
} else if (WxmpMessageConstant.WORK.equals(clientType)) { |
|
|
|
clear = wxmpWorkUserSubscribeDao.clearWorkSubscribeCount(openId, customerId, templateId); |
|
|
|
clear = wxmpWorkUserSubscribeDao.clearWorkSubscribeCount(openId, templateId, customerId); |
|
|
|
} |
|
|
|
if (clear == 0) { |
|
|
|
logger.error("消息{}发送失败且清空订阅条数失败", JSON.toJSONString(msg)); |
|
|
|