|
|
|
@ -49,11 +49,7 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
return DataResult.Failed("客户银行信息已存在!", MultiLanguageConst.ClientBankExist);
|
|
|
|
|
|
|
|
|
|
var data = req.Adapt<InfoClientBank>();
|
|
|
|
|
var entity = await TenantDb.Insertable(data).ExecuteReturnEntityAsync();
|
|
|
|
|
if (req.InvoiceHeaders?.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
await TenantDb.Insertable(req.InvoiceHeaders).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
var entity = await TenantDb.InsertNav(data).Include(x => x.InvoiceHeaders).ExecuteReturnEntityAsync();
|
|
|
|
|
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -80,12 +76,16 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<ClientBankRes> GetClientBankInfo(string id)
|
|
|
|
|
public async Task<DataResult<ClientBankRes>> GetClientBankInfoAsync(long id)
|
|
|
|
|
{
|
|
|
|
|
var data = TenantDb.Queryable<InfoClientBank>()
|
|
|
|
|
.Where(a => a.Id == long.Parse(id))
|
|
|
|
|
var data = await TenantDb.Queryable<InfoClientBank>()
|
|
|
|
|
.Where(a => a.Id == id)
|
|
|
|
|
.Select<ClientBankRes>()
|
|
|
|
|
.First();
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (data != null)
|
|
|
|
|
data.InvoiceHeaders = await TenantDb.Queryable<InvoiceHeader>().Where(x => x.RelativeId == id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
return DataResult<ClientBankRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|