Explorar el Código

登录接口添加企业信息

ZhangWenQiang hace 6 años
padre
commit
62bc1071a1

+ 8 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/user/service/impl/UserServiceImpl.java

@@ -105,6 +105,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         String phone = requestMap.get("phone");
         String clientId = requestMap.get("client_id");
         User user1 = new User();
+        CompanyAuthentication companyAuthentication = new CompanyAuthentication();
+        CompanyAuthentication companyAuthentication1 = new CompanyAuthentication();
         User user = this.getByPhone(phone);
         if (user == null) {
             user1.setPhone(phone);
@@ -124,6 +126,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             user1 = user;
             user1.setLoginTime(new Date());
             user1.setUpdateTime(new Date());
+            companyAuthentication.setUserId(user1.getId());
+            List<CompanyAuthentication> companyAuthenticationList = companyAuthenticationMapper.getEnterpriseList(companyAuthentication);
+            if (companyAuthenticationList.size() > 0) {
+                companyAuthentication1 = companyAuthenticationList.get(0);
+            }
         }
 
         //更新用户
@@ -131,6 +138,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         //清空验证码缓存
         redisUtil.del(phone);
         returnMap.put("userInfo", user1);
+        returnMap.put("companyAuthentication", companyAuthentication1);
 
         return returnMap;
     }