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>
[AllowAnonymous]
[Route("api/settleaccount/TB_RePartsRelationship_SERVICE")]
[Route("api/settleaccount/[controller]/[action]")]
public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship>
{
/// <summary>
@ -48,7 +48,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 导入
/// </summary>
[HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
@ -94,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDto input)
{
string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx";
@ -114,8 +112,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public async Task<PagedResultDto<TB_RePartsRelationship_DTO>> GetListAsync(RequestDto input)
{
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
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/BomAppService")]
[Route("api/settleaccount/[controller]/[action]")]
public class BomAppService : SettleAccountApplicationBase<Bom>
{
/// <summary>
@ -50,7 +50,6 @@ namespace Win.Sfs.SettleAccount.Boms
/// µ¼³ö
/// </summary>
[HttpPost]
[Route("Export")]
public virtual async Task<string> ExportAsync(BomRequestDto input)
{
string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
@ -81,8 +80,7 @@ namespace Win.Sfs.SettleAccount.Boms
/// <summary>
/// »ñÈ¡Áбí
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public async Task<PagedResultDto<BomDto>> GetListAsync(BomRequestDto input)
{
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>
[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)
{

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

@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 期间设置
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/CentralizedControl")]
[Route("api/settleaccount/[controller]/[action]")]
public class CentralizedControlAppService : SettleAccountApplicationBase<CentralizedControl>
{
/// <summary>
@ -45,7 +45,6 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(CentralizedControlRequestDto input)
{
string fileName = $"期间设置_{Guid.NewGuid()}.xlsx";
@ -65,8 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public async Task<PagedResultDto<CentralizedControlDto>> GetListAsync(CentralizedControlRequestDto input)
{
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>
[HttpPost]
[Route("open")]
public async Task<bool> OpenVersion(List<Guid> ids)
{
var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id));
@ -96,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
/// 关闭版本
/// </summary>
[HttpPost]
[Route("close")]
public async Task<bool> ClosedVersion(List<Guid> ids)
{
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 System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
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.Services;
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.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.CommonManagers;
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.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.CacheBase;
using Win.Sfs.Shared.DtoBase;
using Win.Sfs.Shared.RepositoryBase;
using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
{
@ -39,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 客户零件关系
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/MaterialRelationshipAppService")]
[Route("api/settleaccount/[controller]/[action]")]
public class MaterialRelationshipAppService : SettleAccountApplicationBase<MaterialRelationship>
{
/// <summary>
@ -66,7 +51,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 导入
/// </summary>
[HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
@ -112,7 +96,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDtoBase input)
{
string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx";
@ -132,8 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public async Task<PagedResultDto<MaterialRelationshipDto>> GetListAsync(RequestDtoBase input)
{
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>
[AllowAnonymous]
[Route("api/settleaccount/MaterialAppService")]
[Route("api/settleaccount/[controller]/[action]")]
public class MaterialAppService : SettleAccountApplicationBase<Material>
{
/// <summary>
@ -45,8 +45,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public virtual async Task<string> ExportAsync(MaterialRequestDto input)
public async Task<string> ExportAsync(MaterialRequestDto input)
{
string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue,
@ -76,8 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
virtual public async Task<PagedResultDto<MaterialDto>> GetListAsync(MaterialRequestDto input)
{
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>
[Route("api/SettleAccount/TB_PRICE_LIST_Service")]
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppService : ApplicationService
{
private readonly PriceListManager _priceListManager;
@ -59,7 +59,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入
/// </summary>
[HttpPost]
[Route("Import")]
public virtual async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
{
ExportImporter _exportImporter = new ExportImporter();
@ -89,7 +88,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public virtual async Task<string> ExportAsync(RequestDto input)
{
IExporter _csv = new CsvExporter();
@ -125,8 +123,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public virtual async Task<PagedResultDto<TB_PRICE_LISTDto>> GetListAsync(RequestDto input)
{
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>
[HttpDelete]
[Route("{id}")]
[HttpPost]
virtual public async Task DeleteAsync(Guid id)
{
await _priceListManager.DeleteAsync(id);
@ -149,7 +145,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 批量删除
/// </summary>
[HttpPost]
[Route("delete")]
virtual public async Task<bool> DeleteListAsync(List<Guid> 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>
[AllowAnonymous]
[Route("api/SettleAccount/TB_PRICE_BJ_Service")]
[Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _repository;
@ -46,7 +46,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入
/// </summary>
[HttpPost]
[Route("Import")]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
{
ExportImporter _exportImporter = new ExportImporter();
@ -72,7 +71,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导出
/// </summary>
[HttpPost]
[Route("Export")]
public async Task<string> ExportAsync(RequestDto input)
{
string fileName = $"备件价格_{Guid.NewGuid()}.xlsx";
@ -92,8 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
[Route("list")]
[HttpGet]
public async Task<PagedResultDto<PriceListBJDto>> GetListAsync(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);

Loading…
Cancel
Save