fix 已知问题
This commit is contained in:
@@ -89,12 +89,14 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
.ToListAsync();
|
||||
await _dbContext.DeleteAsync(relations);
|
||||
|
||||
request.UserNos = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => request.UserNos.Contains(x.No) || request.UserNos.Contains(x.Code))
|
||||
var userNos = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => request.UserNos.Contains(x.No) || request.UserNos.Contains(x.Code)) //NO和工号匹配
|
||||
.Select(x => x.No)
|
||||
.ToListAsync();
|
||||
|
||||
var entities = request.UserNos.Select(x => new GainfoGroupRelationshipEntity
|
||||
(userNos.Count != request.UserNos.Count).ThrowIfTrue("存在权限外人员,无法添加");
|
||||
|
||||
var entities = userNos.Select(x => new GainfoGroupRelationshipEntity
|
||||
{
|
||||
GroupCode = request.GroupCode,
|
||||
UserNo = x
|
||||
|
||||
@@ -43,13 +43,17 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
||||
: await GetOutSourceCodeAsync();
|
||||
|
||||
await _dbContext.InsertAsync(entity);
|
||||
await _dbContext.InsertAsync(new OutsourceEntity
|
||||
|
||||
if (!await _dbContext.Queryable<OutsourceEntity>().Where(x => x.Code == entity.Code).AnyAsync())
|
||||
{
|
||||
Code = entity.Code,
|
||||
Supplier = request.ExternalInfo.Supplier,
|
||||
SapCode = request.ExternalInfo.SapCode,
|
||||
SapPhone = request.ExternalInfo.SapPhone
|
||||
});
|
||||
await _dbContext.InsertAsync(new OutsourceEntity
|
||||
{
|
||||
Code = entity.Code,
|
||||
Supplier = request.ExternalInfo.Supplier,
|
||||
SapCode = request.ExternalInfo.SapCode,
|
||||
SapPhone = request.ExternalInfo.SapPhone
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -239,8 +239,7 @@ public class GainfoService : IGainfoService
|
||||
|
||||
public async Task<object> CheckIdNoAndNameMatchAsync(GainfoCheckIdNoAndNameRequest request)
|
||||
{
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working).FirstAsync(x => x.IdNo == request.IdNo && x.Name == request.Name);
|
||||
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working).SingleAsync(x => x.IdNo == request.IdNo && x.Name == request.Name);
|
||||
gainfo.ThrowIfNull("验证失败!");
|
||||
|
||||
var protector = _dataProtectionProvider.CreateProtector("gainfo:external:idno");
|
||||
|
||||
Reference in New Issue
Block a user