Commit ebea0c34 authored by 唐峰's avatar 唐峰

解决冲突

parents 0f5869a6 b38948a2
......@@ -16,7 +16,9 @@ import cn.quantgroup.xyqb.repository.IUserInfoRepository;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@RestController
@RequestMapping("/api/v2/user")
public class UserApiV2Controller implements IBaseController {
......@@ -186,8 +189,15 @@ public class UserApiV2Controller implements IBaseController {
}
List<Long> userIdList = userList.stream().map(e -> e.getId()).collect(Collectors.toList());
List<UserInfoEntity> userInfoEntityList = userInfoRepository.findByTenantIdAndUserIdIn(tenantId,userIdList);
return JsonResult.buildSuccessResultGeneric(UserBean.from(userList, wechatUserInfo,userInfoEntityList));
try {
List<UserInfoEntity> userInfoEntityList = userInfoRepository.findByTenantIdAndUserIdIn(tenantId,userIdList);
return JsonResult.buildSuccessResultGeneric(UserBean.from(userList, wechatUserInfo,userInfoEntityList));
} catch (Exception e) {
log.error("获取批量信息异常:{}",e.getMessage(),e);
}
return JsonResult.buildErrorStateResult("获取用户信息执行出错",null );
}
}
......@@ -121,7 +121,7 @@ public class UserBean {
if (CollectionUtils.isNotEmpty(wechatUserInfoList)) {
Optional<WechatUserInfo> optionalWechatUserInfo = wechatUserInfoList.stream().filter(i -> i.getUserId().equals(user.getId())).findFirst();
Optional<WechatUserInfo> optionalWechatUserInfo = wechatUserInfoList.stream().filter(i -> i.getUserId() != null && i.getUserId().equals(user.getId())).findFirst();
if (optionalWechatUserInfo.isPresent()) {
WechatUserInfo wechatUserInfo = optionalWechatUserInfo.get();
......
......@@ -14,6 +14,7 @@ import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
......@@ -63,7 +64,6 @@ public class GeetestBehaviorStrategy implements BehaviorStrategy {
return (boolean) result.get("valid");
}
@Override
public BehaviorCodeBean generate(BehaviorReq behaviorReq) {
BehaviorCodeBean behaviorCodeBean = new BehaviorCodeBean();
......@@ -83,6 +83,8 @@ public class GeetestBehaviorStrategy implements BehaviorStrategy {
imgMap = geetestCaptchaService.fetchGeetestCaptcha(PasswordUtil.MD5(key), behaviorReq.getIp(), ClientType.valueByCode(behaviorReq.getClientType()));
}
imgMap = imgMap == null ? Maps.newHashMap() : imgMap;
if (imgMap.containsKey("success") && "1".equals(imgMap.get("success"))) {
behaviorCodeBean.setType(1);
behaviorCodeBean.setGeetestCode(BehaviorCodeBean.GeetestCode.builder().gt(imgMap.get("gt"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment