Browse Source

基础数据修改问使用Get、Post请求

master
mahao 1 year ago
parent
commit
bbc0059f8f
  1. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
  2. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs
  3. 25
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
  4. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs
  5. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  6. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs
  7. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  8. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs

@ -24,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 客户替换件关系 /// 客户替换件关系
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/TB_RePartsRelationship_SERVICE")] [Route("api/settleaccount/[controller]/[action]")]
public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship> public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship>
{ {
/// <summary> /// <summary>
@ -48,7 +48,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -94,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDto input) public async Task<string> ExportAsync(RequestDto input)
{ {
string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx"; string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx";
@ -114,8 +112,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public async Task<PagedResultDto<TB_RePartsRelationship_DTO>> GetListAsync(RequestDto input) public async Task<PagedResultDto<TB_RePartsRelationship_DTO>> GetListAsync(RequestDto input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs

@ -23,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Boms
/// BOM /// BOM
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/BomAppService")] [Route("api/settleaccount/[controller]/[action]")]
public class BomAppService : SettleAccountApplicationBase<Bom> public class BomAppService : SettleAccountApplicationBase<Bom>
{ {
/// <summary> /// <summary>
@ -50,7 +50,6 @@ namespace Win.Sfs.SettleAccount.Boms
/// µ¼³ö /// µ¼³ö
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public virtual async Task<string> ExportAsync(BomRequestDto input) public virtual async Task<string> ExportAsync(BomRequestDto input)
{ {
string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
@ -81,8 +80,7 @@ namespace Win.Sfs.SettleAccount.Boms
/// <summary> /// <summary>
/// »ñÈ¡Áбí /// »ñÈ¡Áбí
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public async Task<PagedResultDto<BomDto>> GetListAsync(BomRequestDto input) public async Task<PagedResultDto<BomDto>> GetListAsync(BomRequestDto input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);

25
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs

@ -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)
{ {

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs

@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 期间设置 /// 期间设置
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/CentralizedControl")] [Route("api/settleaccount/[controller]/[action]")]
public class CentralizedControlAppService : SettleAccountApplicationBase<CentralizedControl> public class CentralizedControlAppService : SettleAccountApplicationBase<CentralizedControl>
{ {
/// <summary> /// <summary>
@ -45,7 +45,6 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(CentralizedControlRequestDto input) public async Task<string> ExportAsync(CentralizedControlRequestDto input)
{ {
string fileName = $"期间设置_{Guid.NewGuid()}.xlsx"; string fileName = $"期间设置_{Guid.NewGuid()}.xlsx";
@ -65,8 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public async Task<PagedResultDto<CentralizedControlDto>> GetListAsync(CentralizedControlRequestDto input) public async Task<PagedResultDto<CentralizedControlDto>> GetListAsync(CentralizedControlRequestDto input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
@ -81,7 +79,6 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 开启版本 /// 开启版本
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("open")]
public async Task<bool> OpenVersion(List<Guid> ids) public async Task<bool> OpenVersion(List<Guid> ids)
{ {
var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)); var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id));
@ -96,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 关闭版本 /// 关闭版本
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("close")]
public async Task<bool> ClosedVersion(List<Guid> ids) public async Task<bool> ClosedVersion(List<Guid> ids)
{ {
var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)); var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id));

32
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -1,37 +1,22 @@
using System; using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using Shouldly; using Shouldly;
using Volo.Abp; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.Boms;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.CacheBase;
using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
{ {
@ -39,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 客户零件关系 /// 客户零件关系
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/MaterialRelationshipAppService")] [Route("api/settleaccount/[controller]/[action]")]
public class MaterialRelationshipAppService : SettleAccountApplicationBase<MaterialRelationship> public class MaterialRelationshipAppService : SettleAccountApplicationBase<MaterialRelationship>
{ {
/// <summary> /// <summary>
@ -66,7 +51,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -112,7 +96,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDtoBase input) public async Task<string> ExportAsync(RequestDtoBase input)
{ {
string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx"; string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx";
@ -132,8 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public async Task<PagedResultDto<MaterialRelationshipDto>> GetListAsync(RequestDtoBase input) public async Task<PagedResultDto<MaterialRelationshipDto>> GetListAsync(RequestDtoBase input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs

@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// 物料主数据 /// 物料主数据
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/MaterialAppService")] [Route("api/settleaccount/[controller]/[action]")]
public class MaterialAppService : SettleAccountApplicationBase<Material> public class MaterialAppService : SettleAccountApplicationBase<Material>
{ {
/// <summary> /// <summary>
@ -45,8 +45,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")] public async Task<string> ExportAsync(MaterialRequestDto input)
public virtual async Task<string> ExportAsync(MaterialRequestDto input)
{ {
string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue,
@ -76,8 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
virtual public async Task<PagedResultDto<MaterialDto>> GetListAsync(MaterialRequestDto input) virtual public async Task<PagedResultDto<MaterialDto>> GetListAsync(MaterialRequestDto input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount,

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -23,8 +23,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary> /// <summary>
/// 销售价格单 /// 销售价格单
/// </summary> /// </summary>
[Route("api/SettleAccount/TB_PRICE_LIST_Service")]
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppService : ApplicationService public class PriceListAppService : ApplicationService
{ {
private readonly PriceListManager _priceListManager; private readonly PriceListManager _priceListManager;
@ -59,7 +59,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Import")]
public virtual async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version) public virtual async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -89,7 +88,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public virtual async Task<string> ExportAsync(RequestDto input) public virtual async Task<string> ExportAsync(RequestDto input)
{ {
IExporter _csv = new CsvExporter(); IExporter _csv = new CsvExporter();
@ -125,8 +123,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public virtual async Task<PagedResultDto<TB_PRICE_LISTDto>> GetListAsync(RequestDto input) public virtual async Task<PagedResultDto<TB_PRICE_LISTDto>> GetListAsync(RequestDto input)
{ {
var entitys = await _priceListManager.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); var entitys = await _priceListManager.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
@ -138,8 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary> /// <summary>
/// 删除 /// 删除
/// </summary> /// </summary>
[HttpDelete] [HttpPost]
[Route("{id}")]
virtual public async Task DeleteAsync(Guid id) virtual public async Task DeleteAsync(Guid id)
{ {
await _priceListManager.DeleteAsync(id); await _priceListManager.DeleteAsync(id);
@ -149,7 +145,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 批量删除 /// 批量删除
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("delete")]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids) virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{ {
return await _priceListManager.DeleteListAsync(ids); return await _priceListManager.DeleteListAsync(ids);

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -22,7 +22,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 备件价格 /// 备件价格
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/SettleAccount/TB_PRICE_BJ_Service")] [Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ> public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{ {
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _repository; private readonly INormalEfCoreRepository<PriceListBJ, Guid> _repository;
@ -46,7 +46,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version) public async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -72,7 +71,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导出 /// 导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDto input) public async Task<string> ExportAsync(RequestDto input)
{ {
string fileName = $"备件价格_{Guid.NewGuid()}.xlsx"; string fileName = $"备件价格_{Guid.NewGuid()}.xlsx";
@ -92,8 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
[HttpPost] [HttpGet]
[Route("list")]
public async Task<PagedResultDto<PriceListBJDto>> GetListAsync(RequestDto input) public async Task<PagedResultDto<PriceListBJDto>> GetListAsync(RequestDto input)
{ {
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);

Loading…
Cancel
Save