md.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package common.md;
  2. import com.alibaba.fastjson.JSONObject;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import utility.sms.Sms;
  9. @Controller
  10. @RequestMapping("/rest/md")
  11. public class md {
  12. @RequestMapping("/yjhx")
  13. @GetMapping
  14. @ResponseBody
  15. public Object yjhx(@RequestParam("phonenumber") String phonenumber, @RequestParam(value = "formdata") String formdata) {
  16. String content = "尊敬的用户,您提交的以旧换新补贴申请美大总部已审核通过!友情提醒:该补贴金额仅限扫码门店使用,且产品安装地址与申请地址须保持一致。详情咨询当地美大门店。期待为您提供优质服务!";
  17. JSONObject resultObject = new JSONObject();
  18. try {
  19. new Thread(() -> {
  20. try {
  21. Thread.sleep(60 * 1000L);
  22. new Sms().sendout(Sms.SmsType.Notice, "MD", phonenumber, "浙江美大", content);
  23. } catch (Exception e) {
  24. e.printStackTrace();
  25. }
  26. }).start();
  27. resultObject.put("msg", "成功");
  28. resultObject.put("status", 1);
  29. return resultObject;
  30. } catch (Exception e) {
  31. e.printStackTrace();
  32. }
  33. resultObject.put("msg", "失败");
  34. resultObject.put("status", 0);
  35. return resultObject;
  36. }
  37. }