|
@ -59,6 +59,7 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
@ -88,31 +89,31 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WxMaServiceUtils wxMaServiceUtils; |
|
|
private WxMaServiceUtils wxMaServiceUtils; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private AdminFeignClient adminFeignClient; |
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private UserFeignClient userFeignClient; |
|
|
private UserFeignClient userFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private JwtTokenProperties jwtTokenProperties; |
|
|
private JwtTokenProperties jwtTokenProperties; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private OssFeignClient ossFeignClient; |
|
|
private OssFeignClient ossFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private JwtTokenUtils jwtTokenUtils; |
|
|
private JwtTokenUtils jwtTokenUtils; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private RedisUtils redisUtils; |
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private GroupFeignClient groupFeignClient; |
|
|
private GroupFeignClient groupFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private PointsFeignClient pointFeignClient; |
|
|
private PointsFeignClient pointFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private CustomFeignClient customFeignClient; |
|
|
private CustomFeignClient customFeignClient; |
|
|
|
|
|
|
|
|
//private static String USER_FACE = "https://epdc.elinkchina.com.cn/esua-epdc/static/default/default_user_face.png";
|
|
|
//private static String USER_FACE = "https://epdc.elinkchina.com.cn/esua-epdc/static/default/default_user_face.png";
|
|
@ -736,13 +737,30 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
if (!userResult.success()) { |
|
|
if (!userResult.success()) { |
|
|
return new Result<EpdcAppAuthorizationDTO>().error(userResult.getMsg()); |
|
|
return new Result<EpdcAppAuthorizationDTO>().error(userResult.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// IP地址
|
|
|
// IP地址
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
|
|
|
|
|
Result<EpdcAppAuthorizationDTO> result = this.dealWithUserRegisterState(userResult.getData(), openId, unionId, IpUtils.getIpAddr(request), formDto.getInviteUserId(), formDto.getGridId()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<EpdcAppAuthorizationDTO> getNMaV2Token(EpdcAppUserRegisterFormDTO formDto) { |
|
|
|
|
|
WxMaJscode2SessionResult wxMaResult = this.getNMPWxUser(formDto.getWxCode()); |
|
|
|
|
|
String openId = wxMaResult.getOpenid(); |
|
|
|
|
|
String unionId = wxMaResult.getUnionid(); |
|
|
|
|
|
|
|
|
|
|
|
// 查询当前微信注册状态
|
|
|
|
|
|
EpdcCheckUserRegisterFromDTO checkFromDto = new EpdcCheckUserRegisterFromDTO(); |
|
|
|
|
|
checkFromDto.setOpenId(openId); |
|
|
|
|
|
checkFromDto.setWxUnionId(unionId); |
|
|
|
|
|
checkFromDto.setGridId(formDto.getGridId()); |
|
|
|
|
|
Result<EpdcUserRegisterInfoResultDTO> userResult = userFeignClient.getUserRegisterState(checkFromDto); |
|
|
|
|
|
if (!userResult.success()) { |
|
|
|
|
|
return new Result<EpdcAppAuthorizationDTO>().error(userResult.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
// IP地址
|
|
|
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
|
|
Result<EpdcAppAuthorizationDTO> result = this.dealWithUserRegisterState(userResult.getData(), openId, unionId, IpUtils.getIpAddr(request), formDto.getInviteUserId(), formDto.getGridId()); |
|
|
Result<EpdcAppAuthorizationDTO> result = this.dealWithUserRegisterState(userResult.getData(), openId, unionId, IpUtils.getIpAddr(request), formDto.getInviteUserId(), formDto.getGridId()); |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|