AgentWechatHandler.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. package com.iamberry.wechat.handles.wx;
  2. import java.io.IOException;
  3. import javax.servlet.ServletException;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.apache.commons.lang.StringUtils;
  10. import com.iamberry.wechat.core.entity.WechatUtils;
  11. import com.iamberry.wechat.core.entity.member.Member;
  12. import com.iamberry.wechat.face.member.MemberService;
  13. import com.iamberry.wechat.tools.NameUtils;
  14. /**
  15. * 微代理 跳转
  16. * 2016年4月28日
  17. * @author 穆再兴
  18. *
  19. */
  20. @Controller
  21. @RequestMapping("/wechat/agentWechat")
  22. public class AgentWechatHandler {
  23. @Autowired
  24. private MemberService memberService;
  25. /**
  26. * 2016年4月26日
  27. * 微代理订单页面跳转
  28. * @author 穆再兴
  29. * @return
  30. * @throws IOException
  31. * @throws ServletException
  32. */
  33. @RequestMapping("/order")
  34. public void toAgentOrder(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  35. req.getRequestDispatcher("/WEB-INF/views/wechat/daili_order_list.html").forward(req,res);
  36. }
  37. @RequestMapping("/reback")
  38. public void toAgentReback(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  39. req.getRequestDispatcher("/WEB-INF/views/wechat/daili_rebackOrder_list.html").forward(req,res);
  40. }
  41. /**
  42. * 会员<或微代理>中心页面跳转
  43. * 2016年4月26日
  44. * @author 穆再兴
  45. * @param req
  46. * @param res
  47. * @throws IOException
  48. * @throws ServletException
  49. */
  50. @RequestMapping("/member")
  51. public void toAgentMemberPage(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  52. req.getRequestDispatcher("/WEB-INF/views/wechat/vip_center.html").forward(req,res);
  53. }
  54. /**
  55. * 微代理分销规则页面 跳转
  56. * 2016年4月26日
  57. * @author 穆再兴
  58. * @throws IOException
  59. * @throws ServletException
  60. */
  61. @RequestMapping("/fxRule")
  62. public void toAgentFXRule(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  63. req.getRequestDispatcher("/WEB-INF/views/wechat/fenxiao_guize.html").forward(req,res);
  64. }
  65. /**
  66. * 我的下线页面跳转
  67. * 2016年4月28日
  68. * @author 穆再兴
  69. * @param req
  70. * @param res
  71. * @throws IOException
  72. * @throws ServletException
  73. */
  74. @RequestMapping("/agentNext")
  75. public void toAgentNext(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  76. req.getRequestDispatcher("/WEB-INF/views/wechat/xiaxian_list.html").forward(req,res);
  77. }
  78. /**
  79. * 微代理规则
  80. * 2016年4月28日
  81. * @author 穆再兴
  82. * @param req
  83. * @param res
  84. * @throws IOException
  85. * @throws ServletException
  86. */
  87. @RequestMapping("/agentRule")
  88. public void toAgentRule(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  89. req.getRequestDispatcher("/WEB-INF/views/wechat/daili_guize.html").forward(req,res);
  90. }
  91. /**
  92. * 冲奶机宣传片页面
  93. * 2016年4月28日
  94. * @author 穆再兴
  95. * @param req
  96. * @param res
  97. */
  98. @RequestMapping("/goPublicity")
  99. public void toPublicity(HttpServletRequest req,HttpServletResponse res){
  100. //如果是分享 则绑定关系
  101. try {
  102. Member member = WechatUtils.getUserBySession(req);
  103. String shareOpenid = req.getParameter("shareOpenid");
  104. String userType = req.getParameter("userType"); //分享人的类型 1:会员 2:代理商
  105. String isDrp = req.getParameter("isDrp"); //代理商第一次分享后 将分享来源改为会员
  106. if(StringUtils.isNotEmpty(shareOpenid) && StringUtils.isNotEmpty(userType)){
  107. memberService.buildChildUser(shareOpenid, member,Integer.parseInt(userType),1);
  108. }
  109. req.getRequestDispatcher("/WEB-INF/views/wechat/iamberry_video.html?userType=" + userType + "&isDrp=" + isDrp).forward(req,res);
  110. } catch (Exception e) {
  111. e.printStackTrace();
  112. }
  113. }
  114. /**
  115. * 用户可用金额提现
  116. * 2016年5月5日
  117. * @author 穆再兴
  118. * @param req
  119. * @param res
  120. * @throws IOException
  121. * @throws ServletException
  122. */
  123. @RequestMapping("/withdrawCashLog")
  124. public void goWithdrawCashLog(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException{
  125. req.getRequestDispatcher(NameUtils.getConfig("WECHAT_WITHDRAW_CASH_LOG_LIST")).forward(req,res);
  126. }
  127. }