From 1d6b62f05b888e6f3503a4658e22f2ea2a27f764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E7=84=B1?= Date: Sun, 22 Dec 2019 18:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ifish/action/UsersAction.java | 6 +- .../ifish/serviceImpl/UserServiceImpl.java | 63 ++++++++++++++++++- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ifish/action/UsersAction.java b/src/main/java/com/ifish/action/UsersAction.java index e8ab187..705e52f 100644 --- a/src/main/java/com/ifish/action/UsersAction.java +++ b/src/main/java/com/ifish/action/UsersAction.java @@ -93,7 +93,7 @@ public class UsersAction { * @param code * @return */ - @RequestMapping(value="/wechatLogin",method=RequestMethod.POST) + @RequestMapping(value="/wechatLogin",method={RequestMethod.GET , RequestMethod.POST}) public JsonResult wechatLogin(String code) { return userService.wechatLogin(code); } @@ -103,7 +103,7 @@ public class UsersAction { * @param unionId * @return */ - @RequestMapping(value="/wechatValidate",method=RequestMethod.POST) + @RequestMapping(value="/wechatValidate",method={RequestMethod.GET , RequestMethod.POST}) public JsonResult wechatValidate(String unionId) { return userService.wechatValidate(unionId); } @@ -114,7 +114,7 @@ public class UsersAction { * @param phoneNum * @return */ - @RequestMapping(value="/bindPhone",method=RequestMethod.GET) + @RequestMapping(value="/bindPhone",method={RequestMethod.GET , RequestMethod.POST}) public JsonResult bindPhone(String unionId, String phoneNum, String password) { return userService.bindPhone(unionId, phoneNum, password); } diff --git a/src/main/java/com/ifish/serviceImpl/UserServiceImpl.java b/src/main/java/com/ifish/serviceImpl/UserServiceImpl.java index eee2c0c..4b08896 100644 --- a/src/main/java/com/ifish/serviceImpl/UserServiceImpl.java +++ b/src/main/java/com/ifish/serviceImpl/UserServiceImpl.java @@ -592,7 +592,68 @@ public class UserServiceImpl implements UserService { userAssetDtoPhone.setGradeNum(7); userAssetDtoPhone.setGradeName("海龙王"); } - return wechatValidate(unionId); + //技威参数 + GwellParamDto gwellParam = getGwellInfo(userWechat.getIsRegisterGwell(), userWechat.getWechatUnionid()); + if(gwellParam!=null){ + userWechat.setIsRegisterGwell(gwellParam.getIsRegisterGwell()); + userWechat.setP2PVerifyCode1(gwellParam.getP2PVerifyCode1()); + userWechat.setP2PVerifyCode2(gwellParam.getP2PVerifyCode2()); + userWechat.setGwellUserID(gwellParam.getUserID()); + } + Integer userId = userWechat.getUserId(); + StringBuffer msg = new StringBuffer(); + msg.append("感谢您使用爱鱼奇,连接智能设备请查看下方说明书,内含操作视频:http://u.eqxiu.com/s/KmmVl87l\n"); + msg.append("摄像头售后:18667812003\n睿芯插排售后:15757401229\n绚多插排售后:18857689069\n松诺插排售后:13392205468"); + //如果当前设备用户未注册 + if (userWechat.getIsRegisterNetease().equals(BooleanEnum.NO.getKey())) { + PushList pushList = new PushList(); + pushList.setUserId(userId); + pushList.setDeviceId(0); + pushList.setPhoneType("ALL"); + pushList.setShowName(""); + pushList.setPushType(PushTypeEnum.qu_reply.getKey()); + pushList.setPushTitle("系统通知"); + pushList.setPushContext(msg.toString()); +// sendPushQueueMessage(pushList); + //更新用户注册信息 + userWechat.setIsRegisterNetease(BooleanEnum.YES.getKey()); + userDao.update(userWechat); + } + //更新登陆参数 + userDao.executeLoginUpdate(userId,userWechat.getLoginType()); + //用户基本信息 + UserInfoDto userInfoDto = getUserInfoDto(userWechat, gwellParam); + //用户资产信息 + UserAssetDto userAssetDto = getUserAssetInfo(userId); + //返回json信息 + JSONObject json = new JSONObject(); + json.put("userInfo", userInfoDto); + json.put("userAsset", userAssetDto); + //设备信息 + DeviceInfoDto deviceInfo = getDeviceInfo(userWechat.getUserId()); + /** + * 登录返回信息 + */ + //用户信息 + json.put("user", getUserInfo(userWechat,gwellParam)); + //用户资产 + json.put("userAsset", getUserAssetInfo(userId)); + //金币任务 + json.put("goldTasks", getGoldTaskList(userId)); + + //资讯信息 + json.put("information", cacheService.getInformation()); + //设备信息 + json.put("device", deviceInfo.getDeviceList()); + //摄像头信息 + json.put("camera", getCameraInfo(userId)); + //设备关联摄像头信息 + json.put("deviceCamera", getDeviceCamera(deviceInfo.getDeviceIds())); + //商家信息(自己是商家) + json.put("shopsInfo", getShopsInfo(userId,userWechat.getUserImg())); + //看护商家信息 + json.put("shopsInfo2", getShopsInfo(userWechat.getShopsUserId(),null)); + return new JsonResult(ResultEnum.success.getKey(), json); } public void updateData(String sql){