Commit 303ec225 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop'

parents ebaa383d 5ef22f08
......@@ -85,6 +85,12 @@ public class PersonVo {
@Attribute
protected Date updateTime;
/**
* 部门id
*/
@Attribute
protected Long deptId;
/**
* 状态
*/
......
......@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -45,6 +46,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
......@@ -493,4 +495,16 @@ public class UserController {
UserInfo info = userService.getUserInfo(user);
return info;
}
/**
* 从ldap实时更新用户和部门
*
* @return R
*/
@SysLog("从ldap实时更新用户和部门")
@PostMapping("/updateUserAndDept")
public R updateUserAndDept(HttpServletRequest request,@RequestBody JSONObject json) {
return R.ok(userService.updateUserAndDept(request,json));
}
}
......@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -29,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Set;
......@@ -178,4 +180,9 @@ public interface SysUserService extends IService<SysUser> {
**/
void ldapLogin(String username,String password,SysUser user);
/**
* 从ldap实时更新用户和部门
* @return R
*/
R updateUserAndDept(HttpServletRequest request, JSONObject json);
}
......@@ -97,3 +97,7 @@ springdoc:
- group: upms
#按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.yifu.admin.controller
hrms:
id: HRBS
secret: d8a3649587afe0fc2045741f84cd15221b8404f1ae5c3e9c8c301a4caba07d54
......@@ -214,7 +214,7 @@
<insert id="batchInsertUser" parameterType="java.util.List">
insert into sys_user
(user_id,username,password,phone,email,nickname,create_time)
(user_id,username,password,phone,email,nickname,create_time,dept_id,dept_name)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
......@@ -224,7 +224,9 @@
#{item.telephoneNumber},
#{item.email},
#{item.personName},
now()
now(),
#{item.deptId},
#{item.deptName}
)
</foreach>
</insert>
......@@ -265,6 +267,20 @@
when username=#{i.uid} then now()
</foreach>
</trim>
<trim prefix="dept_id =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptId!=null">
when username=#{i.uid} then #{i.deptId}
</if>
</foreach>
</trim>
<trim prefix="dept_name =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptName!=null">
when username=#{i.uid} then #{i.deptName}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment