Browse Source

更新器具

dev_DY_CC
赵新宇 1 year ago
parent
commit
285015f236
  1. 54
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs
  2. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs
  3. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs
  4. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAppService.cs
  5. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

54
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAppService.cs

@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
@ -15,6 +17,8 @@ using Volo.Abp.Validation;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -29,14 +33,17 @@ public class EquipmentAppService
//private readonly ItemValidator _itemValidator;
private readonly IEquipmentManager _manager;
private new readonly IEquipmentRepository _repository;
private readonly IExportImportService _importService;
public EquipmentAppService(
IEquipmentRepository repository,
IDistributedCache<EquipmentDTO> cache,
IExportImportService importService,
// ItemValidator itemValidator,
IEquipmentManager manager)
: base(repository, cache)
{
_importService=importService;
_repository = repository;
//_itemValidator = itemValidator;
_manager = manager;
@ -52,7 +59,52 @@ public class EquipmentAppService
{
await Task.CompletedTask.ConfigureAwait(false);
}
//public override async Task<IActionResult> ImportAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file)
//{
// List<EquipmentErrorDTO> errors = new List<EquipmentErrorDTO>();
// using var ms = new MemoryStream();
// await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
// var inputFileBytes = ms.GetAllBytes();
// var dtos=_importService.Import<EquipmentEditInput>(inputFileBytes).ToList();
// var list=ObjectMapper.Map<List<EquipmentEditInput>, List<Equipment>>(dtos);
// foreach (var itm in list)
// {
// itm.SetId(GuidGenerator.Create());
// itm.Code = string.Format("{0}{1}", "Q", itm.Code);
// }
// ////var bytes = result.FileContents;
// ////result.FileContents = null;
// ////HttpContextAccessor.HttpContext.Response.Headers.AccessControlExposeHeaders = "X-Response";
// ////HttpContextAccessor.HttpContext.Response.Headers.Add("X-Response",
// //// JsonSerializer.Serialize(new { result.ExceptionMessage, result.FileName, result.FileCode, result }));
// ////Console.WriteLine(@"导入错误信息:" + result.ExceptionMessage);
// ////var resultAction = new TestResult(bytes, ExportImportService.ContentType) { FileDownloadName = result.FileName };
// ////resultAction.errorNum = result.ErrorNum;
// ////resultAction.successNum = resultAction.successNum;
// //return resultAction;
// // return base.ImportAsync(requestInput, file);
//}
//protected ICategoryAppService _categoryApp => LazyServiceProvider.LazyGetRequiredService<ICategoryAppService>();
//protected IItemCategoryAppService _itemCategoryApp => LazyServiceProvider.LazyGetRequiredService<IItemCategoryAppService>();

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAreaAutoMapperProfile.cs

@ -19,6 +19,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
;
//CreateMap<Equipment, EquipmentImportInput>()

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Equipments/EquipmentAutoMapperProfile.cs

@ -19,6 +19,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
.ForMember(p =>p.Code, p => p.MapFrom(q =>"Q" +q.Code))
;
//CreateMap<Equipment, EquipmentImportInput>()

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Equipments/EquipmentRecordAppService.cs

@ -23,7 +23,7 @@ namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}EquipmentRecord")]
public class EquipmentRecordAppService
: SfsCrudAppServiceBase<EquipmentRecord, EquipmentRecordDTO, SfsStoreRequestInputBase, EquipmentRecordEditInput,
: SfsStoreAppServiceBase<EquipmentRecord, EquipmentRecordDTO, SfsStoreRequestInputBase, EquipmentRecordEditInput,
ExchangeDataImportInput>
, IEquipmentRecordAppService
@ -42,32 +42,54 @@ public class EquipmentRecordAppService
_manager = manager;
_repository = repository;
}
/// <summary>
/// 没用
/// </summary>
/// <param name="id"></param>
/// <param name="list"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost("addDetail")]
public Task AddDetailListAsync(Guid id, List<EquipmentRecordDTO> list)
{
throw new NotImplementedException();
}
/// <summary>
/// 没用
/// </summary>
[HttpPost("check")]
public Task CheckStatusAsync(string number)
{
throw new NotImplementedException();
}
/// <summary>
/// 没用
/// </summary>
[HttpPost("getlist")]
public Task<List<EquipmentRecordDTO>> GetDetailListAsync(Guid id, SfsStoreRequestInputBase requestInput)
{
throw new NotImplementedException();
}
/// <summary>
/// 没用
/// </summary>
[HttpPost("updateDetail")]
public Task UpdateDetailAsync(Guid id, Guid detailId, EquipmentRecordDTO updateDTO)
{
throw new NotImplementedException();
}
/// <summary>
/// 没用
/// </summary>
[HttpPost("upsertAsync")]
public Task UpsertAsync(EquipmentRecordEditInput input)
{
throw new NotImplementedException();
}
/// <summary>
/// 没用
/// </summary>
[HttpPost("withDetil")]
Task<EquipmentRecordDTO> ISfsReadOnlyWithDetailsAppService<EquipmentRecordDTO, SfsStoreRequestInputBase, EquipmentRecordDTO, SfsStoreRequestInputBase>.GetDetailAsync(Guid id, Guid detailId)
{
throw new NotImplementedException();

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

@ -32,6 +32,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IPurchaseOrderRepository, PurchaseOrderEfCoreRepository>();
context.Services.AddTransient<ISaleOrderRepository, SaleOrderEfCoreRepository>();
context.Services.AddTransient<IWorkOrderRepository, WorkOrderEfCoreRepository>();
context.Services.AddTransient<IEquipmentRecordRepository, EquipmentRecordEfCoreRepository>();
#endregion

Loading…
Cancel
Save