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