25 changed files with 896 additions and 24 deletions
@ -0,0 +1,53 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
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.Wms.Store.Application.Contracts; |
||||
|
[Display(Name = "器具操作")] |
||||
|
public class EquipmentRecordDTO : SfsBasicDTOBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具编码")] |
||||
|
public string EqptCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 条码编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "条码编号")] |
||||
|
public string BarCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 批次
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "批次")] |
||||
|
public string Batch { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位")] |
||||
|
public string LocCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 记录类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "记录类型")] |
||||
|
public int Type { get; set; } |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Equipments; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public static class EquipmentRecordPermissions |
||||
|
{ |
||||
|
|
||||
|
public const string Default = StorePermissions.GroupName + "." + nameof(PurchaseOrder); |
||||
|
public const string Create = Default + "." + StorePermissions.CreateStr; |
||||
|
public const string Update = Default + "." + StorePermissions.UpdateStr; |
||||
|
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
||||
|
|
||||
|
public static void AddEquipmentRecordPermission(this PermissionGroupDefinition permissionGroup) |
||||
|
{ |
||||
|
var purchaseOrderPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(EquipmentRecord))); |
||||
|
purchaseOrderPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
||||
|
purchaseOrderPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
||||
|
purchaseOrderPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public interface IEquipmentRecordAppService |
||||
|
: |
||||
|
// ,ISfsStoreMasterAppServiceBase<EquipmentRecordDTO, SfsStoreRequestInputBase, EquipmentRecordEditInput, EquipmentRecordDTO, SfsStoreRequestInputBase>
|
||||
|
ISfsCheckStatusAppService |
||||
|
, ISfsUpsertAppService<EquipmentRecordEditInput> |
||||
|
{ |
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 打开订单明细
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//Task OpenDetailAsync(Guid id, Guid detailId);
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 关闭订单明细
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//Task CloseDetailAsync(Guid id, Guid detailId);
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 更新订单明细
|
||||
|
///// </summary>
|
||||
|
///// <param name="number"></param>
|
||||
|
///// <param name="input"></param>
|
||||
|
///// <returns></returns>
|
||||
|
//Task UpdateDetailsAsync(string number,List<PurchaseOrderDetailUpdateInput> input);
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 【批量创建】到货通知 (收货单)
|
||||
|
///// </summary>
|
||||
|
///// <param name="inputs"></param>
|
||||
|
///// <returns></returns>
|
||||
|
//Task<List<PurchaseOrderDTO>> CreateManyAsync(List<PurchaseOrderEditInput> inputs);
|
||||
|
|
||||
|
//Task<List<PurchaseOrderDTO>> GetListBySupplierCodeAsync(string supplierCode, string itemCode);
|
||||
|
//Task<List<string>> GetNoPoBillList(List<string> poBillNo);
|
||||
|
//Task<PurchaseOrderDTO> CreateOrUpdateAsync(PurchaseOrderEditInput input);
|
||||
|
} |
@ -0,0 +1,57 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
[Display(Name = "器具操作")] |
||||
|
public class EquipmentRecordEditInput |
||||
|
: SfsStoreCreateOrUpdateInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具编码")] |
||||
|
public string EqptCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 条码编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "条码编号")] |
||||
|
public string BarCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 批次
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "批次")] |
||||
|
public string Batch { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位")] |
||||
|
public string LocCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 记录类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "记录类型")] |
||||
|
public int Type { get; set; } |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,53 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
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.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
[Display(Name = "器具操作")] |
||||
|
public class EquipmentRecordImportInput : SfsStoreImportInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具编码")] |
||||
|
public string EqptCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 条码编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "条码编号")] |
||||
|
public string BarCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 批次
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "批次")] |
||||
|
public string Batch { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位")] |
||||
|
public string LocCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 记录类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "记录类型")] |
||||
|
public int Type { get; set; } |
||||
|
} |
@ -0,0 +1,159 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Castle.Components.DictionaryAdapter; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.ObjectMapping; |
||||
|
using Win_in.Sfs.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Equipments; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{StoreConsts.RootPath}Equipment")] |
||||
|
public class EquipmentRecordAppService |
||||
|
: SfsStoreAppServiceBase<EquipmentRecord, EquipmentRecordDTO, SfsStoreRequestInputBase, EquipmentRecordEditInput, |
||||
|
ExchangeDataImportInput> |
||||
|
, IEquipmentRecordAppService |
||||
|
|
||||
|
{ |
||||
|
private readonly IEquipmentRecordManager _manager; |
||||
|
private readonly IEquipmentRecordRepository _repository; |
||||
|
|
||||
|
public EquipmentRecordAppService( |
||||
|
IEquipmentRecordRepository repository, IEquipmentRecordManager manager |
||||
|
):base(repository) |
||||
|
{ |
||||
|
base.CreatePolicyName = EquipmentRecordPermissions.Create; |
||||
|
base.UpdatePolicyName = EquipmentRecordPermissions.Update; |
||||
|
base.DeletePolicyName = EquipmentRecordPermissions.Delete; |
||||
|
|
||||
|
_manager = manager; |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public Task CheckStatusAsync(string number) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
public Task UpsertAsync(EquipmentRecordEditInput input) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
//[HttpGet("by-batchsize")]
|
||||
|
//public virtual async Task<List<EquipmentRecordDTO>> GetToBeProcessedListAsync(int batchSize)
|
||||
|
//{
|
||||
|
// var entities = await _manager.GetToBeProcessedListAsync(batchSize).ConfigureAwait(false);
|
||||
|
// var dtos = ObjectMapper.Map<List<EquipmentRecord>, List<EquipmentRecordDTO>>(entities);
|
||||
|
// return dtos;
|
||||
|
//}
|
||||
|
|
||||
|
//[HttpPost("re-send-by-id/{id}")]
|
||||
|
//public virtual async Task<EquipmentRecordDTO> ReSendByNumberAsync(Guid id)
|
||||
|
//{
|
||||
|
// var EquipmentRecordOld = await _repository.GetAsync(id).ConfigureAwait(false);
|
||||
|
// if (EquipmentRecordOld == null)
|
||||
|
// {
|
||||
|
// throw new UserFriendlyException($"未找到ID为【{id.ToString()}】的数据");
|
||||
|
// }
|
||||
|
|
||||
|
// EquipmentRecordOld.Status = EnumEquipmentRecordStatus.Error;
|
||||
|
|
||||
|
// var EquipmentRecordNew = new ExchangeData()
|
||||
|
// {
|
||||
|
// DataAction = exchangeDataOld.DataAction,
|
||||
|
// DataContent = exchangeDataOld.DataContent,
|
||||
|
// DataIdentityCode = exchangeDataOld.DataIdentityCode,
|
||||
|
// DataType = exchangeDataOld.DataType,
|
||||
|
// DestinationSystem = exchangeDataOld.DestinationSystem,
|
||||
|
// EffectiveDate = exchangeDataOld.EffectiveDate,
|
||||
|
// Remark = exchangeDataOld.Remark,
|
||||
|
// SourceSystem = exchangeDataOld.SourceSystem,
|
||||
|
// WriteTime = DateTime.Now,
|
||||
|
// Writer = null,
|
||||
|
// };
|
||||
|
// var entityNew= await _repository.InsertAsync(exchangeDataNew).ConfigureAwait(false);
|
||||
|
|
||||
|
// exchangeDataOld.Remark = $"在【{DateTime.Now}】时,重新生成了新的接口数据:ID为【{entityNew.Id}】";
|
||||
|
// await _repository.UpdateAsync(exchangeDataOld).ConfigureAwait(false);
|
||||
|
|
||||
|
// return new ExchangeDataDTO() { Id = entityNew.Id };
|
||||
|
//}
|
||||
|
|
||||
|
//[HttpPost("by-batchsize-post")]
|
||||
|
//public virtual async Task<List<ExchangeDataDTO>> GetToBeProcessedListPostAsync(int batchSize)
|
||||
|
//{
|
||||
|
// var resultList=new List<ExchangeData>();
|
||||
|
|
||||
|
// var entities = await
|
||||
|
// (await _repository.GetDbSetAsync().ConfigureAwait(false))
|
||||
|
// .Where(p => p.Status == EnumExchangeDataStatus.Unread)
|
||||
|
// .OrderBy(p => p.TyrpNumber)
|
||||
|
// .Take(batchSize)
|
||||
|
// .ToListAsync().ConfigureAwait(false);
|
||||
|
|
||||
|
// foreach (var entity in entities)
|
||||
|
// {
|
||||
|
// entity.Status = EnumExchangeDataStatus.Success;
|
||||
|
// entity.ReadTime = Clock.Now;
|
||||
|
// entity.Reader = "DataExchange.Agent";
|
||||
|
// resultList.Add(await _repository.UpdateAsync(entity).ConfigureAwait(false));
|
||||
|
// }
|
||||
|
|
||||
|
// var dtos = ObjectMapper.Map<List<ExchangeData>, List<ExchangeDataDTO>>(resultList);
|
||||
|
// return dtos;
|
||||
|
//}
|
||||
|
|
||||
|
//[HttpPost("by-batchsize-only-read")]
|
||||
|
//public virtual async Task<List<ExchangeDataDTO>> GetToBeProcessedListOnlyReadAsync(int batchSize)
|
||||
|
//{
|
||||
|
// var entities = await
|
||||
|
// (await _repository.GetDbSetAsync().ConfigureAwait(false))
|
||||
|
// .Where(p => p.Status == EnumExchangeDataStatus.Unread)
|
||||
|
// .OrderBy(p => p.TyrpNumber)
|
||||
|
// .Take(batchSize)
|
||||
|
// .ToListAsync().ConfigureAwait(false);
|
||||
|
|
||||
|
// var dtos = ObjectMapper.Map<List<ExchangeData>, List<ExchangeDataDTO>>(entities);
|
||||
|
// return dtos;
|
||||
|
//}
|
||||
|
|
||||
|
//[HttpPost("update-status-by-id-list")]
|
||||
|
//public virtual async Task<List<ExchangeDataDTO>> UpdateStatusByIdListAsync(List<Guid> list)
|
||||
|
//{
|
||||
|
// List<ExchangeData> listExchangeDatas = new EditableList<ExchangeData>();
|
||||
|
// var resultList = new List<ExchangeData>();
|
||||
|
|
||||
|
// foreach (var id in list)
|
||||
|
// {
|
||||
|
// listExchangeDatas.Add(await _repository.GetAsync(id).ConfigureAwait(false));
|
||||
|
// }
|
||||
|
|
||||
|
// listExchangeDatas.ForEach(p =>
|
||||
|
// {
|
||||
|
// p.Status = EnumExchangeDataStatus.Success;
|
||||
|
// p.ReadTime = Clock.Now;
|
||||
|
// p.Reader = "DataExchange.Agent";
|
||||
|
// });
|
||||
|
|
||||
|
// foreach (var entity in listExchangeDatas)
|
||||
|
// {
|
||||
|
// resultList.Add(await _repository.UpdateAsync(entity).ConfigureAwait(false));
|
||||
|
// }
|
||||
|
|
||||
|
// var dtos = ObjectMapper.Map<List<ExchangeData>, List<ExchangeDataDTO>>(resultList);
|
||||
|
// return dtos;
|
||||
|
//}
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Equipments; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
public partial class StoreApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void EquipmentRecordAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<EquipmentRecord, EquipmentRecordDTO>() |
||||
|
.ReverseMap(); |
||||
|
// CreateMap<ExchangeDataCreateInput, ExchangeData>()
|
||||
|
// .IgnoreAuditedObjectProperties()
|
||||
|
// .Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id)
|
||||
|
// ;
|
||||
|
// CreateMap<ExchangeDataUpdateInput, ExchangeData>()
|
||||
|
// .IgnoreAuditedObjectProperties()
|
||||
|
// .Ignore(x => x.Id) ;
|
||||
|
// ;
|
||||
|
|
||||
|
// CreateMap<ExchangeDataImportInput, ExchangeData>()
|
||||
|
// .IgnoreAuditedObjectProperties()
|
||||
|
// .Ignore(x => x.TenantId)
|
||||
|
// //.Ignore(x => x.Remark)
|
||||
|
// .Ignore(x => x.ExtraProperties)
|
||||
|
// .Ignore(x => x.ConcurrencyStamp)
|
||||
|
// ;
|
||||
|
|
||||
|
// CreateMap<ExchangeData, ExchangeDataImportInput>()
|
||||
|
// .Ignore(x => x.ReportStatus)
|
||||
|
// .Ignore(x => x.ReportReason)
|
||||
|
// ;
|
||||
|
|
||||
|
// CreateMap<ExchangeData, ExchangeDataExportDTO>()
|
||||
|
//;
|
||||
|
} |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
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 EquipmentRecord:SfsAggregateRootBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编码
|
||||
|
/// </summary>
|
||||
|
public string EqptCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 条码编号
|
||||
|
/// </summary>
|
||||
|
public string BarCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 批次
|
||||
|
/// </summary>
|
||||
|
public string Batch { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 库位
|
||||
|
/// </summary>
|
||||
|
public string LocCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
public decimal Qty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 记录类型
|
||||
|
/// </summary>
|
||||
|
public int Type { get; set;} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,112 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class EquipmentRecordDetail : SfsStoreDetailWithQtyEntityBase |
||||
|
//, IHasSupplierPack
|
||||
|
{ |
||||
|
///// <summary>
|
||||
|
///// 订单行
|
||||
|
///// </summary>
|
||||
|
//public string PoLine { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 供应商计量单位
|
||||
|
///// </summary>
|
||||
|
//public string SupplierPackUom { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 供应商计量单位
|
||||
|
///// </summary>
|
||||
|
//public decimal SupplierPackQty { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 转换率
|
||||
|
///// </summary>
|
||||
|
//public decimal ConvertRate { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 是否寄存订单
|
||||
|
///// </summary>
|
||||
|
//public bool IsConsignment { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 订单行状态 0:无效1:有效
|
||||
|
///// </summary>
|
||||
|
//public EnumOrderStatus LineStatus { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// ERP库位
|
||||
|
///// </summary>
|
||||
|
//public string LocationErpCode { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 项目编号
|
||||
|
///// </summary>
|
||||
|
//public string ProjectCode { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 已发货数量
|
||||
|
///// </summary>
|
||||
|
//public decimal ShippedQty { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 已收货数量
|
||||
|
///// </summary>
|
||||
|
//public decimal ReceivedQty { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 已退货数量
|
||||
|
///// </summary>
|
||||
|
//public decimal ReturnedQty { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 已上架数量
|
||||
|
///// </summary>
|
||||
|
//public decimal PutAwayQty { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 筹措员代码
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-筹措员代码")]
|
||||
|
//public string PlanUserCode { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 生产批次
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-生产批次")]
|
||||
|
//public string Lot { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 要求到货时间
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-要求到货时间")]
|
||||
|
//public DateTime PlanArriveDate { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 明细-类型 暂定:备件是B 辅材是F 生产为空
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-类型")]
|
||||
|
//public string Ctype { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 生产时间
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-生产时间")]
|
||||
|
//public DateTime ProduceDate { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 过期时间
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-过期时间")]
|
||||
|
//public DateTime ExpireDate { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 订单备注
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "明细-订单备注")]
|
||||
|
//public string OrderRemark { get; set; }
|
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
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 EquipmentRecordManager : DomainService, IEquipmentRecordManager |
||||
|
{ |
||||
|
private readonly IEquipmentRecordRepository _repository; |
||||
|
//private readonly IPurchaseReceiptNoteManager _purchaseReceiptNoteManager;
|
||||
|
//private readonly ISupplierAppService _supplierApp;
|
||||
|
//private readonly IWarehouseAppService _warehouseApp;
|
||||
|
|
||||
|
public EquipmentRecordManager(IEquipmentRecordRepository repository |
||||
|
//, IPurchaseReceiptNoteManager purchaseReceiptNoteManager
|
||||
|
//, ISupplierAppService supplierApp
|
||||
|
// , IWarehouseAppService warehouseApp
|
||||
|
) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
//_purchaseReceiptNoteManager = purchaseReceiptNoteManager;
|
||||
|
// _supplierApp = supplierApp;
|
||||
|
// _warehouseApp = warehouseApp;
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
///// 打开订单明细
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//public virtual async Task<bool> CheckIsCloseAsync(string number,string supplierCode, string itemCode)
|
||||
|
//{
|
||||
|
// bool result = false;
|
||||
|
// var entitys = await _repository.GetListAsync(p =>p.Number==number && p.Details.Any(y => y.ItemCode == itemCode&&y.LineStatus== EnumOrderStatus.Close) && p.SupplierCode == supplierCode, true).ConfigureAwait(false);
|
||||
|
// if (entitys.Count!=0) result = true;
|
||||
|
// return result;
|
||||
|
//}
|
||||
|
///// <summary>
|
||||
|
///// 打开订单明细
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//public virtual async Task OpenDetailAsync(Guid id, Guid detailId)
|
||||
|
//{
|
||||
|
// var entity = await Repository.GetAsync(id).ConfigureAwait(false);
|
||||
|
// Check.NotNull(entity, EntityClassName);
|
||||
|
// await entity.OpenDetailAsync(detailId).ConfigureAwait(false);
|
||||
|
//}
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 关闭订单明细
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//public virtual async Task CloseDetailAsync(Guid id, Guid detailId)
|
||||
|
//{
|
||||
|
// var entity = await Repository.GetAsync(id).ConfigureAwait(false);
|
||||
|
// Check.NotNull(entity, EntityClassName);
|
||||
|
// await entity.CloseDetailAsync(detailId).ConfigureAwait(false);
|
||||
|
//}
|
||||
|
|
||||
|
//public override async Task<PurchaseOrder> CreateAsync(PurchaseOrder purchaseOrder)
|
||||
|
//{
|
||||
|
// //接收到新的采购订单时,更新无PO收货单的PoNumber
|
||||
|
// //await _purchaseReceiptNoteManager.AppendPoNumberAsync(purchaseOrder).ConfigureAwait(false);
|
||||
|
// purchaseOrder.SetIdAndNumberWithDetails(GuidGenerator, purchaseOrder.Number);
|
||||
|
// //不要用base.create 要不会把number覆盖
|
||||
|
// purchaseOrder = await Repository.InsertAsync(purchaseOrder).ConfigureAwait(false);
|
||||
|
// await PublishCreatedAsync(purchaseOrder).ConfigureAwait(false);
|
||||
|
// return purchaseOrder;
|
||||
|
|
||||
|
//}
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 执行导入
|
||||
|
///// </summary>
|
||||
|
//public virtual async Task ImportDataAsync(List<EquipmentRecord> mergeEntities, List<EquipmentRecord> deleteEntities = null)
|
||||
|
//{
|
||||
|
// //if (deleteEntities != null && deleteEntities.Count > 0)
|
||||
|
// //{
|
||||
|
// // await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
|
||||
|
// //}
|
||||
|
|
||||
|
// //foreach (var entity in mergeEntities)
|
||||
|
// //{
|
||||
|
// // entity.SetIdAndNumberWithDetails(GuidGenerator, await GenerateNumberAsync(nameof(PurchaseOrder), entity.OrderDate).ConfigureAwait(false));
|
||||
|
// //}
|
||||
|
|
||||
|
// //await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false);
|
||||
|
|
||||
|
// //var insertDetails = new List<PurchaseOrderDetail>();
|
||||
|
|
||||
|
// //foreach (var item in mergeEntities)
|
||||
|
// //{
|
||||
|
// // await SetDetailAsync(item.Details).ConfigureAwait(false);
|
||||
|
|
||||
|
// // insertDetails.AddRange(item.Details);
|
||||
|
// //}
|
||||
|
|
||||
|
// // await _repository.BulkInsertAsync(insertDetails).ConfigureAwait(false);
|
||||
|
|
||||
|
//}
|
||||
|
|
||||
|
public Task ImportDataAsync(List<EquipmentRecord> entities, List<EquipmentRecord> deleteEntities = null) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
private async Task SetDetailAsync(List<PurchaseOrderDetail> details) |
||||
|
{ |
||||
|
//foreach (var detail in details)
|
||||
|
//{
|
||||
|
// var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
|
||||
|
// Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在");
|
||||
|
|
||||
|
// if (item != null)
|
||||
|
// {
|
||||
|
// detail.ItemName = item.Name;
|
||||
|
// detail.ItemDesc1 = item.Desc1;
|
||||
|
// detail.ItemDesc2 = item.Desc2;
|
||||
|
// }
|
||||
|
//}
|
||||
|
} |
||||
|
} |
@ -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 IEquipmentRecordManager :IBulkImportService<EquipmentRecord> |
||||
|
{ |
||||
|
//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 IEquipmentRecordRepository : ISfsStoreRepositoryBase<EquipmentRecord>, ISfsBulkRepositoryBase<EquipmentRecord> |
||||
|
{ |
||||
|
Task UpsertAsync(EquipmentRecord newData); |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
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 EquipmentRecordDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureEquipmentRecord(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<EquipmentRecord>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(EquipmentRecord), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsStoreBase(); |
||||
|
|
||||
|
b.Property(q => q.BarCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.Batch).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.EqptCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.LocCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.PartCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.Batch).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//Properties
|
||||
|
//b.Property(q => q.SupplierCode).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
//b.Property(q => q.PoType).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
//b.Property(q => q.OrderStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
|
||||
|
//b.Property(q => q.Version).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
//b.Property(q => q.IsConsignment).HasDefaultValue(false);
|
||||
|
//b.Property(q => q.TaxRate).HasDefaultValue(0);
|
||||
|
//b.Property(q => q.ContactName).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
//b.Property(q => q.ContactPhone).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
//b.Property(q => q.ContactEmail).HasMaxLength(SfsPropertyConst.NameLength);
|
||||
|
|
||||
|
////Relations
|
||||
|
//b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
|
||||
|
|
||||
|
////Indexes
|
||||
|
//b.HasIndex(q => new { q.Number }).IsUnique();
|
||||
|
}); |
||||
|
|
||||
|
//builder.Entity<PurchaseOrderDetail>(b =>
|
||||
|
//{
|
||||
|
// //Configure table & schema name
|
||||
|
// b.ToTable(options.TablePrefix + nameof(PurchaseOrderDetail), options.Schema);
|
||||
|
// //Configure ABP properties
|
||||
|
// b.ConfigureByConvention();
|
||||
|
// //Configure Sfs base properties
|
||||
|
// b.ConfigureSfsStoreBase();
|
||||
|
// //Configure Sfs store detail properties
|
||||
|
// b.ConfigureSfsStoreDetailBase();
|
||||
|
|
||||
|
// //Properties
|
||||
|
// b.Property(q => q.PoLine).HasMaxLength(SfsPropertyConst.CodeLength);
|
||||
|
// b.Property(q => q.LineStatus).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
|
||||
|
// b.Property(q => q.ConvertRate).HasDefaultValue(1);
|
||||
|
// b.Property(q => q.IsConsignment).HasDefaultValue(false);
|
||||
|
// b.Property(q => q.ProjectCode).HasMaxLength(SfsPropertyConst.CodeLength);
|
||||
|
// b.Property(q => q.LocationErpCode).HasMaxLength(SfsPropertyConst.CodeLength);
|
||||
|
|
||||
|
// //Relations
|
||||
|
|
||||
|
// //Indexes
|
||||
|
// b.HasIndex(q => new { q.ItemCode, q.Number, q.PoLine }).IsUnique();
|
||||
|
//});
|
||||
|
} |
||||
|
} |
@ -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 EquipmentRecordEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, EquipmentRecord>, IEquipmentRecordRepository, ISfsBulkRepositoryBase<EquipmentRecord> |
||||
|
{ |
||||
|
public EquipmentRecordEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public Task UpsertAsync(EquipmentRecord newData) |
||||
|
{ |
||||
|
throw new System.NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
Loading…
Reference in new issue