个人信息完善
This commit is contained in:
@@ -3,6 +3,7 @@ package com.vetti.web.controller.system;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.vetti.common.core.domain.R;
|
||||
import com.vetti.common.enums.UserOperStepsEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -52,14 +53,14 @@ public class SysProfileController extends BaseController
|
||||
*/
|
||||
@ApiOperation("个人信息")
|
||||
@GetMapping("/personalInfo")
|
||||
public AjaxResult<SysUser> profile()
|
||||
public R<SysUser> profile()
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser user = userService.selectUserById(loginUser.getUserId());
|
||||
AjaxResult ajax = AjaxResult.success(user);
|
||||
R r = R.ok(user);
|
||||
// ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
||||
// ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
||||
return ajax;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +70,7 @@ public class SysProfileController extends BaseController
|
||||
@ApiOperation("个人信息完善")
|
||||
@Log(title = "个人信息完善", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/completeInfo")
|
||||
public AjaxResult personalInfoProfile(@RequestBody SysUser user)
|
||||
public R personalInfoProfile(@RequestBody SysUser user)
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysUser currentUser = userService.selectUserById(loginUser.getUserId());
|
||||
@@ -96,7 +97,7 @@ public class SysProfileController extends BaseController
|
||||
// 更新缓存用户信息
|
||||
tokenService.setLoginUser(loginUser);
|
||||
}
|
||||
return success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.vetti.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.vetti.common.constant.HttpStatus;
|
||||
import com.vetti.common.utils.MessageUtils;
|
||||
|
||||
@@ -21,7 +23,9 @@ public class R<T> implements Serializable
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
private String message;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
private T data;
|
||||
|
||||
@@ -70,7 +74,8 @@ public class R<T> implements Serializable
|
||||
R<T> apiResult = new R<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
apiResult.setMessage(msg);
|
||||
apiResult.setTimestamp(DateUtil.now());
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
@@ -84,14 +89,20 @@ public class R<T> implements Serializable
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
return msg;
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public T getData()
|
||||
|
||||
@@ -25,6 +25,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="sysUserType" column="sys_user_type" />
|
||||
|
||||
<result property="steps" column="steps" />
|
||||
<result property="jobPosition" column="job_position" />
|
||||
<result property="experience" column="experience" />
|
||||
<result property="cvUrl" column="cv_url" />
|
||||
<result property="location" column="location" />
|
||||
<result property="jobType" column="job_type" />
|
||||
<result property="relocate" column="relocate" />
|
||||
<result property="bestSideJson" column="best_side_json" />
|
||||
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
@@ -52,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.sys_user_type
|
||||
,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -59,7 +70,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,u.sys_user_type from sys_user u
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_name, d.leader,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
@@ -91,7 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.sys_user_type
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status,
|
||||
u.create_time,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -108,7 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.sys_user_type
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.sys_user_type,
|
||||
u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -163,6 +177,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="sysUserType != null and sysUserType != ''">sys_user_type,</if>
|
||||
|
||||
<if test="steps != null and steps != ''">steps,</if>
|
||||
<if test="jobPosition != null and jobPosition != ''">job_position,</if>
|
||||
<if test="experience != null and experience != ''">experience,</if>
|
||||
<if test="cvUrl != null and cvUrl != ''">cv_url,</if>
|
||||
<if test="location != null and location != ''">location,</if>
|
||||
<if test="jobType != null and jobType != ''">job_type,</if>
|
||||
<if test="relocate != null and relocate != ''">relocate,</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">best_side_json,</if>
|
||||
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
@@ -179,6 +203,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="sysUserType != null and sysUserType != ''">#{sysUserType},</if>
|
||||
|
||||
<if test="steps != null and steps != ''">#{steps},</if>
|
||||
<if test="jobPosition != null and jobPosition != ''">#{jobPosition},</if>
|
||||
<if test="experience != null and experience != ''">#{experience},</if>
|
||||
<if test="cvUrl != null and cvUrl != ''">#{cvUrl},</if>
|
||||
<if test="location != null and location != ''">#{location},</if>
|
||||
<if test="jobType != null and jobType != ''">#{jobType},</if>
|
||||
<if test="relocate != null and relocate != ''">#{relocate},</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">#{bestSideJson},</if>
|
||||
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -199,6 +233,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="sysUserType != null">sys_user_type = #{sysUserType},</if>
|
||||
|
||||
<if test="steps != null and steps != ''">steps = #{steps},</if>
|
||||
<if test="jobPosition != null and jobPosition != ''">job_position = #{jobPosition},</if>
|
||||
<if test="experience != null and experience != ''">experience = #{experience},</if>
|
||||
<if test="cvUrl != null and cvUrl != ''">cv_url = #{cvUrl},</if>
|
||||
<if test="location != null and location != ''">location = #{location},</if>
|
||||
<if test="jobType != null and jobType != ''">job_type = #{jobType},</if>
|
||||
<if test="relocate != null and relocate != ''">relocate = #{relocate},</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">best_side_json = #{bestSideJson},</if>
|
||||
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
||||
Reference in New Issue
Block a user