|
|
|
@@ -12,13 +12,17 @@ import com.iformall.enums.EnumMsgSendStatus; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxMsgCallbackService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import com.iformall.utils.HMACSHA256; |
|
|
|
import com.iformall.utils.RedisCacheUtils; |
|
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
@@ -47,6 +51,10 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMallMapper wxMallMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier("objectCommonRedisTemplate") |
|
|
|
RedisTemplate<String, Object> redisTemplate; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMsgCallback> listAsPage(WxMsgCallback record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -222,6 +230,11 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { |
|
|
|
wxMsgCallbackMapper.updateByBatchNo(wxMsgCallback); |
|
|
|
//失败回滚 回滚数量 |
|
|
|
if (!"true".equalsIgnoreCase(success)) { |
|
|
|
String redisKey = Constant.cache_aliyun_msg+wxMsgCallback.getBatchNo()+":"+wxMsgCallback.getPhone(); |
|
|
|
Integer msgCached = RedisCacheUtils.getCacheInteger(redisTemplate, success); |
|
|
|
if (1== msgCached) { |
|
|
|
return; |
|
|
|
} |
|
|
|
WxMsgCallback wxMsgCallbackq = new WxMsgCallback(); |
|
|
|
wxMsgCallbackq.setBatchNo(wxMsgCallback.getBatchNo()); |
|
|
|
wxMsgCallbackq.setPhone(wxMsgCallback.getPhone()); |
|
|
|
@@ -237,6 +250,7 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { |
|
|
|
WxMsgConfig mconfig = wxMsgConfigs.get(0); |
|
|
|
mconfig.setRemains(1L); |
|
|
|
wxMsgConfigMapper.addRemains(mconfig); |
|
|
|
RedisCacheUtils.cache(redisTemplate, redisKey, 1, 3600); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|