|
@ -3,7 +3,6 @@ package com.yihu.wlyy.service.manager.feedback;
|
|
|
import com.yihu.wlyy.entity.Doctor;
|
|
|
import com.yihu.wlyy.entity.Message;
|
|
|
import com.yihu.wlyy.entity.Patient;
|
|
|
import com.yihu.wlyy.entity.SMS;
|
|
|
import com.yihu.wlyy.entity.feedback.Appeal;
|
|
|
import com.yihu.wlyy.repository.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.MessageDao;
|
|
@ -17,7 +16,6 @@ import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -59,6 +57,8 @@ public class AppealService extends BaseService {
|
|
|
private MessageDao messageDao;
|
|
|
@Value("${image.imgUrlDomain}")
|
|
|
private String imgUrlDomain;
|
|
|
@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
|
|
|
private String messageApi;
|
|
|
|
|
|
/**
|
|
|
* 分页查找问题
|
|
@ -214,29 +214,18 @@ public class AppealService extends BaseService {
|
|
|
msgContent.append("i健康应用");
|
|
|
}
|
|
|
msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
|
|
|
JSONObject json = smsService.sendMsg(appeal.getPhone(), msgContent.toString());
|
|
|
|
|
|
SMS sms = new SMS();
|
|
|
Date date = new Date();
|
|
|
// 延后5分钟
|
|
|
sms.setContent(msgContent.toString());
|
|
|
sms.setDeadline(date);
|
|
|
sms.setCzrq(date);
|
|
|
sms.setMobile(appeal.getPhone());
|
|
|
sms.setIp("127.0.0.1");
|
|
|
sms.setType(11);
|
|
|
sms.setStatus(1);
|
|
|
sms.setCaptcha("");
|
|
|
smsDao.save(sms);
|
|
|
if (json == null) {
|
|
|
// 发送失败
|
|
|
logger.error("申诉处理完成:短信发送失败");
|
|
|
} else if (json.getInt("result") != 0) {
|
|
|
logger.error("申诉处理完成:短信发送失败"+json.getString("description"));
|
|
|
} else {
|
|
|
//发送成功,保存到数据库
|
|
|
smsDao.save(sms);
|
|
|
}
|
|
|
List<NameValuePair> par = new ArrayList<NameValuePair>();
|
|
|
par.add(new BasicNameValuePair("mobiles", appeal.getPhone()));
|
|
|
par.add(new BasicNameValuePair("content", msgContent.toString()));
|
|
|
try {
|
|
|
logger.info("====================================================================");
|
|
|
String smsresult = HttpClientUtil.post(messageApi+"/sendMessage",par,"UTF-8");
|
|
|
logger.info("发送短信消息返回结果:"+smsresult);
|
|
|
logger.info("======================================================================");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
if (appeal.getIdentity() == 2) {
|
|
|
String creater = appeal.getCreater();
|