|
@@ -7,8 +7,6 @@ import com.iamberry.wechat.core.entity.thanksgiving.ThanksGiving;
|
|
|
import com.iamberry.wechat.face.member.MemberService;
|
|
|
import com.iamberry.wechat.face.order.CodeService;
|
|
|
import com.iamberry.wechat.face.thanksgiving.ThanksGivingService;
|
|
|
-import com.iamberry.wechat.service.ImberryConfig;
|
|
|
-import com.iamberry.wechat.tools.NameUtils;
|
|
|
import com.iamberry.wechat.tools.payUtil.RandomUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -46,6 +44,28 @@ public class ThanksGivingHandler {
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
+ @RequestMapping("/attention_veri")
|
|
|
+ public ResultMsg attentionVeri(HttpServletRequest requeste){
|
|
|
+ ResultMsg rm = new ResultMsg();
|
|
|
+ Member member = WechatUtils.getUserBySession(requeste);
|
|
|
+
|
|
|
+ member = memberService.getMemberByUserOpenId(member.getUserOpenid());
|
|
|
+ if(member.getUserStatus() != 2){
|
|
|
+ return new ResultMsg(false, ResultMsg.ERROR, "未关注不能领取!",null);
|
|
|
+ }
|
|
|
+ rm.setMessage(ResultMsg.SUCCESS);
|
|
|
+ rm.setStatus(true);
|
|
|
+ return rm;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送验证码
|
|
|
+ * 2016年4月21日
|
|
|
+ * @author 穆再兴
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
@RequestMapping("/send_veri")
|
|
|
public ResultMsg sendPhone(HttpServletRequest request,String phone){
|
|
|
ResultMsg rm = new ResultMsg();
|
|
@@ -58,9 +78,9 @@ public class ThanksGivingHandler {
|
|
|
}
|
|
|
//
|
|
|
member = memberService.getMemberByUserOpenId(member.getUserOpenid());
|
|
|
-// if(member.get){
|
|
|
-//
|
|
|
-// }
|
|
|
+ if(member.getUserStatus() != 2){
|
|
|
+ return new ResultMsg(false, ResultMsg.ERROR, "未关注不能领取!",null);
|
|
|
+ }
|
|
|
|
|
|
ThanksGiving thanksGiving = new ThanksGiving();
|
|
|
thanksGiving.setThanksGivingPhone(phone);
|
|
@@ -97,6 +117,10 @@ public class ThanksGivingHandler {
|
|
|
public ResultMsg receiveCoupon(HttpServletRequest request,String phone,String code){
|
|
|
ResultMsg rm = new ResultMsg();
|
|
|
Member member = WechatUtils.getUserBySession(request);
|
|
|
+ member = memberService.getMemberByUserOpenId(member.getUserOpenid());
|
|
|
+ if(member.getUserStatus() != 2){
|
|
|
+ return new ResultMsg(false, ResultMsg.ERROR, "未关注不能领取!",null);
|
|
|
+ }
|
|
|
|
|
|
if(phone.length() != 11){
|
|
|
rm.setMessage(ResultMsg.ERROR);
|
|
@@ -135,8 +159,13 @@ public class ThanksGivingHandler {
|
|
|
tg.setThanksGivingPhone(phone);
|
|
|
tg.setThanksGivingId(thanksGivingList.get(0).getThanksGivingId());
|
|
|
tg.setThanksGivingOpenId(member.getUserOpenid());
|
|
|
-
|
|
|
- Integer flag = thanksGivingService.update(tg);
|
|
|
+ Integer flag = 0;
|
|
|
+ try{
|
|
|
+ thanksGivingService.update(tg);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return new ResultMsg(false, ResultMsg.ERROR, e.getMessage(),null);
|
|
|
+ }
|
|
|
if(flag < 1){
|
|
|
return new ResultMsg(false, ResultMsg.ERROR, "领取失败,请重新领取!",null);
|
|
|
}
|