50 changed files with 2012 additions and 403 deletions
@ -0,0 +1,31 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
[Display(Name = "器具库位关系")] |
|||
|
|||
public class EquipmentLocDTO : SfsBaseDataDTOBase, IHasCode |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "库位代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string LocCode { get; set; } |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
[Display(Name = "器具基本信息")] |
|||
|
|||
public class EquipmentPartCodeDTO : SfsBaseDataDTOBase, IHasCode |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 器具代号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//[Display(Name = "型号")]
|
|||
//public string Model { get; set; } = string.Empty;
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "零件代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PartCode { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "标包数")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal StdQty { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 单位
|
|||
/// </summary>
|
|||
[Display(Name = "单位")] |
|||
public string Unit { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
|
|||
//[Display(Name = "状态")]
|
|||
//public int State { get; set; } = 0;
|
|||
|
|||
///// <summary>
|
|||
///// 创建人
|
|||
///// </summary>
|
|||
//[Display(Name = "创建人")]
|
|||
//public string Creator { get; set; }
|
|||
|
|||
///// <summary>
|
|||
///// 创建时间
|
|||
///// </summary>
|
|||
//[Display(Name = "创建时间")]
|
|||
//public DateTime CreatTime { get; set; } = DateTime.Now;
|
|||
} |
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Equipments.DTOs; |
|||
[Display(Name = "器具校验信息")] |
|||
public class EquipmentRecordErrorDTO |
|||
{ |
|||
[Display(Name = "器具代码")] |
|||
public string EqptCode { set; get; } |
|||
[Display(Name = "零件代码")] |
|||
public string PartCode { set; get; } |
|||
[Display(Name = "错误信息")] |
|||
public string Error { set; get; } |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public interface IEquipmentLocAppService |
|||
: ISfsBaseDataAppServiceBase<EquipmentLocDTO, SfsBaseDataRequestInputBase, EquipmentLocEditInput> |
|||
, ISfsGetByCodeAppService<EquipmentLocDTO> |
|||
, ISfsCheckAppService<EquipmentLocCheckInput> |
|||
, ISfsUpsertAppService<EquipmentLocEditInput> |
|||
{ |
|||
|
|||
|
|||
Task<List<EquipmentLocDTO>> GetEquipmentLocAsync(List<string> p_ls); |
|||
|
|||
|
|||
//Task<bool> CheckItemIsAvailable(string itemCode);
|
|||
//[HttpGet("check-item-is-available-no-select-sql")]
|
|||
//void CheckItemIsAvailable(EquipmentLocDTO EquipmentLocDTO);
|
|||
|
|||
//Task<List<EquipmentLocDTO>> GetListByNameAsync(string name);
|
|||
|
|||
//Task<EquipmentLocDTO> GetOrAddAsync(EquipmentLocEditInput input);
|
|||
|
|||
//Task<EnumItemManageType> GetManageTypeAsync(string itemCode);
|
|||
//Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes);
|
|||
|
|||
//Task UpsertAsyncByInterface(EquipmentLocEditInput input);
|
|||
//Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
|
|||
} |
@ -0,0 +1,31 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public interface IEquipmentPartCodeAppService |
|||
: ISfsBaseDataAppServiceBase<EquipmentPartCodeDTO, SfsBaseDataRequestInputBase, EquipmentPartCodeEditInput> |
|||
, ISfsGetByCodeAppService<EquipmentPartCodeDTO> |
|||
|
|||
, ISfsUpsertAppService<EquipmentPartCodeEditInput> |
|||
{ |
|||
|
|||
|
|||
Task<List<EquipmentPartCodeDTO>> GetEquipmentPartCodesAsync(List<string> p_ls); |
|||
//Task<bool> CheckItemIsAvailable(string itemCode);
|
|||
//[HttpGet("check-item-is-available-no-select-sql")]
|
|||
//void CheckItemIsAvailable(EquipmentPartCodeDTO EquipmentPartCodeDTO);
|
|||
|
|||
//Task<List<EquipmentPartCodeDTO>> GetListByNameAsync(string name);
|
|||
|
|||
//Task<EquipmentPartCodeDTO> GetOrAddAsync(EquipmentPartCodeEditInput input);
|
|||
|
|||
//Task<EnumItemManageType> GetManageTypeAsync(string itemCode);
|
|||
//Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes);
|
|||
|
|||
//Task UpsertAsyncByInterface(EquipmentPartCodeEditInput input);
|
|||
//Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
|
|||
} |
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public class EquipmentLocCheckInput |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "库位代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string LocCode { get; set; } |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public class EquipmentLocEditInput : SfsBaseDataCreateOrUpdateInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "库位代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string LocCode { get; set; } |
|||
|
|||
[Display(Name = "状态")] |
|||
public int State { get; set; } = 0; |
|||
|
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
[Display(Name = "器具")] |
|||
public class EquipmentLocImportInput : SfsBaseDataImportInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "库位代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string LocCode { get; set; } |
|||
|
|||
|
|||
[Display(Name = "状态")] |
|||
public int State { get; set; } = 0; |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public class EquipmentPartCodeCheckInput |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 器具代号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//[Display(Name = "型号")]
|
|||
//public string Model { get; set; } = string.Empty;
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "零件代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PartCode { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "标包数")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal StdQty { get; set; } |
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
public class EquipmentPartCodeEditInput : SfsBaseDataCreateOrUpdateInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 器具代号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//[Display(Name = "型号")]
|
|||
//public string Model { get; set; } = string.Empty;
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "零件代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PartCode { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "标包数")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal StdQty { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "单位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Unit { get; set; } |
|||
|
|||
[Display(Name = "状态")] |
|||
public int State { get; set; } = 0; |
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application.Contracts; |
|||
|
|||
[Display(Name = "器具")] |
|||
public class EquipmentPartCodeImportInput : SfsBaseDataImportInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 器具代号
|
|||
/// </summary>
|
|||
[Display(Name = "器具代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Code { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//[Display(Name = "型号")]
|
|||
//public string Model { get; set; } = string.Empty;
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
[Display(Name = "零件代码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PartCode { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "标包数")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal StdQty { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "单位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string Unit { get; set; } |
|||
|
|||
|
|||
[Display(Name = "状态")] |
|||
public int State { get; set; } = 0; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,316 @@ |
|||
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; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
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; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application; |
|||
|
|||
[Authorize] |
|||
[Route($"{BasedataConsts.RootPath}EquipmentLoc")] |
|||
public class EquipmentLocAppService |
|||
: SfsBaseDataWithCodeAppServiceBase<EquipmentLoc, EquipmentLocDTO, SfsBaseDataRequestInputBase, EquipmentLocEditInput, EquipmentLocImportInput> |
|||
, IEquipmentLocAppService |
|||
{ |
|||
//private readonly ItemValidator _itemValidator;
|
|||
private readonly IEquipmentLocManager _manager; |
|||
private new readonly IEquipmentLocRepository _repository; |
|||
private readonly IExportImportService _importService; |
|||
|
|||
public EquipmentLocAppService( |
|||
IEquipmentLocRepository repository, |
|||
IDistributedCache<EquipmentLocDTO> cache, |
|||
IExportImportService importService, |
|||
// ItemValidator itemValidator,
|
|||
IEquipmentLocManager manager) |
|||
: base(repository, cache) |
|||
{ |
|||
_importService=importService; |
|||
_repository = repository; |
|||
//_itemValidator = itemValidator;
|
|||
_manager = manager; |
|||
base.CreatePolicyName = EquipmentPermissions.Create; |
|||
base.UpdatePolicyName = EquipmentPermissions.Update; |
|||
base.DeletePolicyName = EquipmentPermissions.Delete; |
|||
} |
|||
|
|||
[HttpPost("check")] |
|||
//[Authorize(ErpLocationPermissions.Default)]
|
|||
|
|||
public virtual async Task CheckAsync(string code, EquipmentLocCheckInput input) |
|||
{ |
|||
await Task.CompletedTask.ConfigureAwait(false); |
|||
} |
|||
//public override async Task<IActionResult> ImportAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file)
|
|||
//{
|
|||
// List<EquipmentLocErrorDTO> errors = new List<EquipmentLocErrorDTO>();
|
|||
// using var ms = new MemoryStream();
|
|||
// await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
|
|||
// var inputFileBytes = ms.GetAllBytes();
|
|||
// var dtos=_importService.Import<EquipmentLocEditInput>(inputFileBytes).ToList();
|
|||
// var list=ObjectMapper.Map<List<EquipmentLocEditInput>, List<EquipmentLoc>>(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>();
|
|||
|
|||
//[HttpPost("check")]
|
|||
//public virtual async Task CheckAsync(string code, EquipmentLocCheckInput input)
|
|||
//{
|
|||
// var result = new AbpValidationResult();
|
|||
// _itemValidator.CheckFormat(code);
|
|||
// var dto = await GetByCodeAsync(code).ConfigureAwait(false);
|
|||
// var entity = ObjectMapper.Map<EquipmentLocDTO, EquipmentLoc>(dto);
|
|||
// //_itemValidator.CheckCanBuy(entity, input.CanBuy, result);
|
|||
// //_itemValidator.CheckCanMake(entity, input.CanMake, result);
|
|||
// //_itemValidator.CheckStatus(entity, input.Statuses, result);
|
|||
// //_itemValidator.CheckProject(entity, input.Projects, result);
|
|||
// //await _itemValidator.CheckCategoryAsync(entity, input.Categories, result).ConfigureAwait(false);
|
|||
// if (result.Errors.Count > 0)
|
|||
// {
|
|||
// throw new AbpValidationException(result.Errors);
|
|||
// }
|
|||
//}
|
|||
|
|||
///// <summary>
|
|||
///// 检物品状态 是否可用
|
|||
///// </summary>
|
|||
///// <param name="itemCode"></param>
|
|||
///// <returns></returns>
|
|||
///// <exception cref="NotImplementedException"></exception>
|
|||
//[HttpGet("check-item-is-available")]
|
|||
//public virtual async Task<bool> CheckItemIsAvailable(string itemCode)
|
|||
//{
|
|||
// var entity = await _repository.FindAsync(c => c.Code == itemCode).ConfigureAwait(false);
|
|||
|
|||
// if (entity == null)
|
|||
// {
|
|||
// throw new UserFriendlyException($"未找到代码为 {itemCode} 的物品");
|
|||
// }
|
|||
|
|||
// return entity.Status == EnumItemStatus.Active;
|
|||
//}
|
|||
|
|||
/// <summary>
|
|||
/// 检物品状态 是否可用(不查询数据库 直接根据对象判断)
|
|||
/// </summary>
|
|||
/// <param name="EquipmentLocDTO"></param>
|
|||
/// <returns></returns>
|
|||
//[HttpGet("check-item-is-available-no-select-sql")]
|
|||
//public void CheckItemIsAvailable(EquipmentLocDTO EquipmentLocDTO)
|
|||
//{
|
|||
// if (EquipmentLocDTO != null && EquipmentLocDTO.Status != EnumItemStatus.Active)
|
|||
// {
|
|||
// throw new UserFriendlyException($"物料 {EquipmentLocDTO.Code} 状态为 {EquipmentLocDTO.Status} ,不是可用状态");
|
|||
// }
|
|||
//}
|
|||
|
|||
//[HttpGet("{id}")]
|
|||
//public override async Task<EquipmentLocDTO> GetAsync(Guid id)
|
|||
//{
|
|||
// var dto = await base.GetAsync(id).ConfigureAwait(false);
|
|||
|
|||
// dto.ItemCategoryDictionary = await GetItemCategory(dto.Code).ConfigureAwait(false);
|
|||
|
|||
// return dto;
|
|||
//}
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="name"></param>
|
|||
/// <returns></returns>
|
|||
/// <exception cref="NotImplementedException"></exception>
|
|||
//[HttpGet("list-by-name")]
|
|||
//public virtual async Task<List<EquipmentLocDTO>> GetListByNameAsync(string name)
|
|||
//{
|
|||
// var entities = await _repository.GetListAsync(c => c.Name == name).ConfigureAwait(false);
|
|||
// var dtos = ObjectMapper.Map<List<EquipmentLoc>, List<EquipmentLocDTO>>(entities);
|
|||
// return dtos;
|
|||
//}
|
|||
|
|||
//[HttpGet("get-manage-type")]
|
|||
//public virtual async Task<EnumItemManageType> GetManageTypeAsync(string itemCode)
|
|||
//{
|
|||
// var entity = await GetByCodeAsync(itemCode).ConfigureAwait(false);
|
|||
// Check.NotNull(entity, "物品代码", $"物品 {itemCode} 不存在");
|
|||
// return entity.ManageType;
|
|||
//}
|
|||
|
|||
//[HttpGet("get-manage-types")]
|
|||
//public virtual async Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes)
|
|||
//{
|
|||
// var dtos = await GetByCodesAsync(itemCodes).ConfigureAwait(false);
|
|||
// var itemManageTypes = dtos.ToDictionary(dto => dto.Code, dto => dto.ManageType);
|
|||
// return itemManageTypes;
|
|||
//}
|
|||
|
|||
//[HttpPost("get-or-add")]
|
|||
//public virtual async Task<EquipmentLocDTO> GetOrAddAsync(EquipmentLocEditInput input)
|
|||
//{
|
|||
// var result = await _repository.FirstOrDefaultAsync(p => p.Code == input.Code).ConfigureAwait(false);
|
|||
// if (result == null)
|
|||
// {
|
|||
// var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input);
|
|||
// result = await _repository.InsertAsync(entity, true).ConfigureAwait(false);
|
|||
// }
|
|||
|
|||
// var dto = ObjectMapper.Map<EquipmentLoc, EquipmentLocDTO>(result);
|
|||
// return dto;
|
|||
//}
|
|||
|
|||
//[HttpPost("list")]
|
|||
//public override async Task<PagedResultDto<EquipmentLocDTO>> GetPagedListByFilterAsync(
|
|||
// SfsBaseDataRequestInputBase sfsRequestInput,
|
|||
// bool includeDetails = false,
|
|||
// CancellationToken cancellationToken = default)
|
|||
//{
|
|||
// Expression<Func<EquipmentLoc, bool>> expression = sfsRequestInput.Condition.Filters?.Count > 0
|
|||
// ? sfsRequestInput.Condition.Filters.ToLambda<EquipmentLoc>()
|
|||
// : p => true;
|
|||
// var pageResult = await GetPagedListAsync(
|
|||
// expression,
|
|||
// sfsRequestInput.SkipCount,
|
|||
// sfsRequestInput.MaxResultCount,
|
|||
// sfsRequestInput.Sorting,
|
|||
// includeDetails,
|
|||
// cancellationToken).ConfigureAwait(false);
|
|||
|
|||
// foreach (var item in pageResult.Items)
|
|||
// {
|
|||
// item.ItemCategoryDictionary = await GetItemCategory(item.Code).ConfigureAwait(false);
|
|||
// }
|
|||
|
|||
// return pageResult;
|
|||
//}
|
|||
|
|||
//[HttpPost("upsert")]
|
|||
//public virtual async Task UpsertAsync(EquipmentLocEditInput input)
|
|||
//{
|
|||
// var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input);
|
|||
// await _repository.UpsertAsync(entity).ConfigureAwait(false);
|
|||
//}
|
|||
//[HttpPost("upsert-interface")]
|
|||
//public virtual async Task UpsertAsyncByInterface(EquipmentLocEditInput input)
|
|||
//{
|
|||
// var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input);
|
|||
// await _repository.UpsertAsyncByInterface(entity).ConfigureAwait(false);
|
|||
//}
|
|||
|
|||
//protected override Expression<Func<EquipmentLoc, bool>> BuildSearchExpression(string keyWord)
|
|||
//{
|
|||
// Expression<Func<EquipmentLoc, bool>> expression = p =>
|
|||
// p.Code.Contains(keyWord)
|
|||
// || p.Name.Contains(keyWord)
|
|||
// || p.Desc1.Contains(keyWord)
|
|||
// || p.Desc2.Contains(keyWord)
|
|||
// || p.AbcClass.Contains(keyWord)
|
|||
// || p.BasicUom.Contains(keyWord)
|
|||
// || p.Elevel.Contains(keyWord)
|
|||
// || p.Project.Contains(keyWord)
|
|||
// || p.Version.Contains(keyWord);
|
|||
// return expression;
|
|||
//}
|
|||
|
|||
//private async Task<Dictionary<string, string>> GetItemCategory(string itemCode)
|
|||
//{
|
|||
// // var itemCategorys = await this._itemCategoryApp.GetListByItemCode(itemCode).ConfigureAwait(false);
|
|||
|
|||
// // return itemCategorys.ToDictionary(x => x.CategoryCode, y => y.Value);
|
|||
//}
|
|||
|
|||
[HttpPost("upsert")] |
|||
|
|||
public virtual async Task UpsertAsync(EquipmentLocEditInput input) |
|||
{ |
|||
var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input); |
|||
|
|||
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("")] |
|||
public override async Task<EquipmentLocDTO> CreateAsync(EquipmentLocEditInput input) |
|||
{ |
|||
var first= _repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); |
|||
if (first == null) |
|||
{ |
|||
var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input); |
|||
//entity.Code = string.Format("{0}{1}",entity.Code);
|
|||
|
|||
|
|||
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
|||
var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); |
|||
return ObjectMapper.Map<EquipmentLoc,EquipmentLocDTO>(entity1); |
|||
} |
|||
else |
|||
{ |
|||
throw new UserFriendlyException($"已存在器具编号{input.Code}!"); |
|||
} |
|||
|
|||
} |
|||
[HttpPost] |
|||
[Route("GetEquipmentLocs")] |
|||
public async Task<List<EquipmentLocDTO>> GetEquipmentLocAsync(List<string> p_ls) |
|||
{ |
|||
var query=await _repository.GetQueryableAsync().ConfigureAwait(false); |
|||
var list =query.Where(p => p_ls.Contains(p.Code)); |
|||
return ObjectMapper.Map< List<EquipmentLoc> ,List<EquipmentLocDTO>>(list.ToList()); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application; |
|||
|
|||
public partial class BasedataApplicationAutoMapperProfile : Profile |
|||
{ |
|||
private void EquipmentLocAutoMapperProfile() |
|||
{ |
|||
CreateMap<EquipmentLoc, EquipmentLocDTO>() |
|||
|
|||
.ReverseMap(); |
|||
|
|||
CreateMap<EquipmentLocImportInput, EquipmentLoc>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ExtraProperties) |
|||
.Ignore(x => x.ConcurrencyStamp) |
|||
.Ignore(x=>x.State) |
|||
.ForMember(p =>p.Code, p => p.MapFrom(q =>q.Code)) ; |
|||
|
|||
//CreateMap<EquipmentLoc, EquipmentLocImportInput>()
|
|||
|
|||
//CreateMap<EquipmentLoc, EquipmentLocForDongyangExportDTO>()
|
|||
// .Ignore(x => x.ItemCategory)
|
|||
// .Ignore(x => x.Color);
|
|||
CreateMap<EquipmentLocEditInput, EquipmentLoc>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
|||
} |
|||
} |
@ -0,0 +1,319 @@ |
|||
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; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.ObjectMapping; |
|||
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; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application; |
|||
|
|||
[Authorize] |
|||
[Route($"{BasedataConsts.RootPath}EquipmentPartCode")] |
|||
public class EquipmentPartCodeAppService |
|||
: SfsBaseDataWithCodeAppServiceBase<EquipmentPartCode, EquipmentPartCodeDTO, SfsBaseDataRequestInputBase, EquipmentPartCodeEditInput, EquipmentPartCodeImportInput> |
|||
, IEquipmentPartCodeAppService |
|||
{ |
|||
//private readonly ItemValidator _itemValidator;
|
|||
private readonly IEquipmentPartCodeManager _manager; |
|||
private new readonly IEquipmentPartCodeRepository _repository; |
|||
private readonly IExportImportService _importService; |
|||
|
|||
public EquipmentPartCodeAppService( |
|||
IEquipmentPartCodeRepository repository, |
|||
IDistributedCache<EquipmentPartCodeDTO> cache, |
|||
IExportImportService importService, |
|||
|
|||
IEquipmentPartCodeManager manager) |
|||
: base(repository, cache) |
|||
{ |
|||
_importService=importService; |
|||
_repository = repository; |
|||
_manager = manager; |
|||
base.CreatePolicyName = EquipmentPermissions.Create; |
|||
base.UpdatePolicyName = EquipmentPermissions.Update; |
|||
base.DeletePolicyName = EquipmentPermissions.Delete; |
|||
} |
|||
|
|||
[HttpPost("check")] |
|||
//[Authorize(ErpLocationPermissions.Default)]
|
|||
|
|||
public virtual async Task CheckAsync(string code, EquipmentPartCodeCheckInput input) |
|||
{ |
|||
await Task.CompletedTask.ConfigureAwait(false); |
|||
} |
|||
//public override async Task<IActionResult> ImportAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file)
|
|||
//{
|
|||
// List<EquipmentPartCodeErrorDTO> errors = new List<EquipmentPartCodeErrorDTO>();
|
|||
// using var ms = new MemoryStream();
|
|||
// await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
|
|||
// var inputFileBytes = ms.GetAllBytes();
|
|||
// var dtos=_importService.Import<EquipmentPartCodeEditInput>(inputFileBytes).ToList();
|
|||
// var list=ObjectMapper.Map<List<EquipmentPartCodeEditInput>, List<EquipmentPartCode>>(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>();
|
|||
|
|||
//[HttpPost("check")]
|
|||
//public virtual async Task CheckAsync(string code, EquipmentPartCodeCheckInput input)
|
|||
//{
|
|||
// var result = new AbpValidationResult();
|
|||
// _itemValidator.CheckFormat(code);
|
|||
// var dto = await GetByCodeAsync(code).ConfigureAwait(false);
|
|||
// var entity = ObjectMapper.Map<EquipmentPartCodeDTO, EquipmentPartCode>(dto);
|
|||
// //_itemValidator.CheckCanBuy(entity, input.CanBuy, result);
|
|||
// //_itemValidator.CheckCanMake(entity, input.CanMake, result);
|
|||
// //_itemValidator.CheckStatus(entity, input.Statuses, result);
|
|||
// //_itemValidator.CheckProject(entity, input.Projects, result);
|
|||
// //await _itemValidator.CheckCategoryAsync(entity, input.Categories, result).ConfigureAwait(false);
|
|||
// if (result.Errors.Count > 0)
|
|||
// {
|
|||
// throw new AbpValidationException(result.Errors);
|
|||
// }
|
|||
//}
|
|||
|
|||
///// <summary>
|
|||
///// 检物品状态 是否可用
|
|||
///// </summary>
|
|||
///// <param name="itemCode"></param>
|
|||
///// <returns></returns>
|
|||
///// <exception cref="NotImplementedException"></exception>
|
|||
//[HttpGet("check-item-is-available")]
|
|||
//public virtual async Task<bool> CheckItemIsAvailable(string itemCode)
|
|||
//{
|
|||
// var entity = await _repository.FindAsync(c => c.Code == itemCode).ConfigureAwait(false);
|
|||
|
|||
// if (entity == null)
|
|||
// {
|
|||
// throw new UserFriendlyException($"未找到代码为 {itemCode} 的物品");
|
|||
// }
|
|||
|
|||
// return entity.Status == EnumItemStatus.Active;
|
|||
//}
|
|||
|
|||
/// <summary>
|
|||
/// 检物品状态 是否可用(不查询数据库 直接根据对象判断)
|
|||
/// </summary>
|
|||
/// <param name="EquipmentPartCodeDTO"></param>
|
|||
/// <returns></returns>
|
|||
//[HttpGet("check-item-is-available-no-select-sql")]
|
|||
//public void CheckItemIsAvailable(EquipmentPartCodeDTO EquipmentPartCodeDTO)
|
|||
//{
|
|||
// if (EquipmentPartCodeDTO != null && EquipmentPartCodeDTO.Status != EnumItemStatus.Active)
|
|||
// {
|
|||
// throw new UserFriendlyException($"物料 {EquipmentPartCodeDTO.Code} 状态为 {EquipmentPartCodeDTO.Status} ,不是可用状态");
|
|||
// }
|
|||
//}
|
|||
|
|||
//[HttpGet("{id}")]
|
|||
//public override async Task<EquipmentPartCodeDTO> GetAsync(Guid id)
|
|||
//{
|
|||
// var dto = await base.GetAsync(id).ConfigureAwait(false);
|
|||
|
|||
// dto.ItemCategoryDictionary = await GetItemCategory(dto.Code).ConfigureAwait(false);
|
|||
|
|||
// return dto;
|
|||
//}
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="name"></param>
|
|||
/// <returns></returns>
|
|||
/// <exception cref="NotImplementedException"></exception>
|
|||
//[HttpGet("list-by-name")]
|
|||
//public virtual async Task<List<EquipmentPartCodeDTO>> GetListByNameAsync(string name)
|
|||
//{
|
|||
// var entities = await _repository.GetListAsync(c => c.Name == name).ConfigureAwait(false);
|
|||
// var dtos = ObjectMapper.Map<List<EquipmentPartCode>, List<EquipmentPartCodeDTO>>(entities);
|
|||
// return dtos;
|
|||
//}
|
|||
|
|||
//[HttpGet("get-manage-type")]
|
|||
//public virtual async Task<EnumItemManageType> GetManageTypeAsync(string itemCode)
|
|||
//{
|
|||
// var entity = await GetByCodeAsync(itemCode).ConfigureAwait(false);
|
|||
// Check.NotNull(entity, "物品代码", $"物品 {itemCode} 不存在");
|
|||
// return entity.ManageType;
|
|||
//}
|
|||
|
|||
//[HttpGet("get-manage-types")]
|
|||
//public virtual async Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes)
|
|||
//{
|
|||
// var dtos = await GetByCodesAsync(itemCodes).ConfigureAwait(false);
|
|||
// var itemManageTypes = dtos.ToDictionary(dto => dto.Code, dto => dto.ManageType);
|
|||
// return itemManageTypes;
|
|||
//}
|
|||
|
|||
//[HttpPost("get-or-add")]
|
|||
//public virtual async Task<EquipmentPartCodeDTO> GetOrAddAsync(EquipmentPartCodeEditInput input)
|
|||
//{
|
|||
// var result = await _repository.FirstOrDefaultAsync(p => p.Code == input.Code).ConfigureAwait(false);
|
|||
// if (result == null)
|
|||
// {
|
|||
// var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input);
|
|||
// result = await _repository.InsertAsync(entity, true).ConfigureAwait(false);
|
|||
// }
|
|||
|
|||
// var dto = ObjectMapper.Map<EquipmentPartCode, EquipmentPartCodeDTO>(result);
|
|||
// return dto;
|
|||
//}
|
|||
|
|||
//[HttpPost("list")]
|
|||
//public override async Task<PagedResultDto<EquipmentPartCodeDTO>> GetPagedListByFilterAsync(
|
|||
// SfsBaseDataRequestInputBase sfsRequestInput,
|
|||
// bool includeDetails = false,
|
|||
// CancellationToken cancellationToken = default)
|
|||
//{
|
|||
// Expression<Func<EquipmentPartCode, bool>> expression = sfsRequestInput.Condition.Filters?.Count > 0
|
|||
// ? sfsRequestInput.Condition.Filters.ToLambda<EquipmentPartCode>()
|
|||
// : p => true;
|
|||
// var pageResult = await GetPagedListAsync(
|
|||
// expression,
|
|||
// sfsRequestInput.SkipCount,
|
|||
// sfsRequestInput.MaxResultCount,
|
|||
// sfsRequestInput.Sorting,
|
|||
// includeDetails,
|
|||
// cancellationToken).ConfigureAwait(false);
|
|||
|
|||
// foreach (var item in pageResult.Items)
|
|||
// {
|
|||
// item.ItemCategoryDictionary = await GetItemCategory(item.Code).ConfigureAwait(false);
|
|||
// }
|
|||
|
|||
// return pageResult;
|
|||
//}
|
|||
|
|||
//[HttpPost("upsert")]
|
|||
//public virtual async Task UpsertAsync(EquipmentPartCodeEditInput input)
|
|||
//{
|
|||
// var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input);
|
|||
// await _repository.UpsertAsync(entity).ConfigureAwait(false);
|
|||
//}
|
|||
//[HttpPost("upsert-interface")]
|
|||
//public virtual async Task UpsertAsyncByInterface(EquipmentPartCodeEditInput input)
|
|||
//{
|
|||
// var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input);
|
|||
// await _repository.UpsertAsyncByInterface(entity).ConfigureAwait(false);
|
|||
//}
|
|||
|
|||
//protected override Expression<Func<EquipmentPartCode, bool>> BuildSearchExpression(string keyWord)
|
|||
//{
|
|||
// Expression<Func<EquipmentPartCode, bool>> expression = p =>
|
|||
// p.Code.Contains(keyWord)
|
|||
// || p.Name.Contains(keyWord)
|
|||
// || p.Desc1.Contains(keyWord)
|
|||
// || p.Desc2.Contains(keyWord)
|
|||
// || p.AbcClass.Contains(keyWord)
|
|||
// || p.BasicUom.Contains(keyWord)
|
|||
// || p.Elevel.Contains(keyWord)
|
|||
// || p.Project.Contains(keyWord)
|
|||
// || p.Version.Contains(keyWord);
|
|||
// return expression;
|
|||
//}
|
|||
|
|||
//private async Task<Dictionary<string, string>> GetItemCategory(string itemCode)
|
|||
//{
|
|||
// // var itemCategorys = await this._itemCategoryApp.GetListByItemCode(itemCode).ConfigureAwait(false);
|
|||
|
|||
// // return itemCategorys.ToDictionary(x => x.CategoryCode, y => y.Value);
|
|||
//}
|
|||
|
|||
[HttpPost("upsert")] |
|||
|
|||
public virtual async Task UpsertAsync(EquipmentPartCodeEditInput input) |
|||
{ |
|||
var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input); |
|||
|
|||
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("")] |
|||
public override async Task<EquipmentPartCodeDTO> CreateAsync(EquipmentPartCodeEditInput input) |
|||
{ |
|||
var first= _repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); |
|||
if (first == null) |
|||
{ |
|||
var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input); |
|||
|
|||
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
|||
var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); |
|||
return ObjectMapper.Map<EquipmentPartCode,EquipmentPartCodeDTO>(entity1); |
|||
} |
|||
else |
|||
{ |
|||
throw new UserFriendlyException($"已存在器具编号{input.Code}!"); |
|||
} |
|||
|
|||
} |
|||
[HttpPost] |
|||
[Route("GetEquipmentPartCodes")] |
|||
public async Task<List<EquipmentPartCodeDTO>> GetEquipmentPartCodesAsync(List<string> p_ls) |
|||
{ |
|||
var query = await _repository.GetQueryableAsync().ConfigureAwait(false); |
|||
var list = query.Where(p => p_ls.Contains(p.Code)); |
|||
|
|||
return ObjectMapper.Map<List<EquipmentPartCode>, List<EquipmentPartCodeDTO>>(list.ToList()); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Application; |
|||
|
|||
public partial class BasedataApplicationAutoMapperProfile : Profile |
|||
{ |
|||
private void EquipmentPartCodeAutoMapperProfile() |
|||
{ |
|||
CreateMap<EquipmentPartCode, EquipmentPartCodeDTO>() |
|||
|
|||
.ReverseMap(); |
|||
|
|||
CreateMap<EquipmentPartCodeImportInput, EquipmentPartCode>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ExtraProperties) |
|||
.Ignore(x => x.ConcurrencyStamp) |
|||
.ForMember(p =>p.Code, p => p.MapFrom(q =>q.Code)) |
|||
|
|||
; |
|||
|
|||
//CreateMap<EquipmentPartCode, EquipmentPartCodeImportInput>()
|
|||
|
|||
//CreateMap<EquipmentPartCode, EquipmentPartCodeForDongyangExportDTO>()
|
|||
// .Ignore(x => x.ItemCategory)
|
|||
// .Ignore(x => x.Color);
|
|||
CreateMap<EquipmentPartCodeEditInput, EquipmentPartCode>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 物品基本信息
|
|||
/// </summary>
|
|||
public class EquipmentLoc : SfsBaseDataAggregateRootBase, IHasCode |
|||
{ |
|||
/// <summary>
|
|||
/// 器具代码
|
|||
/// </summary>
|
|||
public string Code { get; set; } |
|||
///// <summary>
|
|||
///// 类型
|
|||
///// </summary>
|
|||
//public EquipmentType Type { get; set; }
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//public EquipmentModel Model { get; set; }
|
|||
/// <summary>
|
|||
/// 库位代码
|
|||
/// </summary>
|
|||
public string LocCode { get; set; } |
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
public int State { get; set; } |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public class EquipmentLocManager : DomainService, IEquipmentLocManager |
|||
{ |
|||
private readonly IEquipmentLocRepository _repository; |
|||
|
|||
public EquipmentLocManager(IEquipmentLocRepository repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 执行导入
|
|||
/// </summary>
|
|||
public virtual async Task ImportDataAsync(List<EquipmentLoc> mergeEntities, List<EquipmentLoc> deleteEntities = null) |
|||
{ |
|||
if (deleteEntities != null && deleteEntities.Count > 0) |
|||
{ |
|||
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
|||
} |
|||
|
|||
await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,44 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 器具基本信息
|
|||
/// </summary>
|
|||
public class EquipmentPartCode : SfsBaseDataAggregateRootBase, IHasCode |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
|||
public string Code { get; set; } |
|||
///// <summary>
|
|||
///// 类型
|
|||
///// </summary>
|
|||
//public EquipmentType Type { get; set; }
|
|||
///// <summary>
|
|||
///// 型号
|
|||
///// </summary>
|
|||
//public EquipmentModel Model { get; set; }
|
|||
/// <summary>
|
|||
/// 库位编号
|
|||
/// </summary>
|
|||
public string PartCode { get; set; } |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public decimal StdQty { get; set; } |
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
public int State { get; set; } |
|||
/// <summary>
|
|||
/// 单位
|
|||
/// </summary>
|
|||
public string Unit { get; set; } |
|||
} |
@ -0,0 +1,29 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public class EquipmentPartCodeManager : DomainService, IEquipmentPartCodeManager |
|||
{ |
|||
private readonly IEquipmentPartCodeRepository _repository; |
|||
|
|||
public EquipmentPartCodeManager(IEquipmentPartCodeRepository repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 执行导入
|
|||
/// </summary>
|
|||
public virtual async Task ImportDataAsync(List<EquipmentPartCode> mergeEntities, List<EquipmentPartCode> deleteEntities = null) |
|||
{ |
|||
if (deleteEntities != null && deleteEntities.Count > 0) |
|||
{ |
|||
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
|||
} |
|||
|
|||
await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.Domain.Services; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public interface IEquipmentLocManager : IDomainService, IBulkImportService<EquipmentLoc> |
|||
{ |
|||
} |
@ -0,0 +1,13 @@ |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public interface IEquipmentLocRepository : ISfsBaseDataRepositoryBase<EquipmentLoc>, ISfsBulkRepositoryBase<EquipmentLoc> |
|||
{ |
|||
public Task UpsertAsync(EquipmentLoc entity); |
|||
|
|||
public Task InsertAutoSaveAsync(EquipmentLoc entity); |
|||
|
|||
public Task UpsertAsyncByInterface(EquipmentLoc entity); |
|||
} |
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.Domain.Services; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public interface IEquipmentPartCodeManager : IDomainService, IBulkImportService<EquipmentPartCode> |
|||
{ |
|||
} |
@ -0,0 +1,13 @@ |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.Domain; |
|||
|
|||
public interface IEquipmentPartCodeRepository : ISfsBaseDataRepositoryBase<EquipmentPartCode>, ISfsBulkRepositoryBase<EquipmentPartCode> |
|||
{ |
|||
public Task UpsertAsync(EquipmentPartCode entity); |
|||
|
|||
public Task InsertAutoSaveAsync(EquipmentPartCode entity); |
|||
|
|||
public Task UpsertAsyncByInterface(EquipmentPartCode entity); |
|||
} |
@ -0,0 +1,40 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.EntityFrameworkCore; |
|||
|
|||
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
|||
|
|||
public static class EquipmentLocDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureEquipmentLoc(this ModelBuilder builder, BasedataModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<EquipmentLoc>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(EquipmentLoc), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsBase(); |
|||
|
|||
//Properties
|
|||
b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
|||
b.Property(q => q.LocCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
|||
|
|||
|
|||
|
|||
//Relations
|
|||
//None
|
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => new { q.Code ,q.LocCode}).IsUnique(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
@ -0,0 +1,54 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
|||
|
|||
public class EquipmentLocEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataDbContext, EquipmentLoc>, IEquipmentLocRepository, ISfsBulkRepositoryBase<EquipmentLoc> |
|||
{ |
|||
public EquipmentLocEfCoreRepository(IDbContextProvider<BasedataDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
public virtual async Task UpsertAsyncByInterface(EquipmentLoc entity) |
|||
{ |
|||
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
|||
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
|||
if (exist == null) |
|||
{ |
|||
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
else |
|||
{ |
|||
exist.State = entity.State; |
|||
|
|||
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
|||
|
|||
} |
|||
} |
|||
public virtual async Task UpsertAsync(EquipmentLoc entity) |
|||
{ |
|||
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
|||
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
|||
if (exist == null) |
|||
{ |
|||
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
else |
|||
{ |
|||
exist.State = entity.State; |
|||
|
|||
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
public virtual async Task InsertAutoSaveAsync(EquipmentLoc entity) |
|||
{ |
|||
_ = await InsertAsync(entity, true, GetCancellationToken()).ConfigureAwait(false); |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.EntityFrameworkCore; |
|||
|
|||
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
|||
|
|||
public static class EquipmentPartCodeDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureEquipmentPartCode(this ModelBuilder builder, BasedataModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<EquipmentPartCode>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(EquipmentPartCode), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsBase(); |
|||
|
|||
//Properties
|
|||
b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
|||
b.Property(q => q.PartCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
|||
|
|||
|
|||
|
|||
//Relations
|
|||
//None
|
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => new { q.Code,q.PartCode }).IsUnique(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 器具编号
|
|||
/// </summary>
|
@ -0,0 +1,68 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Win_in.Sfs.Basedata.Domain; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
|||
|
|||
public class EquipmentPartCodeEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataDbContext, EquipmentPartCode>, IEquipmentPartCodeRepository, ISfsBulkRepositoryBase<EquipmentPartCode> |
|||
{ |
|||
public EquipmentPartCodeEfCoreRepository(IDbContextProvider<BasedataDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
public virtual async Task UpsertAsyncByInterface(EquipmentPartCode entity) |
|||
{ |
|||
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
|||
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code== entity.Code).ConfigureAwait(false); |
|||
if (exist == null) |
|||
{ |
|||
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
else |
|||
{ |
|||
exist.State = entity.State; |
|||
|
|||
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
|||
|
|||
} |
|||
} |
|||
public virtual async Task UpsertAsync(EquipmentPartCode entity) |
|||
{ |
|||
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
|||
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
|||
if (exist == null) |
|||
{ |
|||
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
|||
} |
|||
else |
|||
{ |
|||
exist.State = entity.State; |
|||
|
|||
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
|||
|
|||
} |
|||
|
|||
// var context = await GetDbContextAsync();
|
|||
// await context.SingleMergeAsync(entity, options =>
|
|||
// {
|
|||
// //业务主键,可以是联合主键
|
|||
// options.ColumnPrimaryKeyExpression = c => new
|
|||
// {
|
|||
// c.Code
|
|||
// };
|
|||
// //需要在更新时忽略的属性
|
|||
// options.IgnoreOnMergeUpdateExpression = c => new
|
|||
// {
|
|||
// c.Id,
|
|||
// c.ManageType,
|
|||
// };
|
|||
// });
|
|||
} |
|||
|
|||
public virtual async Task InsertAutoSaveAsync(EquipmentPartCode entity) |
|||
{ |
|||
_ = await InsertAsync(entity, true, GetCancellationToken()).ConfigureAwait(false); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
|||
public enum EnumEquipmentType |
|||
{ |
|||
[Display(Name = "小")] |
|||
Small =0, |
|||
[Display(Name = "大")] |
|||
Large =1, |
|||
[Display(Name = "超大")] |
|||
Oversized =2 |
|||
} |
|||
|
|||
public enum EnumEquipmentModel |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 内部
|
|||
/// </summary>
|
|||
[Display(Name = "内部")] |
|||
Internal = 0, |
|||
|
|||
/// <summary>
|
|||
/// 外部
|
|||
/// </summary>
|
|||
[Display(Name = "外部")] |
|||
External = 1, |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Statuses; |
|||
public enum EnumEquipmentRecordType |
|||
{ |
|||
Bind=0, |
|||
UnBind=1 |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
|
|||
public class EquipmentLocCap:SfsAggregateRootBase |
|||
{ |
|||
/// <summary>
|
|||
/// 器具编码
|
|||
/// </summary>
|
|||
public string EqptCode { get; set; } |
|||
/// <summary>
|
|||
/// 零件号
|
|||
/// </summary>
|
|||
public string PartCode { get; set; } |
|||
/// <summary>
|
|||
/// 占用百分比
|
|||
/// </summary>
|
|||
public decimal Percent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 录入数量
|
|||
/// </summary>
|
|||
public decimal Qty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
public decimal StdQty { get; set; } |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Services; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public class EquipmentLocCapManager : DomainService, IEquipmentLocCapManager |
|||
{ |
|||
private readonly IEquipmentRecordRepository _repository; |
|||
|
|||
|
|||
public EquipmentLocCapManager(IEquipmentRecordRepository repository |
|||
|
|||
) |
|||
{ |
|||
_repository = repository; |
|||
|
|||
} |
|||
|
|||
|
|||
public Task ImportDataAsync(List<EquipmentRecord> entities, List<EquipmentRecord> deleteEntities = null) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public Task ImportDataAsync(List<EquipmentLocCap> entities, List<EquipmentLocCap> deleteEntities = null) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
private async Task SetDetailAsync(List<PurchaseOrderDetail> details) |
|||
{ |
|||
|
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface IEquipmentLocCapManager : IBulkImportService<EquipmentLocCap> |
|||
{ |
|||
//Task OpenDetailAsync(Guid id, Guid detailId);
|
|||
//Task CloseDetailAsync(Guid id, Guid detailId);
|
|||
//Task<bool> CheckIsCloseAsync(string number, string supplierCode, string itemCode);
|
|||
} |
@ -0,0 +1,10 @@ |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface IEquipmentLocCapRepository : ISfsStoreRepositoryBase<EquipmentLocCap>, ISfsBulkRepositoryBase<EquipmentLocCap> |
|||
{ |
|||
Task UpsertAsync(EquipmentLocCap newData); |
|||
} |
@ -1,13 +1,16 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Basedata.Equipments.DTOs; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface IEquipmentRecordManager :IBulkImportService<EquipmentRecord> |
|||
public interface IEquipmentRecordManager : IBulkImportService<EquipmentRecord> |
|||
{ |
|||
//Task OpenDetailAsync(Guid id, Guid detailId);
|
|||
//Task CloseDetailAsync(Guid id, Guid detailId);
|
|||
//Task<bool> CheckIsCloseAsync(string number, string supplierCode, string itemCode);
|
|||
Task<List<EquipmentRecordErrorDTO>> Bind(List<EquipmentRecord> p_ls); |
|||
Task<List<EquipmentRecordErrorDTO>> UnBind(List<EquipmentRecord> p_ls); |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,32 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
|||
|
|||
public static class EquipmentLocCapDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureEquipmentLocCap(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<EquipmentLocCap>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(EquipmentLocCap), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsStoreBase(); |
|||
|
|||
b.Property(q => q.EqptCode).HasMaxLength(SfsPropertyConst.CodeLength); |
|||
|
|||
b.Property(q => q.PartCode).HasMaxLength(SfsPropertyConst.CodeLength); |
|||
|
|||
b.HasIndex(q => new { q.EqptCode }); |
|||
|
|||
}); |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
using Win_in.Sfs.Wms.Store.Equipments; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
|||
|
|||
public class EquipmentLocCapEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, EquipmentLocCap>, IEquipmentLocCapRepository, ISfsBulkRepositoryBase<EquipmentLocCap> |
|||
{ |
|||
public EquipmentLocCapEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
|
|||
|
|||
public Task UpsertAsync(EquipmentLocCap newData) |
|||
{ |
|||
throw new System.NotImplementedException(); |
|||
} |
|||
} |
Loading…
Reference in new issue