和川用户同步时,离职员工问题

optimize
wanghaomei 2 years ago
parent 35481d9888
commit e81af0bd8f

@ -36,7 +36,7 @@ namespace Myshipping.Core.Job
var _repEmpPos = App.GetService<SqlSugarRepository<SysEmpPos>>(); var _repEmpPos = App.GetService<SqlSugarRepository<SysEmpPos>>();
var _repUserRole = App.GetService<SqlSugarRepository<SysUserRole>>(); var _repUserRole = App.GetService<SqlSugarRepository<SysUserRole>>();
var users = _repPingTaiUser.Where(u => u.CompId == "5913ab4b-ff5e-4d31-8b6c-09911bdfc0d4").ToList(); var users = _repPingTaiUser.Where(u => u.CompId == "5913ab4b-ff5e-4d31-8b6c-09911bdfc0d4").ToList();
var sysUsers = _repUser.Where(x => x.TenantId == tenantId).ToList(); var sysUsers = _repUser.AsQueryable().Filter(null, true).Where(x => x.TenantId == tenantId).ToList();
Log.Information($"准备同步用户数据,共{users.Count}条"); Log.Information($"准备同步用户数据,共{users.Count}条");
var keyDES = App.GetOptions<EncryptKeyOptions>().DES; var keyDES = App.GetOptions<EncryptKeyOptions>().DES;
@ -82,6 +82,7 @@ namespace Myshipping.Core.Job
//sysUser.NickName = user.SHOWNAME;//只在新增时同步昵称,防止覆盖 //sysUser.NickName = user.SHOWNAME;//只在新增时同步昵称,防止覆盖
sysUser.Phone = ub.MOBILE; sysUser.Phone = ub.MOBILE;
sysUser.Email = ub.EMAIL1; sysUser.Email = ub.EMAIL1;
sysUser.IsDeleted = user.IsLeave;
if (!existUser) if (!existUser)
{ {

Loading…
Cancel
Save