|
|
@ -42,7 +42,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <summary>
|
|
|
|
/// 区域相关应用服务
|
|
|
|
/// </summary>
|
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
//[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)]
|
|
|
|
//[AllowAnonymous]
|
|
|
|
[Route("api/settleaccount/CarMaterialConfig")] |
|
|
|
public class CarMaterialConfigAppService : SettleAccountApplicationBase<CarMaterialConfig>, ICarMaterialConfigAppService |
|
|
@ -81,7 +81,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
[HttpPost] |
|
|
|
[Route("ExcelImport")] |
|
|
|
[DisableRequestSizeLimit] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
// [Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)]
|
|
|
|
public async Task<string> CarMaterialConfigUploadExcelImport([FromForm] IFormFileCollection files) |
|
|
|
{ |
|
|
|
ExportImporter _exportImporter = new ExportImporter(); |
|
|
@ -162,7 +162,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>实体DTO</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("{id}")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
//[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)]
|
|
|
|
virtual public async Task<CarMaterialConfigDto> GetAsync(Guid id) |
|
|
|
{ |
|
|
|
var result = await _repository.GetAsync(id); |
|
|
@ -200,7 +200,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>实体DTO列表</returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("list")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
//[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)]
|
|
|
|
virtual public async Task<PagedResultDto<CarMaterialConfigDto>> GetListAsync(CarMaterialConfigRequestDto input) |
|
|
|
{ |
|
|
|
|
|
|
@ -224,7 +224,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>实体总数</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("count")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
|
|
|
|
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|
|
|
{ |
|
|
|
return await _repository.GetCountAsync(branchId); |
|
|
@ -236,7 +236,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>实体DTO列表</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("all")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
|
|
|
|
virtual public async Task<ListResultDto<CarMaterialConfigDto>> GetAllAsync(Guid branchId) |
|
|
|
{ |
|
|
|
var entities = await _repository.GetAllAsync(branchId, true); |
|
|
@ -274,7 +274,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>是否导入成功</returns>
|
|
|
|
//[HttpPost]
|
|
|
|
//[Route("import")]
|
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Create)] |
|
|
|
|
|
|
|
//virtual public async Task<bool> ImportAsync(List<CarMaterialConfigCreateDto> dtos)
|
|
|
|
//{
|
|
|
|
// var entities =ObjectMapper.Map<List<CarMaterialConfigCreateDto>, List<CarMaterialConfig>>(dtos);
|
|
|
@ -293,7 +293,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
[Route("")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Create)] |
|
|
|
|
|
|
|
virtual public async Task<CarMaterialConfigDto> CreateAsync(CarMaterialConfigCreateDto input) |
|
|
|
{ |
|
|
|
var _first = _repository.Where(p =>p.CarCode==input.CarCode && p.MaterialCode==input.MaterialCode && p.Qty==input.Qty).FirstOrDefault(); |
|
|
@ -342,7 +342,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>实体DTO</returns>
|
|
|
|
[HttpPut] |
|
|
|
[Route("{id}")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Update)] |
|
|
|
|
|
|
|
virtual public async Task<CarMaterialConfigDto> UpdateAsync(Guid id, CarMaterialConfigUpdateDto input) |
|
|
|
{ |
|
|
|
var entity = await _repository.GetAsync(id); |
|
|
@ -361,7 +361,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>无</returns>
|
|
|
|
[HttpDelete] |
|
|
|
[Route("{id}")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Delete)] |
|
|
|
|
|
|
|
virtual public async Task DeleteAsync(Guid id) |
|
|
|
{ |
|
|
|
var entity = await GetFromCacheAsync(id); |
|
|
@ -376,7 +376,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns>是否执行成功</returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("delete")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Delete)] |
|
|
|
|
|
|
|
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|
|
|
{ |
|
|
|
|
|
|
@ -398,7 +398,7 @@ namespace Win.Sfs.SettleAccount.Entities.CarMaterialConfigTables |
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("Export")] |
|
|
|
[Authorize(SettleAccountPermissions.CarMaterialConfigs.Default)] |
|
|
|
|
|
|
|
virtual public async Task<string> ExportAsync(CarMaterialConfigRequestDto input) |
|
|
|
{ |
|
|
|
|
|
|
|