Commit 357c4216 authored by 李博今's avatar 李博今

更改时间排序,可以将信息就改为空

parent a44754e4
......@@ -201,35 +201,49 @@ public class ImController extends BaseController {
params.put("password", data);
//发送短信
String messagePhone = userInfoServiceImpl.getMessagePhone(Long.parseLong(request.getParameter("wantedId")));
try {
SmsResponseEntity smsResponseEntity = Sms.sendSms(messagePhone);
if (smsResponseEntity.getCode() == null || !"OK".equals(smsResponseEntity.getCode())){
//请求失败
if(messagePhone == null || "".equals(messagePhone)){
ErrorLog errorLog = new ErrorLog();
errorLog.setId(UUID.randomUUID().toString());
errorLog.setConsultantId(Long.parseLong(request.getParameter("wantedId")));
Map<String, Object> map = new HashMap<>();
map.put("account", data);
errorLog.setUserId(userAccountServiceImpl.queryObjectByAccount(map).getId());
errorLog.setErrorCode("PHONE_NUMBER_NULL");
errorLog.setErrorMessage("phone number is null");
errorLog.setPhone(messagePhone);
errorLog.setSendTime(new Date());
errorLogServiceImpl.saveErrorLog(errorLog);
}else{
try {
SmsResponseEntity smsResponseEntity = Sms.sendSms(messagePhone);
if (smsResponseEntity.getCode() == null || !"OK".equals(smsResponseEntity.getCode())){
//请求失败
ErrorLog errorLog = new ErrorLog();
errorLog.setId(smsResponseEntity.getRequestId());
errorLog.setConsultantId(Long.parseLong(request.getParameter("wantedId")));
Map<String, Object> map = new HashMap<>();
map.put("account", data);
errorLog.setUserId(userAccountServiceImpl.queryObjectByAccount(map).getId());
errorLog.setErrorCode(smsResponseEntity.getCode());
errorLog.setErrorMessage(smsResponseEntity.getMessage());
errorLog.setPhone(messagePhone);
errorLog.setSendTime(new Date());
errorLogServiceImpl.saveErrorLog(errorLog);
}
} catch (ClientException e) {
ErrorLog errorLog = new ErrorLog();
errorLog.setId(smsResponseEntity.getRequestId());
errorLog.setId(e.getRequestId());
errorLog.setConsultantId(Long.parseLong(request.getParameter("wantedId")));
Map<String, Object> map = new HashMap<>();
map.put("account", data);
errorLog.setUserId(userAccountServiceImpl.queryObjectByAccount(map).getId());
errorLog.setErrorCode(smsResponseEntity.getCode());
errorLog.setErrorMessage(smsResponseEntity.getMessage());
errorLog.setErrorCode(e.getErrCode());
errorLog.setErrorMessage(e.getMessage());
errorLog.setPhone(messagePhone);
errorLog.setSendTime(new Date());
errorLogServiceImpl.saveErrorLog(errorLog);
e.printStackTrace();
}
} catch (ClientException e) {
ErrorLog errorLog = new ErrorLog();
errorLog.setId(e.getRequestId());
errorLog.setConsultantId(Long.parseLong(request.getParameter("wantedId")));
Map<String, Object> map = new HashMap<>();
map.put("account", data);
errorLog.setUserId(userAccountServiceImpl.queryObjectByAccount(map).getId());
errorLog.setErrorCode(e.getErrCode());
errorLog.setErrorMessage(e.getMessage());
errorLog.setPhone(messagePhone);
errorLog.setSendTime(new Date());
errorLogServiceImpl.saveErrorLog(errorLog);
e.printStackTrace();
}
}
......
......@@ -17,7 +17,7 @@
</resultMap>
<select id="getLogs" resultMap="BaseResultMap">
select * from error_log where state = #{state};
select * from error_log where state = #{state} order by send_time DESC;
</select>
<insert id="saveErrorLog">
......
......@@ -37,10 +37,10 @@ public interface UserAccountDao extends BaseDao<UserAccountEntity> {
"update user_info,user_account set " +
"<if test=\"deptName !=null and deptName != '' \">user_info.deptid = #{deptName}, </if> " +
"<if test=\"password !=null and password != '' \">user_account.password = #{password}, </if> " +
"<if test=\"remark !=null and remark != '' \">user_info.remark = #{remark}, </if> " +
"<if test=\"phone !=null and phone != '' \">user_info.phone = #{phone}, </if> " +
"<if test=\"remark !=null \">user_info.remark = #{remark}, </if> " +
"<if test=\"phone !=null \">user_info.phone = #{phone}, </if> " +
"<if test=\"name !=null and name != '' \">user_info.name = #{name}, </if> " +
"<if test=\"messagePhone !=null and messagePhone != '' \">user_info.message_phone = #{messagePhone}, </if> " +
"<if test=\"messagePhone !=null \">user_info.message_phone = #{messagePhone}, </if> " +
"user_info.uid = #{id} " +
"where user_info.uid = #{id} and user_info.uid = user_account.id" +
"</script>"
......
......@@ -101,24 +101,6 @@ public class UserAccountServiceImpl implements UserAccountService {
public int updateDetail(ConsultantManagerEntity consultantManagerEntity) throws UnsupportedEncodingException {
int i = 0;
consultantManagerEntity.setName(new String(consultantManagerEntity.getName().getBytes("iso8859-1"), "UTF-8"));
// if(consultantManagerEntity.getDeptName() != null && !"".equals(consultantManagerEntity.getDeptName())){
// i += userAccountDao.updateConsultantDept( new String (consultantManagerEntity.getDeptName().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
// if (consultantManagerEntity.getPassword() != null && !"".equals(consultantManagerEntity.getPassword())){
// i += userAccountDao.updateConsultantPassword( new String (consultantManagerEntity.getPassword().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
// if(consultantManagerEntity.getName() != null && !"".equals(consultantManagerEntity.getName())){
// i += userAccountDao.updateConsultantName( new String (consultantManagerEntity.getName().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
// if(consultantManagerEntity.getPhone() != null){
// i += userAccountDao.updateConsultantPhone( new String (consultantManagerEntity.getPhone().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
// if(consultantManagerEntity.getRemark() != null){
// i += userAccountDao.updateConsultantRemark( new String (consultantManagerEntity.getRemark().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
// if(consultantManagerEntity.getMessagePhone() != null){
// i += userAccountDao.updateConsultantMessagePhone( new String (consultantManagerEntity.getMessagePhone().getBytes("iso8859-1"),"UTF-8"), Long.parseLong(consultantManagerEntity.getId()));
// }
i = userAccountDao.updateConsultant(consultantManagerEntity);
return i;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment