MyInfoController.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package com.yihu.wlyy.web.wx;
  2. import java.io.IOException;
  3. import javax.servlet.http.HttpServletResponse;
  4. import io.swagger.annotations.Api;
  5. import org.json.JSONException;
  6. import org.json.JSONObject;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestMethod;
  10. import com.yihu.wlyy.util.SystemConf;
  11. import com.yihu.wlyy.web.WeixinBaseController;
  12. @Controller
  13. @RequestMapping("/wx/my/info")
  14. @Api(description = "患者端-个人信息")
  15. public class MyInfoController extends WeixinBaseController {
  16. /**
  17. * 我的»我的资料
  18. * @param code
  19. * @return
  20. * @throws IOException
  21. * @throws JSONException
  22. */
  23. @RequestMapping(value = "wdzl", method = RequestMethod.GET)
  24. public void wdzl(HttpServletResponse response, String code) throws JSONException, IOException {
  25. String message = getOpenid(code);
  26. JSONObject json = new JSONObject(message);
  27. if (Integer.parseInt(json.get("status").toString()) == 100) {
  28. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=11&openid=" + json.get("msg").toString());
  29. } else if (Integer.parseInt(json.get("status").toString()) == 200) {
  30. // String json2 = json.get("data").toString();
  31. // String paramUrl = getParamUrl(json2, 11);
  32. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-detail.html");
  33. } else
  34. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
  35. }
  36. /**
  37. * 我的»我的预约
  38. * @param code
  39. * @return
  40. * @throws IOException
  41. * @throws JSONException
  42. */
  43. @RequestMapping(value = "wdyy", method = RequestMethod.GET)
  44. public void wdyy(HttpServletResponse response, String code) throws JSONException, IOException {
  45. String message = getOpenid(code);
  46. JSONObject json = new JSONObject(message);
  47. if (Integer.parseInt(json.get("status").toString()) == 100) {
  48. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=12&openid=" + json.get("msg").toString());
  49. } else if (Integer.parseInt(json.get("status").toString()) == 200) {
  50. // String json2 = json.get("data").toString();
  51. // String paramUrl = getParamUrl(json2, 12);
  52. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-appointment.html");
  53. } else
  54. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
  55. }
  56. /**
  57. * 我的»咨询记录
  58. * @param code
  59. * @return
  60. * @throws IOException
  61. * @throws JSONException
  62. */
  63. @RequestMapping(value = "zxjl", method = RequestMethod.GET)
  64. public void zxjl(HttpServletResponse response, String code) throws JSONException, IOException {
  65. String message = getOpenid(code);
  66. JSONObject json = new JSONObject(message);
  67. if (Integer.parseInt(json.get("status").toString()) == 100) {
  68. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=13&openid=" + json.get("msg").toString());
  69. } else if (Integer.parseInt(json.get("status").toString()) == 200) {
  70. // String json2 = json.get("data").toString();
  71. // String paramUrl = getParamUrl(json2, 13);
  72. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/zxwz/html/teachers-consulting-list.html");
  73. } else
  74. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
  75. }
  76. /**
  77. * 我的»我的设备
  78. * @param code
  79. * @return
  80. * @throws IOException
  81. * @throws JSONException
  82. */
  83. @RequestMapping(value = "wdsb", method = RequestMethod.GET)
  84. public void wdsb(HttpServletResponse response, String code) throws JSONException, IOException {
  85. String message = getOpenid(code);
  86. JSONObject json = new JSONObject(message);
  87. if (Integer.parseInt(json.get("status").toString()) == 100) {
  88. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=14&openid=" + json.get("msg").toString());
  89. } else if (Integer.parseInt(json.get("status").toString()) == 200) {
  90. // String json2 = json.get("data").toString();
  91. // String paramUrl = getParamUrl(json2, 14);
  92. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-equipments.html");
  93. } else
  94. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
  95. }
  96. /**
  97. * 我的»就诊指导
  98. * @param code
  99. * @return
  100. * @throws IOException
  101. * @throws JSONException
  102. */
  103. @RequestMapping(value = "jzzd", method = RequestMethod.GET)
  104. public void jzzd(HttpServletResponse response, String code) throws JSONException, IOException {
  105. String message = getOpenid(code);
  106. JSONObject json = new JSONObject(message);
  107. if (Integer.parseInt(json.get("status").toString()) == 100) {
  108. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=15&openid=" + json.get("msg").toString());
  109. } else if (Integer.parseInt(json.get("status").toString()) == 200) {
  110. // String json2 = json.get("data").toString();
  111. // String paramUrl = getParamUrl(json2, 15);
  112. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/guide.html");
  113. } else
  114. response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
  115. }
  116. }