| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | |
| | | response = client.newCall(request).execute(); |
| | | redisTemplate.opsForValue().set(tel, code + "", 5, TimeUnit.MINUTES); |
| | | // rsa = response.body().string().split("|")[0]; |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | rsa = response.message(); |
| | | if (!rsa.equals("OK")){ |
| | | return ResultData.success("短信发送失败"); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.success("短信发送失败"); |
| | |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | |
| | | String url = |
| | | "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; |
| | | Random rd = new Random(); |
| | | String content="您有新的导办工单,请"+name+"尽快处理。"; |
| | | String content="您在"+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) +"收到新的导办工单,请"+name+"尽快处理。"; |
| | | url=url+content; |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Response response; |