You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
2.2 KiB

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Caching;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application;
[Authorize]
[Route($"{BasedataConsts.RootPath}supplier-time")]
public class SupplierTimeWindowAppService :
SfsBaseDataAppServiceBase<SupplierTimeWindow, SupplierTimeWindowDTO, SfsBaseDataRequestInputBase, SupplierTimeWindowEditInput, SupplierTimeWindowImportInput>,
ISupplierTimeWindowAppService
{
private readonly ISupplierAppService _supplierAppService;
private readonly ISupplierTimeWindowManager _manager;
public SupplierTimeWindowAppService(ISupplierTimeWindowRepository repository, IDistributedCache<SupplierTimeWindowDTO> cache
, ISupplierAppService supplierAppService, ISupplierTimeWindowManager manager) : base(repository, cache)
{
base.CreatePolicyName = SupplierTimeWindowPermissions.Create;
base.UpdatePolicyName = SupplierTimeWindowPermissions.Update;
base.DeletePolicyName = SupplierTimeWindowPermissions.Delete;
_supplierAppService = supplierAppService;
_manager = manager;
}
//tReport.SupplierCode == item.Key.SupplierCode && tReport.TimeSlot == item.Key.TimeSlot && tReport.Week == item.Key.Week
/// <summary>
/// 查询 根据供应商代码
/// </summary>
/// <param name="supplierCode"></param>
/// <returns></returns>
[HttpGet("get-list-by-supplier-code")]
public virtual async Task<List<SupplierTimeWindowDTO>> GetListBySupplierCodeAsync(string supplierCode)
{
var entity = await _manager.GetListBySupplierCode(supplierCode).ConfigureAwait(false);
return ObjectMapper.Map<List<SupplierTimeWindow>, List<SupplierTimeWindowDTO>>(entity);
}
protected override async Task ValidateImportModelAsync(SupplierTimeWindowImportInput importInput, List<ValidationResult> validationRresult)
{
await base.CheckSupplierCodeAsync(importInput.SupplierCode, validationRresult).ConfigureAwait(false);
}
}