Browse Source

update

master
wanggang 1 year ago
parent
commit
dc47eb5d88
  1. 82
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs
  2. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj

82
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc;
using Omu.ValueInjecter;
using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ;
[Route("api/settleaccount/[controller]/[action]")]
public class JobItemAppService : SettleAccountApplicationBase<Material>
{
private readonly INormalEfCoreRepository<JobItem, Guid> _repository;
public JobItemAppService(INormalEfCoreRepository<JobItem, Guid> repository)
{
this._repository = repository;
}
[HttpPost]
public async Task<PagedResultDto<JobItem>> GetListAsync(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
return new PagedResultDto<JobItem>(totalCount, entities);
}
[HttpPost]
public async Task<JobItem> CreateAsync(JobItem input)
{
await _repository.InsertAsync(input).ConfigureAwait(false);
return input;
}
[HttpPost("{id}")]
public async Task<JobItem> UpdateAsync(Guid id, JobItem input)
{
var entity = await _repository.FindAsync(id).ConfigureAwait(false);
if (entity != null)
{
entity.InjectFrom(input);
}
await _repository.UpdateAsync(entity).ConfigureAwait(false);
return input;
}
[HttpPost]
public async Task<bool> DeleteListAsync(List<Guid> ids)
{
var _query = _repository.Where(p => ids.Contains(p.Id));
int i = await _query.BatchDeleteAsync().ConfigureAwait(false);
return i == 0;
}
}
[Route("api/settleaccount/[controller]/[action]")]
public class JobLogAppService : SettleAccountApplicationBase<Material>
{
private readonly INormalEfCoreRepository<JobLog, Guid> _repository;
public JobLogAppService(INormalEfCoreRepository<JobLog, Guid> repository)
{
this._repository = repository;
}
[HttpPost]
public async Task<PagedResultDto<JobLog>> GetListAsync(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
return new PagedResultDto<JobLog>(totalCount, entities);
}
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj

@ -126,6 +126,7 @@
<PackageReference Include="Riven.CodeArts.Db.Influx17x" Version="0.1.0" /> <PackageReference Include="Riven.CodeArts.Db.Influx17x" Version="0.1.0" />
<PackageReference Include="Shouldly" Version="4.0.3" /> <PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" /> <PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
<PackageReference Include="ValueInjecter" Version="3.2.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.3.3" /> <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="4.3.3" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.3.3" /> <PackageReference Include="Volo.Abp.AutoMapper" Version="4.3.3" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="4.3.3" /> <PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="4.3.3" />

Loading…
Cancel
Save