1.添加修改求职者密码
2.添加修改管理员修改个人和企业密码接口 3.添加启用和禁用企业
This commit is contained in:
@@ -85,4 +85,8 @@ public interface IAppUserService
|
||||
public List<AppUserShow> selectUserApplyList(AppUser appUser);
|
||||
|
||||
int editUserSafety(AppUser appUser);
|
||||
|
||||
void resetLcPsw(AppUser appUser);
|
||||
|
||||
void changeLcCompanyStatus(AppUser appUser);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@ package com.ruoyi.cms.service.impl;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.cms.util.http.HttpClientUtils;
|
||||
import com.ruoyi.cms.util.http.JsonUtil;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.entity.MyChart;
|
||||
import com.ruoyi.common.core.domain.entity.File;
|
||||
@@ -58,6 +59,12 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
//互联网修改个人信息
|
||||
@Value("${lc_web_auth.editUserInfoUrl}")
|
||||
String WEB_UPDATE_USER_INFO;
|
||||
//修改密码接口
|
||||
@Value("${lc_cms_auth.resrtPwdUrl}")
|
||||
String JG_RESET_PASSWORD_URL;
|
||||
//启用和停用企业
|
||||
@Value("${lc_cms_auth.changeStatusUrl}")
|
||||
String JG_UPDATE_COMPANY_URL;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@@ -539,7 +546,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
public AppUser getUserInfo() {
|
||||
//查询用户信息
|
||||
LoginUser loginUser=SecurityUtils.getLoginUser();
|
||||
System.out.println("loginUser========================"+JSON.toJSONString(loginUser));
|
||||
System.out.println("loginUser========================"+ JSON.toJSONString(loginUser));
|
||||
SysUser sysUser=loginUser.getUser();
|
||||
System.out.println("sysUser========================"+JSON.toJSONString(sysUser));
|
||||
AppUser appUser=selectAppuserByIdcard(sysUser.getIdCard());
|
||||
@@ -648,28 +655,59 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
|
||||
@Override
|
||||
public int editUserSafety(AppUser appUser) {
|
||||
appUserMapper.updateById(appUser);
|
||||
String lcUserToken=redisCache.getCacheObject(CacheConstants.LC_HLW_TOKEN+appUser.getUserId());
|
||||
int i=appUserMapper.updateById(appUser);
|
||||
String lcUserToken=redisCache.getCacheObject(CacheConstants.LC_HLW_TOKEN+appUser.getLcUserid());
|
||||
if(StringUtils.isBlank(lcUserToken)){
|
||||
throw new RuntimeException("token已失效");
|
||||
}
|
||||
//修改门户个人信息
|
||||
JSONObject pJson = new JSONObject();
|
||||
if (StringUtils.isNotBlank(appUser.getEmail())) {
|
||||
pJson.put("personEmail", appUser.getEmail());
|
||||
pJson.put("email", appUser.getEmail());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUser.getPhone())) {
|
||||
pJson.put("personPhone", appUser.getPhone());
|
||||
pJson.put("phonenumber", appUser.getPhone());
|
||||
}
|
||||
if (StringUtils.isNotBlank(appUser.getPassword())) {
|
||||
pJson.put("password", appUser.getPassword());
|
||||
}
|
||||
String result=httpClientUtils.sendHttpPost(WEB_UPDATE_USER_INFO,lcUserToken,pJson.toJSONString());
|
||||
if (StringUtils.isBlank(result)) {
|
||||
throw new RuntimeException("调用门户修改用户信息接口响应为空");
|
||||
}
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
System.out.println("门户修改个人信息返回:"+json);
|
||||
return 0;
|
||||
JSONObject respJson = JsonUtil.parsePortalResponse(result, "调用修改个人信息接口");
|
||||
JSONObject data = respJson.getJSONObject("data");
|
||||
System.out.println(data);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetLcPsw(AppUser appUser) {
|
||||
String lcUserToken=redisCache.getCacheObject(CacheConstants.LC_HLW_TOKEN+appUser.getLcUserid());
|
||||
if(StringUtils.isBlank(lcUserToken)){
|
||||
throw new RuntimeException("token已失效");
|
||||
}
|
||||
//修改密码
|
||||
JSONObject pJson = new JSONObject();
|
||||
pJson.put("userId", appUser.getUserId());
|
||||
pJson.put("password", appUser.getPassword());
|
||||
String result=httpClientUtils.sendHttpPost(JG_RESET_PASSWORD_URL,lcUserToken,pJson.toJSONString());
|
||||
JSONObject respJson = JsonUtil.parsePortalResponse(result, "调用重置密码接口");
|
||||
JSONObject data = respJson.getJSONObject("data");
|
||||
System.out.println(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeLcCompanyStatus(AppUser appUser) {
|
||||
String lcUserToken=redisCache.getCacheObject(CacheConstants.LC_HLW_TOKEN+appUser.getLcUserid());
|
||||
if(StringUtils.isBlank(lcUserToken)){
|
||||
throw new RuntimeException("token已失效");
|
||||
}
|
||||
//启用禁用
|
||||
JSONObject pJson = new JSONObject();
|
||||
pJson.put("userId", appUser.getUserId());
|
||||
pJson.put("status", appUser.getStatus());
|
||||
String result=httpClientUtils.sendHttpPost(JG_UPDATE_COMPANY_URL,lcUserToken,pJson.toJSONString());
|
||||
JSONObject respJson = JsonUtil.parsePortalResponse(result, "调用停用和启用企业接口");
|
||||
JSONObject data = respJson.getJSONObject("data");
|
||||
System.out.println(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user