xiaoyong931011
2021-03-11 f3b34b0c7ba026e686d58af93ab8ae5ad6aa9f48
zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java
@@ -1,6 +1,5 @@
package com.matrix.system.shopXcx.api;
import com.alibaba.fastjson.JSON;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.biz.service.BizUserService;
@@ -12,6 +11,7 @@
import com.matrix.core.tools.StringUtils;
import com.matrix.core.web.BaseAction;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.common.interceptor.HostInterceptor;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -42,7 +42,8 @@
   @Autowired
   private BizUserDao bizUserDao;
   @Autowired
   WeChatApiTools weChatApiTools;
@@ -68,7 +69,7 @@
      AjaxResult res = new AjaxResult();
      LogUtil.info("code:{}" + code);
      if (StringUtils.isNotBlank(code)) {
         String requrl = WeChatApiTools.getXcxLoginUrl(code);
         String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId());
         String reslutData = HttpCurlUtil.sendGetHttp(requrl, null);
         JSONObject json = JSONObject.fromObject(reslutData);
         LogUtil.debug("微信登录获取到登录信息={}", json);
@@ -91,9 +92,11 @@
               // 新增用户
               bizUser = new BizUser();
               bizUser.setSessionKey(sessionKey);
               bizUser.setIsSales(BizUser.NOT_SALES);
               bizUser.setOpenId(openId);
               bizUser.setLastLoginTime(new Date());
               bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER);
               bizUser.setCompanyId(HostInterceptor.getCompanyId());
               bizUserService.add(bizUser);
            } else {