|
|
@ -35,7 +35,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// </summary>
|
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Default)] |
|
|
|
|
|
|
|
[Route("api/settleaccount/CodeSetting")] |
|
|
|
[Route("api/settleaccount/[controller]/[action]")]
|
|
|
|
public class CodeSettingAppService : SettleAccountApplicationBase<CodeSetting>, ICodeSettingAppService |
|
|
|
{ |
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository; |
|
|
@ -70,9 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("ExcelImport-Map")] |
|
|
|
[DisableRequestSizeLimit] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Create)] |
|
|
|
public async Task<string> CodeSettingUploadExcelImportMap([FromForm] IFormFileCollection files) |
|
|
|
{ |
|
|
|
|
|
|
@ -107,9 +105,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("ExcelImport")] |
|
|
|
[DisableRequestSizeLimit] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Create)] |
|
|
|
public async Task<string> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files) |
|
|
|
{ |
|
|
|
|
|
|
@ -148,7 +144,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <param name="id">ID</param>
|
|
|
|
/// <returns>实体DTO</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("{id}")] |
|
|
|
virtual public async Task<CodeSettingDto> GetAsync(Guid id) |
|
|
|
{ |
|
|
|
var result = await _repository.GetAsync(id); |
|
|
@ -184,8 +179,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// </remarks>
|
|
|
|
/// <param name="input">请求条件</param>
|
|
|
|
/// <returns>实体DTO列表</returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("list")] |
|
|
|
[HttpGet] |
|
|
|
virtual public async Task<PagedResultDto<CodeSettingDto>> GetListAsync(CodeSettingRequestDto input) |
|
|
|
{ |
|
|
|
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, |
|
|
@ -203,7 +197,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// </summary>
|
|
|
|
/// <returns>实体总数</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("count")] |
|
|
|
virtual public async Task<long> GetTotalCountAsync(Guid branchId) |
|
|
|
{ |
|
|
|
return await _repository.GetCountAsync(branchId); |
|
|
@ -214,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// </summary>
|
|
|
|
/// <returns>实体DTO列表</returns>
|
|
|
|
[HttpGet] |
|
|
|
[Route("all")] |
|
|
|
virtual public async Task<ListResultDto<CodeSettingDto>> GetAllAsync(Guid branchId) |
|
|
|
{ |
|
|
|
var entities = await _repository.GetAllAsync(branchId, true); |
|
|
@ -270,8 +262,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <returns>实体DTO</returns>
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
[Route("")] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Create)] |
|
|
|
virtual public async Task<CodeSettingDto> CreateAsync(CodeSettingCreateDto input) |
|
|
|
{ |
|
|
|
var _first = _repository.Where(p => p.Project == input.Project && p.Value==input.Value).FirstOrDefault(); |
|
|
@ -305,7 +295,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
[Route("Export")] |
|
|
|
virtual public async Task<string> ExportAsync(CodeSettingRequestDto input) |
|
|
|
{ |
|
|
|
string _fileName = string.Format("通用代码设置_{0}.xlsx",DateTime.Now.ToString("yyyyMMdd")); |
|
|
@ -339,9 +328,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <param name="id">ID</param>
|
|
|
|
/// <param name="input">修改实体DTO</param>
|
|
|
|
/// <returns>实体DTO</returns>
|
|
|
|
[HttpPut] |
|
|
|
[Route("{id}")] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Update)] |
|
|
|
[HttpPost] |
|
|
|
virtual public async Task<CodeSettingDto> UpdateAsync(Guid id, CodeSettingUpdateDto input) |
|
|
|
{ |
|
|
|
var _first = _repository.Where(p => p.Project == input.Project && p.Value == input.Value).FirstOrDefault(); |
|
|
@ -364,9 +351,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">ID</param>
|
|
|
|
/// <returns>无</returns>
|
|
|
|
[HttpDelete] |
|
|
|
[Route("{id}")] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Delete)] |
|
|
|
[HttpPost] |
|
|
|
virtual public async Task DeleteAsync(Guid id) |
|
|
|
{ |
|
|
|
var entity = await GetFromCacheAsync(id); |
|
|
@ -380,8 +365,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables |
|
|
|
/// <param name="ids">IDs</param>
|
|
|
|
/// <returns>是否执行成功</returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("delete")] |
|
|
|
[Authorize(SettleAccountPermissions.CodeSettings.Delete)] |
|
|
|
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) |
|
|
|
{ |
|
|
|
|
|
|
|