bug
This commit is contained in:
@@ -1505,6 +1505,7 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().Where(x=>x.table_name=="base_user").ToListAsync();
|
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().Where(x=>x.table_name=="base_user").ToListAsync();
|
||||||
List<UserEntity> insertUsers = new List<UserEntity>();
|
List<UserEntity> insertUsers = new List<UserEntity>();
|
||||||
|
List<UserEntity> existsUsers = await _db.Queryable<UserEntity>().ToListAsync();
|
||||||
List<UserRelationEntity> insertUserRelations = new List<UserRelationEntity>();
|
List<UserRelationEntity> insertUserRelations = new List<UserRelationEntity>();
|
||||||
List<ErpExtendField> insertErpExtendFields = new List<ErpExtendField>();
|
List<ErpExtendField> insertErpExtendFields = new List<ErpExtendField>();
|
||||||
|
|
||||||
@@ -1522,6 +1523,12 @@ namespace Tnb.ProductionMgr
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UserEntity userEntity = new UserEntity();
|
UserEntity userEntity = new UserEntity();
|
||||||
|
if (existsUsers.Exists(x => x.Account == person.CODE))
|
||||||
|
{
|
||||||
|
userEntity = existsUsers.Find(x => x.Account == person.CODE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
userEntity.Id = SnowflakeIdHelper.NextId();
|
userEntity.Id = SnowflakeIdHelper.NextId();
|
||||||
userEntity.Account = person.CODE;
|
userEntity.Account = person.CODE;
|
||||||
userEntity.RealName = person.NAME;
|
userEntity.RealName = person.NAME;
|
||||||
@@ -1550,6 +1557,7 @@ namespace Tnb.ProductionMgr
|
|||||||
userRelationEntity2.ObjectId = WmsWareHouseConst.AdministratorOrgId;
|
userRelationEntity2.ObjectId = WmsWareHouseConst.AdministratorOrgId;
|
||||||
userRelationEntity2.CreatorTime = DateTime.Now;
|
userRelationEntity2.CreatorTime = DateTime.Now;
|
||||||
insertUserRelations.Add(userRelationEntity2);
|
insertUserRelations.Add(userRelationEntity2);
|
||||||
|
}
|
||||||
|
|
||||||
ErpExtendField extendField = new ErpExtendField();
|
ErpExtendField extendField = new ErpExtendField();
|
||||||
extendField.org_id = WmsWareHouseConst.AdministratorOrgId;
|
extendField.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||||
|
|||||||
Reference in New Issue
Block a user