...
|
...
|
@@ -12,7 +12,6 @@ import javax.annotation.Resource; |
|
|
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.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
...
|
...
|
@@ -20,11 +19,10 @@ import com.alibaba.fastjson.JSONObject; |
|
|
import com.yoho.activity.common.ApiResponse;
|
|
|
import com.yoho.activity.common.constatns.Constant;
|
|
|
import com.yoho.activity.common.helper.ClientSecretHelper;
|
|
|
import com.yoho.activity.common.helper.SendSMSHelper;
|
|
|
import com.yoho.activity.common.utils.DateUtils;
|
|
|
import com.yoho.activity.common.utils.RandomUtil;
|
|
|
import com.yoho.activity.service.ICocacolaService;
|
|
|
import com.yoho.core.common.utils.AES;
|
|
|
import com.yoho.core.common.utils.MD5;
|
|
|
import com.yoho.core.redis.YHRedisTemplate;
|
|
|
import com.yoho.core.redis.YHValueOperations;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
...
|
...
|
@@ -58,6 +56,9 @@ public class CocacolaServiceImpl implements ICocacolaService { |
|
|
|
|
|
@Resource
|
|
|
private ServiceCaller service;
|
|
|
|
|
|
@Resource
|
|
|
SendSMSHelper sendSMSHelper;
|
|
|
|
|
|
@Resource(name = "yhValueOperations")
|
|
|
private YHValueOperations<String, String> yhValueOperations;
|
...
|
...
|
@@ -295,19 +296,8 @@ public class CocacolaServiceImpl implements ICocacolaService { |
|
|
@Override
|
|
|
public void sendNoticeSms(String mobile, String password) throws ServiceException {
|
|
|
log.info("sendNoticeSms with mobile={}", mobile);
|
|
|
String url = "http://www.ztsms.cn/sendSms.do?";
|
|
|
String content = "【 Yoho!Buy有货】恭喜您获得一张可口可乐优惠券,您的登录账号是 "+ mobile +", 密码是"+ password +";下载Yoho!Buy有货手机端 http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho,更多惊喜等着您!【有货】";
|
|
|
try {
|
|
|
String pwd = AES.decrypt("yoho96461qaz2wsx", this.sendSMSPassword);
|
|
|
url += "username=youhuo&password=" + MD5.md5(pwd) + "&mobile=" + mobile + "&content="+ content +"&productid=333333";
|
|
|
} catch (Exception e) {
|
|
|
log.error("AES.decrypt error with code={}", this.sendSMSPassword, e);
|
|
|
return;
|
|
|
}
|
|
|
// 调用接口发送短信请求
|
|
|
AsyncFuture<String> response = service.get("sms.sendSMS", url, null, String.class, null);
|
|
|
String result = response.get();
|
|
|
log.info("sendNoticeSms result is {}, mobile is {}", result, mobile);
|
|
|
sendSMSHelper.sendNoticeSms(mobile, content);
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|