Commit f9f79002 authored by huyuchen's avatar huyuchen

明细接口改造

parent 72b47c4b
...@@ -85,6 +85,12 @@ public class PersonVo { ...@@ -85,6 +85,12 @@ public class PersonVo {
@Attribute @Attribute
protected Date updateTime; protected Date updateTime;
/**
* 部门id
*/
@Attribute
protected Long deptId;
/** /**
* 状态 * 状态
*/ */
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.controller; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -45,6 +46,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -45,6 +46,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -493,4 +495,16 @@ public class UserController { ...@@ -493,4 +495,16 @@ public class UserController {
UserInfo info = userService.getUserInfo(user); UserInfo info = userService.getUserInfo(user);
return info; 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 @@ ...@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.service; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -29,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO; ...@@ -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 com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -178,4 +180,9 @@ public interface SysUserService extends IService<SysUser> { ...@@ -178,4 +180,9 @@ public interface SysUserService extends IService<SysUser> {
**/ **/
void ldapLogin(String username,String password,SysUser user); void ldapLogin(String username,String password,SysUser user);
/**
* 从ldap实时更新用户和部门
* @return R
*/
R updateUserAndDept(HttpServletRequest request, JSONObject json);
} }
...@@ -97,3 +97,7 @@ springdoc: ...@@ -97,3 +97,7 @@ springdoc:
- group: upms - group: upms
#按包路径匹配 #按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.yifu.admin.controller packagesToScan: com.yifu.cloud.plus.v1.yifu.admin.controller
hrms:
id: HRBS
secret: d8a3649587afe0fc2045741f84cd15221b8404f1ae5c3e9c8c301a4caba07d54
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<insert id="batchInsertUser" parameterType="java.util.List"> <insert id="batchInsertUser" parameterType="java.util.List">
insert into sys_user 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 VALUES
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
...@@ -224,7 +224,9 @@ ...@@ -224,7 +224,9 @@
#{item.telephoneNumber}, #{item.telephoneNumber},
#{item.email}, #{item.email},
#{item.personName}, #{item.personName},
now() now(),
#{item.deptId},
#{item.deptName}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -265,6 +267,20 @@ ...@@ -265,6 +267,20 @@
when username=#{i.uid} then now() when username=#{i.uid} then now()
</foreach> </foreach>
</trim> </trim>
<trim prefix="dept_id =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptId!=null">
when username=#{i.userId} 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.userId} then #{i.deptName}
</if>
</foreach>
</trim>
</trim> </trim>
where where
<foreach collection="list" separator="or" item="i" index="index" > <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