Commit 79ee9708 by 徐高华

test

parent 3aafb1e7
...@@ -320,38 +320,32 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -320,38 +320,32 @@ public class WxEnterpriseInfoController extends WebBaseController {
public HaobanResponse getInfoByMemberCode(GetUserByMemberCodeQo qo) { public HaobanResponse getInfoByMemberCode(GetUserByMemberCodeQo qo) {
logger.info("会员小程序={}", JSON.toJSONString(qo)); logger.info("会员小程序={}", JSON.toJSONString(qo));
String gicEnterpriseId = qo.getGicEnterpriseId(); String gicEnterpriseId = qo.getGicEnterpriseId();
WxEnterpriseDTO enterpriseDetailDTO = null; WxEnterpriseDTO enterpriseDTO = null;
if (StringUtils.isNotBlank(qo.getCorpId())) { if (StringUtils.isNotBlank(qo.getCorpId())) {
enterpriseDetailDTO = wxEnterpriseApiService.getEnterpriseBycorpId(qo.getCorpId()); enterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(qo.getCorpId());
if (null == enterpriseDetailDTO) {
logger.info("企微查不到,corpid={}", qo.getCorpId());
return resultResponse(HaoBanErrCode.ERR_500001);
}
} else { } else {
List<WxEnterpriseDTO> wxEnterpriseDTOS = wxEnterpriseRelatedApiService.listWxEnterpriseByEid(gicEnterpriseId); List<WxEnterpriseDTO> wxEnterpriseDTOS = wxEnterpriseRelatedApiService.listWxEnterpriseByEid(gicEnterpriseId);
if (CollectionUtils.isEmpty(wxEnterpriseDTOS)) { if (CollectionUtils.isNotEmpty(wxEnterpriseDTOS)) {
logger.info("商户没有关联企微,eid={}", gicEnterpriseId); enterpriseDTO = wxEnterpriseDTOS.get(0);
return resultResponse(HaoBanErrCode.ERR_500001);
} }
enterpriseDetailDTO = wxEnterpriseDTOS.get(0);
} }
String wxEnterpriseId = enterpriseDetailDTO.getWxEnterpriseId(); if (null == enterpriseDTO) {
logger.info("查询到的企微ID={}", wxEnterpriseId); logger.info("企微查不到,corpid={}", qo.getCorpId());
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId); return resultResponse(HaoBanErrCode.ERR_500001);
if (enterpriseDTO == null) {
logger.info("该企业不存在wxEnterpriseId={}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_400002);
} }
String wxEnterpriseId = enterpriseDTO.getWxEnterpriseId();
logger.info("查询到的企微ID={}", wxEnterpriseId);
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
MemberLoginQo user = new MemberLoginQo(); MemberLoginQo user = new MemberLoginQo();
if (StringUtils.isBlank(qo.getUserId())) { if (StringUtils.isBlank(qo.getUserId())) {
user = getUserByCode(wxEnterpriseId ,qwDTO.getThirdCorpid() , qo.getCode(), qo.getGicEnterpriseId()); user = getUserByCode(wxEnterpriseId , qwDTO.getThirdCorpid() , qo.getCode(), qo.getGicEnterpriseId());
if (user == null) { if (user == null) {
logger.info("登录失败,从微信获取用户信息失败"); logger.info("登录失败,从微信获取用户信息失败");
return resultResponse(HaoBanErrCode.ERR_6); return resultResponse(HaoBanErrCode.ERR_6);
} }
if (!user.getCorpId().equals(enterpriseDTO.getCorpid()) && !user.getCorpId().equals(enterpriseDetailDTO.getOpenCorpid())) { if (!user.getCorpId().equals(enterpriseDTO.getCorpid()) && !user.getCorpId().equals(enterpriseDTO.getOpenCorpid())) {
logger.info("corpid不一致"); logger.info("corpid不一致,{},{},{}",user.getCorpId(),enterpriseDTO.getCorpid(),enterpriseDTO.getOpenCorpid());
return resultResponse(HaoBanErrCode.ERR_500003, user.getCorpId()); return resultResponse(HaoBanErrCode.ERR_500003, user.getCorpId());
} }
WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(user.getCorpId()); WxApplicationDTO wxApplicationDTO = wxApplicationApiService.selectByCorpid(user.getCorpId());
......
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