|
|
@@ -12,6 +12,7 @@ import org.jeecg.common.util.OtherException;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.StringUtils;
|
|
|
import org.jeecg.modules.company.entity.CompanyAuthentication;
|
|
|
+import org.jeecg.modules.company.mapper.CompanyAuthenticationMapper;
|
|
|
import org.jeecg.modules.message.entity.Message;
|
|
|
import org.jeecg.modules.message.service.IMessageService;
|
|
|
import org.jeecg.modules.user.entity.User;
|
|
|
@@ -47,6 +48,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
public static final String USERFILES_BASE_URL = "uploadfiles";
|
|
|
@Resource
|
|
|
private IMessageService messageService;
|
|
|
+ @Resource
|
|
|
+ private CompanyAuthenticationMapper companyAuthenticationMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -261,6 +264,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取用户信息
|
|
|
+ *
|
|
|
+ * @param requestMap
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> getUserInfo(Map<String, String> requestMap) {
|
|
|
+ Map<String, Object> returnMap = new HashMap<String, Object>();
|
|
|
+ String userId = requestMap.get("user_id");
|
|
|
+ String userToken = requestMap.get("user_token");
|
|
|
+ //验证用户合法性
|
|
|
+ if (TokenUtil.validateToken(userId, userToken)) {
|
|
|
+ User user = this.getById(userId);
|
|
|
+ CompanyAuthentication companyAuthentication = new CompanyAuthentication();
|
|
|
+ companyAuthentication.setUserId(Integer.parseInt(userId));
|
|
|
+ List<CompanyAuthentication> companyAuthenticationList = companyAuthenticationMapper.getEnterpriseList(companyAuthentication);
|
|
|
+ if (companyAuthenticationList.size() > 0) {
|
|
|
+ companyAuthentication = companyAuthenticationList.get(0);
|
|
|
+ }
|
|
|
+ returnMap.put("userInfo", user);
|
|
|
+ returnMap.put("companyAuthentication", companyAuthentication);
|
|
|
+ } else {
|
|
|
+ returnMap.put("success", "1004");
|
|
|
+ }
|
|
|
+ return returnMap;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public User getByPhone(String phone) {
|
|
|
User user = userMapper.getByPhone(phone);
|