Commit 79ee9708 by 徐高华

test

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