1、调整同步OA人员、部门的逻辑
2、人员同步保留系统原有头像,密码等信息 3、当部门参设置为从OA同步时,隐藏新增、编辑、删除按钮。
This commit is contained in:
parent
724a242f7a
commit
188a53bf7f
|
|
@ -2,6 +2,7 @@ package com.ruoyi.test.conrtroller;
|
|||
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -16,27 +17,20 @@ public class GetEcologyInfoTestController extends BaseController {
|
|||
private ISysUserService userService;
|
||||
|
||||
@RequestMapping("/anon/getEcologyDept")
|
||||
public String getEcologyDept() throws Exception {
|
||||
public AjaxResult getEcologyDept() throws Exception {
|
||||
String url="http://192.168.2.85:90/api/hrm/resful/getHrmdepartmentWithPage";
|
||||
String params="{\"params\":{\"pagesize\":999999}}";
|
||||
//return sendPost(url,params);
|
||||
int result = deptService.syncEcologyDept(url,params);
|
||||
if(result==200){
|
||||
return "同步成功";
|
||||
}
|
||||
return "同步失败";
|
||||
return deptService.syncEcologyDept(url,params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/anon/getEcologyUser")
|
||||
public String getEcologyUser(){
|
||||
public AjaxResult getEcologyUser(){
|
||||
String url="http://192.168.2.85:90/api/hrm/resful/getHrmUserInfoWithPage";
|
||||
String params="{\"params\":{\"pagesize\":999999}}";
|
||||
int result = userService.syncEcologyUser(url,params);
|
||||
if(result==200){
|
||||
return "同步成功";
|
||||
}
|
||||
return "同步失败";
|
||||
return userService.syncEcologyUser(url,params);
|
||||
}
|
||||
|
||||
/* *//*public Map<String,String> sendPostWithRest(String url,String params){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -37,6 +39,9 @@ public class SysDeptController extends BaseController
|
|||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Autowired
|
||||
ISysConfigService configService;
|
||||
|
||||
@RequiresPermissions("system:dept:view")
|
||||
@GetMapping()
|
||||
public String dept()
|
||||
|
|
@ -157,7 +162,7 @@ public class SysDeptController extends BaseController
|
|||
|
||||
/**
|
||||
* 选择部门树
|
||||
*
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param excludeId 排除ID
|
||||
*/
|
||||
|
|
@ -212,14 +217,9 @@ public class SysDeptController extends BaseController
|
|||
@RequiresPermissions("system:dept:sync")
|
||||
@PostMapping("/syncDept")
|
||||
@ResponseBody
|
||||
public AjaxResult syncDept()
|
||||
{
|
||||
String url="http://192.168.2.85:90/api/hrm/resful/getHrmdepartmentWithPage";
|
||||
String params="{\"params\":{\"pagesize\":999999}}";
|
||||
int result = deptService.syncEcologyDept(url,params);
|
||||
if(result==200){
|
||||
return AjaxResult.success("同步Ecology部门成功,返回状态码:"+result);
|
||||
}
|
||||
return AjaxResult.error("同步Ecology部门失败,返回状态码:"+result);
|
||||
public AjaxResult syncDept() {
|
||||
String url = "http://192.168.2.85:90/api/hrm/resful/getHrmdepartmentWithPage";
|
||||
String params = "{\"params\":{\"pagesize\":999999}}";
|
||||
return deptService.syncEcologyDept(url, params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -52,6 +54,9 @@ public class SysUserController extends BaseController
|
|||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@RequiresPermissions("system:user:view")
|
||||
@GetMapping()
|
||||
public String user()
|
||||
|
|
@ -293,14 +298,10 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:sync")
|
||||
@PostMapping("/syncUser")
|
||||
@ResponseBody
|
||||
public AjaxResult syncDept()
|
||||
{
|
||||
String url="http://192.168.2.85:90/api/hrm/resful/getHrmUserInfoWithPage";
|
||||
String params="{\"params\":{\"pagesize\":999999}}";
|
||||
int result = userService.syncEcologyUser(url,params);
|
||||
if(result==200){
|
||||
return AjaxResult.success("Ecology人员同步成功,返回状态码:"+result);
|
||||
}
|
||||
return AjaxResult.error("Ecology人员同步失败,返回状态码:"+result);
|
||||
public AjaxResult syncUser() {
|
||||
String url = "http://192.168.2.85:90/api/hrm/resful/getHrmUserInfoWithPage";
|
||||
String params = "{\"params\":{\"pagesize\":999999}}";
|
||||
return userService.syncEcologyUser(url, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
</head>
|
||||
|
||||
<body class="gray-bg">
|
||||
<div id="parent" class="col-sm-6">
|
||||
<div id="parent" class="col-sm-4">
|
||||
<div id="child">
|
||||
<h3 class="text-primary"> <strong>[[${wordsContent}]]</strong></h3>
|
||||
<h5 class="pull-right text-warning">-- 《[[${wordsOrigin}]]》 · [[${wordsAuthor}]]</h5>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<a class="btn btn-success" onclick="addDept()" shiro:hasPermission="system:dept:add" >
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:dept:edit">
|
||||
<a class="btn btn-primary" onclick="editDept()" shiro:hasPermission="system:dept:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
|
|
@ -96,6 +96,7 @@
|
|||
{
|
||||
title: '操作',
|
||||
align: 'left',
|
||||
visible: showAction(),
|
||||
formatter: function(value, row, index) {
|
||||
if (row.parentId != 0) {
|
||||
var actions = [];
|
||||
|
|
@ -112,30 +113,44 @@
|
|||
$.treeTable.init(options);
|
||||
});
|
||||
|
||||
function showAction(){
|
||||
if(deptSyncType == "1"){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function editDept(){
|
||||
if(deptSyncType =="0") {
|
||||
$.operate.edit();
|
||||
}else {
|
||||
alert("已启用同步Ecology部门信息,禁止手动修改部门!")
|
||||
}
|
||||
}
|
||||
|
||||
function addDept(){
|
||||
|
||||
if(deptSyncType =="0") {
|
||||
$.operate.add(999999);
|
||||
}else {
|
||||
alert("系统参数已启用同步Ecology部门信息,禁止手动新增部门!")
|
||||
alert("已启用同步Ecology部门信息,禁止手动新增部门!")
|
||||
}
|
||||
}
|
||||
function syncDept() {
|
||||
if(deptSyncType =="1") {
|
||||
/*if(deptSyncType =="1") {*/
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ctx + "system/dept/syncDept",
|
||||
data: JSON.stringify(""), //beauty是字符串
|
||||
data: JSON.stringify(""),
|
||||
contentType: "application/json",
|
||||
dataType: "json",
|
||||
success: function (message) {
|
||||
alert(JSON.stringify(message)); //将JSON对象转换为字符串
|
||||
}
|
||||
});
|
||||
}else {
|
||||
alert("系统参数未启用同步Ecology部门!")
|
||||
}
|
||||
/*}else {
|
||||
alert("系统未启用同步Ecology部门!");
|
||||
}*/
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" th:field="*{userName}" required>
|
||||
<input id="userName" name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" th:field="*{userName}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<label class="col-sm-4 control-label">手机号码:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}">
|
||||
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}">
|
||||
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
<label class="col-sm-4 control-label">邮箱:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<input name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" th:field="*{email}">
|
||||
<input name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" th:field="*{email}" id="email">
|
||||
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -91,8 +91,8 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">用户性别:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
||||
<select id="sex" name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -133,6 +133,7 @@
|
|||
<th:block th:include="include :: select2-js" />
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "system/user";
|
||||
var userType = [[${user.userType}]];
|
||||
|
||||
$("#form-user-edit").validate({
|
||||
onkeyup: false,
|
||||
|
|
@ -202,15 +203,17 @@
|
|||
|
||||
/* 用户管理-修改-选择部门树 */
|
||||
function selectDeptTree() {
|
||||
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
url: url,
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
if(userType !="02") { //如果用户状态为02(从OA同步),则不可选择部门
|
||||
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
||||
var url = ctx + "system/dept/selectDeptTree/" + deptId;
|
||||
var options = {
|
||||
title: '选择部门',
|
||||
width: "380",
|
||||
url: url,
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
|
|
@ -226,6 +229,10 @@
|
|||
placeholder: "请选择岗位",
|
||||
allowClear: true
|
||||
});
|
||||
//如果用户状态为02(从OA同步),则将相关信息不能做变更
|
||||
if(userType=="02") {
|
||||
$("#email,#userName,#treeName,#phonenumber").attr("readonly", "readonly")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
|
||||
var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
|
||||
var userSyncType = [[${#strings.defaultString(@config.getKey('sys.user.sync'), 0)}]];
|
||||
var prefix = ctx + "system/user";
|
||||
|
||||
$(function() {
|
||||
|
|
@ -191,7 +192,7 @@
|
|||
};
|
||||
$.table.init(options);
|
||||
}
|
||||
|
||||
|
||||
function queryDeptTree()
|
||||
{
|
||||
var url = ctx + "system/dept/treeData";
|
||||
|
|
@ -267,6 +268,7 @@
|
|||
}
|
||||
|
||||
function syncUser() {
|
||||
/*if(userSyncType=="1") {*/
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ctx + "system/user/syncUser",
|
||||
|
|
@ -277,6 +279,9 @@
|
|||
alert(JSON.stringify(message)); //将JSON对象转换为字符串
|
||||
}
|
||||
});
|
||||
/*}else {
|
||||
alert("系统未启用同步Ecology部门!");
|
||||
}*/
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
|
|
@ -111,5 +113,5 @@ public interface ISysDeptService
|
|||
/**
|
||||
* Ecology部门信息同步
|
||||
*/
|
||||
public int syncEcologyDept(String url,String params);
|
||||
public AjaxResult syncEcologyDept(String url, String params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
|
|
@ -208,7 +210,7 @@ public interface ISysUserService
|
|||
/**
|
||||
* Ecology人员信息同步
|
||||
*/
|
||||
public int syncEcologyUser(String url,String params);
|
||||
public AjaxResult syncEcologyUser(String url, String params);
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
|
|
|
|||
|
|
@ -4,16 +4,22 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.system.domain.EcologyDept;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.IWechatApiService;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -35,6 +41,15 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService sysconfig;
|
||||
|
||||
@Autowired
|
||||
private IWechatApiService wechatApiService;
|
||||
|
||||
@Autowired
|
||||
ISysUserService userService;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
|
@ -66,7 +81,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
/**
|
||||
* 查询部门管理树(排除下级)
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @param dept 部门
|
||||
* @return 所有部门信息
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -320,9 +335,24 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* Ecology部门信息同步
|
||||
*/
|
||||
@Override
|
||||
public int syncEcologyDept(String url,String params) {
|
||||
int result= deptSync(HttpUtils.sendPostWithRest(url,params));
|
||||
return result;
|
||||
public AjaxResult syncEcologyDept(String url, String params) {
|
||||
String msg="同步OA部门失败!";
|
||||
List<String> userList=new ArrayList<>();
|
||||
userList.add(ShiroUtils.getLoginName().equals("admin")?"359":String.valueOf(ShiroUtils.getUserId()));
|
||||
if( ! sysconfig.selectConfigByKey("sys.dept.sync").equals("1")){
|
||||
msg="OA部门同步失败!系统未开启OA部门同步!";
|
||||
wechatApiService.SendTextMessageToWechatUser(userList,msg);
|
||||
return AjaxResult.success(msg,"false");
|
||||
}
|
||||
int result =deptSync(HttpUtils.sendPostWithRest(url,params));
|
||||
if( result==200)
|
||||
{
|
||||
return AjaxResult.success("OA部门同步成功!",result);
|
||||
}
|
||||
|
||||
wechatApiService.SendTextMessageToWechatUser(userList,msg+"result:"+result);
|
||||
return AjaxResult.error(msg,result);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
|||
|
|
@ -6,10 +6,12 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.reflect.TypeToken;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.security.Md5Utils;
|
||||
|
|
@ -17,6 +19,7 @@ import com.ruoyi.system.domain.*;
|
|||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.IWechatApiService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -56,6 +59,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private IWechatApiService wechatApiService;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
|
@ -535,9 +541,24 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
* @param params
|
||||
*/
|
||||
@Override
|
||||
public int syncEcologyUser(String url, String params) {
|
||||
public AjaxResult syncEcologyUser(String url, String params) {
|
||||
String msg="OA人员同步失败!";
|
||||
List<String> userList=new ArrayList<>();
|
||||
userList.add(ShiroUtils.getLoginName().equals("admin")?"359":String.valueOf(ShiroUtils.getUserId()));
|
||||
if( ! configService.selectConfigByKey("sys.user.sync").equals("1")){
|
||||
msg="OA人员同步失败!系统未开启OA人员同步!";
|
||||
wechatApiService.SendTextMessageToWechatUser(userList,msg);
|
||||
return AjaxResult.success(msg,"false");
|
||||
}
|
||||
int result= userSync(HttpUtils.sendPostWithRest(url,params));
|
||||
return result;
|
||||
if( result==200)
|
||||
{
|
||||
return AjaxResult.success("OA人员同步成功!",result);
|
||||
}
|
||||
|
||||
wechatApiService.SendTextMessageToWechatUser(userList,msg+"result:"+result);
|
||||
return AjaxResult.error(msg,result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -569,10 +590,15 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
List<EcologyUser> ecologyUserList= new Gson().fromJson(dataMap.get("dataList").toString(), new TypeToken<List<EcologyUser>>(){}.getType());
|
||||
*/
|
||||
|
||||
//获取原同步的用户
|
||||
SysUser oldSysUser=new SysUser();
|
||||
oldSysUser.setUserType("02");
|
||||
List<SysUser> oldSysUserList=userMapper.selectUserLists(oldSysUser);
|
||||
|
||||
//删除从Ecology同步过来(用户类型为02)的用户
|
||||
userMapper.deleteEcologySyncUser();
|
||||
|
||||
//同步Ecology部门信息
|
||||
//同步Ecology人员信息
|
||||
SysUser user = new SysUser();
|
||||
for(EcologyUser ecologyUser:ecologyUserList){
|
||||
if(ecologyUser.getSubcompanyid1().equals("1") && StringUtils.isNotEmpty(ecologyUser.getLoginid())) { //只取分部ID为“1”的员工
|
||||
|
|
@ -593,6 +619,17 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
user.setPhonenumber(ecologyUser.getMobile());
|
||||
user.setStatus(ecologyUser.getStatus().equals("5")?"1":"0"); //Ecology为离职状态5,则无效
|
||||
user.setDelFlag("0");
|
||||
for(SysUser oldUser:oldSysUserList){
|
||||
if(String.valueOf(oldUser.getUserId()).equals(ecologyUser.getId())){
|
||||
user.setAvatar(oldUser.getAvatar());
|
||||
user.setPassword(oldUser.getPassword());
|
||||
user.setSalt(oldUser.getSalt());
|
||||
user.setLoginDate(oldUser.getLoginDate());
|
||||
user.setLoginIp(oldUser.getLoginIp());
|
||||
user.setPwdUpdateDate(oldUser.getPwdUpdateDate());
|
||||
user.setRemark(oldUser.getRemark());
|
||||
}
|
||||
}
|
||||
userMapper.insertUser(user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue