Browse Source

修改 生产线表

dev_DY_CC
郑勃旭 1 year ago
parent
commit
978548b96e
  1. 4
      be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/ProductLineAppService.cs
  2. 46
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/DTOs/ProductionLineDTO.cs
  3. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/IProductionLineAppService.cs
  4. 57
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineEditInput.cs
  5. 58
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineImportInput.cs
  6. 13
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAutoMapperProfile.cs
  7. 16
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs
  8. 52
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/ProductionLines/ProductionLine.cs
  9. 4158
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/20240328061914_Added_First.Designer.cs
  10. 1873
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/20240328061914_Added_First.cs
  11. 4156
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/BasedataDbContextModelSnapshot.cs
  12. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/ProductionLines/ProductionLineDbContextModelCreatingExtensions.cs
  13. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/ProductionLines/ProductionLineEfCoreRepository.cs
  14. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Win_in.Sfs.Basedata.EntityFrameworkCore.csproj
  15. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/IInjectionRequestAppService.cs
  16. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestAppService.cs
  17. 346
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs
  18. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs
  19. 144
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/PreparationPlans/PreparationPlanManager.cs
  20. 26195
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240328035332_Update_2024_03_28_ProductLine.Designer.cs
  21. 801
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240328035332_Update_2024_03_28_ProductLine.cs
  22. 9431
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  23. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InjectionRequestEventHandler.cs
  24. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs
  25. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs
  26. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductionPlanEventHandler.cs

4
be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/ProductLineAppService.cs

@ -55,10 +55,6 @@ public class ProductLineAppService : ApplicationService, IProductLineAppService
Validator.CheckSite(_configuration, entityObj.Site);
Validator.CheckCompany(_configuration, entityObj.Company);
var targetObj = ObjectMapper.Map<ProdLine, ProductionLineEditInput>(entityObj);
//if (targetObj.Type == null) { targetObj.Type = 0; }
if (targetObj.WorkshopCode == null) { targetObj.WorkshopCode = "_"; }
if (targetObj.RawLocationCode == null) { targetObj.RawLocationCode = "_"; }
if (targetObj.ProductLocationCode == null) { targetObj.ProductLocationCode = "_"; }
await _productionLineAppService.UpsertAsync(targetObj).ConfigureAwait(false);

46
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/DTOs/ProductionLineDTO.cs

@ -1,61 +1,51 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Basedata.Application.Contracts;
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[Display(Name = "生产线")]
public class ProductionLineDTO : SfsBaseDataDTOBase, IHasCode, IHasName
{
/// <summary>
/// 编码
/// </summary>
[Display(Name = "编码")]
public string Code { get; set; }
[Display(Name = "编码")] [IgnoreUpdate] public string Code { get; set; }
/// <summary>
/// 名称
/// 名称
/// </summary>
[Display(Name = "名称")]
[Display(Name = "编码")]
public string Name { get; set; }
/// <summary>
/// 描述
/// 描述
/// </summary>
[Display(Name = "描述")]
[Display(Name = "编码")]
public string Description { get; set; }
/// <summary>
/// 类型
/// 类型
/// </summary>
[Display(Name = "类型")]
public EnumProductionLineType Type { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
public string WorkshopCode { get; set; }
/// <summary>
/// 原料库位
/// 原料库位
/// </summary>
[Display(Name = "原料库位")]
public string RawLocationCode { get; set; }
[Display(Name = "原料库位集合")]
public List<string> RawLocationCodeList { get; set; }
/// <summary>
/// 成品库位
/// 成品库位
/// </summary>
[Display(Name = "成品库位")]
public string ProductLocationCode { get; set; }
[Display(Name = "完工库位集合")]
public List<string> ProductLocationCodeList { get; set; }
/// <summary>
/// 原料库位组
/// 线边库位
/// </summary>
[Display(Name = "原料库位组")]
public string RawLocationGroupCode { get; set; }
[Display(Name = "线边库位集合")]
public List<string> WipLocationCodeList { get; set; }
}

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/IProductionLineAppService.cs

@ -8,5 +8,4 @@ public interface IProductionLineAppService
, ISfsGetByCodeAppService<ProductionLineDTO>
, ISfsUpsertAppService<ProductionLineEditInput>
{
Task<ProductionLineDTO> GetByLocationGroupCodeAsync(string locationGroupCode);
}

57
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineEditInput.cs

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -9,63 +11,40 @@ namespace Win_in.Sfs.Basedata.Application.Contracts;
/// </summary>
public class ProductionLineEditInput : SfsBaseDataCreateOrUpdateInputBase
{
#region Base
[Display(Name = "编码")][IgnoreUpdate] public string Code { get; set; }
/// <summary>
/// 名称
/// 名称
/// </summary>
[Display(Name = "名称")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
[Display(Name = "编码")]
public string Name { get; set; }
/// <summary>
/// 描述
/// 描述
/// </summary>
[Display(Name = "描述")]
[StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")]
[Display(Name = "编码")]
public string Description { get; set; }
/// <summary>
/// 类型
/// 类型
/// </summary>
[Display(Name = "类型")]
public EnumProductionLineType Type { get; set; }
/// <summary>
/// 车间
/// 原料库位
/// </summary>
[Display(Name = "车间")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkshopCode { get; set; }
[Display(Name = "原料库位集合")]
public List<string> RawLocationCodeList { get; set; }
/// <summary>
/// 原料库位
/// 成品库位
/// </summary>
[Display(Name = "原料库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RawLocationCode { get; set; }
[Display(Name = "完工库位集合")]
public List<string> ProductLocationCodeList { get; set; }
/// <summary>
/// 成品库位
/// 线边库位
/// </summary>
[Display(Name = "成品库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProductLocationCode { get; set; }
/// <summary>
/// 原料库位组
/// </summary>
[Display(Name = "原料库位组")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RawLocationGroupCode { get; set; }
#endregion
#region Create
[Display(Name = "代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Code { get; set; }
#endregion
[Display(Name = "线边库位集合")]
public List<string> WipLocationCodeList { get; set; }
}

58
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineImportInput.cs

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -10,66 +12,40 @@ namespace Win_in.Sfs.Basedata.Application.Contracts;
[Display(Name = "生产线")]
public class ProductionLineImportInput : SfsBaseDataImportInputBase
{
/// <summary>
/// 生产线代码
/// </summary>
[Key]
[Display(Name = "生产线代码")]
[Required(ErrorMessage = "物品代码是必填项")]
public string Code { get; set; }
[Display(Name = "编码")][IgnoreUpdate] public string Code { get; set; }
/// <summary>
/// 生产线名称
/// 名称
/// </summary>
[Display(Name = "生产线名称")]
[Required(ErrorMessage = "{生产线名称}是必填项")]
[Display(Name = "编码")]
public string Name { get; set; }
/// <summary>
/// 描述
/// 描述
/// </summary>
[Display(Name = "描述")]
[Display(Name = "编码")]
public string Description { get; set; }
/// <summary>
/// 类型
/// 类型
/// </summary>
[Display(Name = "类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumProductionLineType Type { get; set; }
/// <summary>
/// 车间代码
/// </summary>
[Display(Name = "车间代码")]
[Required(ErrorMessage = "{0}是必填项")]
public string WorkshopCode { get; set; }
/// <summary>
/// 原料库位
/// </summary>
[Display(Name = "原料库位")]
[Required(ErrorMessage = "{0}是必填项")]
public string RawLocationCode { get; set; }
/// <summary>
/// 成品库位
/// 原料库位
/// </summary>
[Display(Name = "成品库位")]
[Required(ErrorMessage = "{0}是必填项")]
public string ProductLocationCode { get; set; }
[Display(Name = "原料库位集合")]
public List<string> RawLocationCodeList { get; set; }
/// <summary>
/// 原料库位组
/// 成品库位
/// </summary>
[Display(Name = "原料库位组")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RawLocationGroupCode { get; set; }
[Display(Name = "完工库位集合")]
public List<string> ProductLocationCodeList { get; set; }
/// <summary>
/// 备注
/// 线边库位
/// </summary>
[Display(Name = "备注")]
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Remark { get; set; }
[Display(Name = "线边库位集合")]
public List<string> WipLocationCodeList { get; set; }
}

13
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAutoMapperProfile.cs

@ -13,16 +13,15 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.ReverseMap();
CreateMap<ProductionLineItemImportInput, ProductionLineItem>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
;
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
;
CreateMap<ProductionLineItem, ProductionLineItemImportInput>()
.Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason);
;
}
}

16
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs

@ -41,25 +41,9 @@ public class ProductionLineAppService
}
[HttpPost("upsert")]
public virtual async Task UpsertAsync(ProductionLineEditInput input)
{
var entity = ObjectMapper.Map<ProductionLineEditInput, ProductionLine>(input);
await _repository.UpsertAsync(entity).ConfigureAwait(false);
}
[HttpGet("by-location-group/{locationGroupCode}")]
public virtual async Task<ProductionLineDTO> GetByLocationGroupCodeAsync(string locationGroupCode)
{
var entity = await _repository.FindAsync(p => p.RawLocationGroupCode == locationGroupCode).ConfigureAwait(false);
return ObjectMapper.Map<ProductionLine, ProductionLineDTO>(entity);
}
protected override async Task ValidateImportModelAsync(ProductionLineImportInput importInput, List<ValidationResult> validationRresult)
{
await base.ValidateImportModelAsync(importInput, validationRresult).ConfigureAwait(false);
await base.CheckWorkGroupWorkshopCodeAsync(importInput.WorkshopCode, validationRresult).ConfigureAwait(false);
await base.CheckRawLocationAsync(importInput.RawLocationCode, validationRresult).ConfigureAwait(false);
await base.CheckProductLocationAsync(importInput.ProductLocationCode, validationRresult).ConfigureAwait(false);
}
}

52
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/ProductionLines/ProductionLine.cs

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
@ -6,61 +7,50 @@ using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Basedata.Domain;
/// <summary>
/// 生产线
/// 生产线
/// </summary>
public class ProductionLine : SfsBaseDataAggregateRootBase, IHasCode, IHasName
{
[Display(Name = "编码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
/// <summary>
/// 代码
/// </summary>
[Display(Name = "代码")]
[Key]
[IgnoreUpdate]
public string Code { get; set; }
/// <summary>
/// 名称
/// 名称
/// </summary>
[Display(Name = "编码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
[Display(Name = "名称")]
public string Name { get; set; }
/// <summary>
/// 描述
/// 描述
/// </summary>
[Display(Name = "编码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
[Display(Name = "描述")]
public string Description { get; set; }
/// <summary>
/// 类型
/// 类型
/// </summary>
public EnumProductionLineType Type { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkshopCode { get; set; }
/// <summary>
/// 原料库位
/// 原料库位
/// </summary>
[Display(Name = "原料库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RawLocationCode { get; set; }
[Display(Name = "原料库位Json集合")]
public string RawLocationCodeListJson { get; set; }
/// <summary>
/// 成品库位
/// 成品库位
/// </summary>
[Display(Name = "成品库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProductLocationCode { get; set; }
[Display(Name = "完工库位Json集合")]
public string ProductLocationCodeListJson { get; set; }
/// <summary>
/// 原料库位组
/// 线边库位
/// </summary>
[Display(Name = "原料库位组")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RawLocationGroupCode { get; set; }
[Display(Name = "线边库位Json集合")]
public string WipLocationCodeListJson { get; set; }
}

4158
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/20240328061914_Added_First.Designer.cs

File diff suppressed because it is too large

1873
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/20240328061914_Added_First.cs

File diff suppressed because it is too large

4156
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Migrations/BasedataDbContextModelSnapshot.cs

File diff suppressed because it is too large

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/ProductionLines/ProductionLineDbContextModelCreatingExtensions.cs

@ -20,11 +20,8 @@ public static class ProductionLineDbContextModelCreatingExtensions
b.Property(x => x.Name).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(x => x.Description).HasMaxLength(SfsPropertyConst.DescLength);
b.Property(x => x.Type).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.WorkshopCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RawLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProductLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RawLocationGroupCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
b.HasKey(q => q.Code);
b.HasIndex(x => new { x.Code }).IsUnique();
});

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/ProductionLines/ProductionLineEfCoreRepository.cs

@ -29,7 +29,6 @@ public class ProductionLineEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<Ba
// exist.TenantId = entity.TenantId;
exist.Remark = entity.Remark;
exist.Type = entity.Type;
exist.WorkshopCode = entity.WorkshopCode;
// exist.RawLocation = entity.RawLocation;
// exist.ProductLocation = entity.ProductLocation;
// exist.RawLocationGroupCode = entity.RawLocationGroupCode;

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Win_in.Sfs.Basedata.EntityFrameworkCore.csproj

@ -30,4 +30,8 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/IInjectionRequestAppService.cs

@ -9,27 +9,5 @@ public interface IInjectionRequestAppService
: ISfsStoreRequestMasterAppServiceBase<InjectionRequestDTO, SfsStoreRequestInputBase, InjectionRequestEditInput, InjectionRequestDetailDTO, SfsStoreRequestInputBase>
{
Task<InjectionRequestDTO> CreateAndHandleAsync(InjectionRequestEditInput input);
/// <summary>
/// 根据备料计划生成 叫料请求
/// </summary>
/// <returns></returns>
Task<InjectionRequestDTO> CreateAndHandleByPreparationPlan(string productionPlanNumber);
Task<InjectionRequestDTO> CreateAndHandleByAPIAsync(InjectionRequestEditInput input);
/// <summary>
/// 根据类型获取叫料请求
/// </summary>
/// <param name="requestInput"></param>
/// <param name="type">叫料请求类型</param>
/// <param name="includeDetails"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<PagedResultDto<InjectionRequestDTO>> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
string type, bool includeDetails = false, CancellationToken cancellationToken = default);
Task<List<InjectionRequestDTO>> GetListByTypeAsync(string type);
}

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestAppService.cs

@ -235,20 +235,20 @@ public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<Co
detailInput.RecommendType = EnumRecommendType.None;
}
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
if (productionLineDto != null)
{
detailInput.ProdLine = productionLineDto.Code;
}
//detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
//if (productionLineDto != null)
//{
// detailInput.ProdLine = productionLineDto.Code;
//}
}
var entity = ObjectMapper.Map<CoatingMaterialRequestEditInput, CoatingMaterialRequest>(input);
foreach (var detail in entity.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detail.ToLocationArea = toLocationDto.AreaCode;
detail.ToLocationErpCode = toLocationDto.ErpLocationCode;

346
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs

@ -25,6 +25,7 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
//注塑叫料
[Authorize]
[Route($"{StoreConsts.RootPath}injection-request")]
public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<InjectionRequest, InjectionRequestDTO,
@ -33,15 +34,9 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
IInjectionRequestAppService
{
private readonly IInjectionRequestManager _injectionRequestManager;
private readonly IPreparationPlanManager _preparationPlanManager;
private readonly IItemStoreRelationAppService _itemStoreRelationApp;
private readonly IAreaAppService _areaApp;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionJobAppService _issueJobAppService;
@ -58,7 +53,6 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
: base(repository, injectionRequestManager)
{
_injectionRequestManager = injectionRequestManager;
_preparationPlanManager = preparationPlanManager;
_itemStoreRelationApp = itemStoreRelationApp;
_areaApp = areaApp;
_locationAppService = locationAppService;
@ -67,49 +61,7 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
_issueJobAppService = issueJobAppService;
}
#region 东阳使用
/// <summary>
/// 用来重写 导入数据时可以加工数据
/// </summary>
/// <param name="dictionary"></param>
/// <returns></returns>
protected override async Task<Dictionary<InjectionRequest, EntityState>> ImportProcessingEntityAsync(
Dictionary<InjectionRequest, EntityState> dictionary)
{
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
foreach (var injectionRequest in addList)
{
injectionRequest.Worker = CurrentUser.GetUserName();
injectionRequest.CreatorId = CurrentUser.Id;
if (injectionRequest.Type == EnumTransSubType.Issue_Manual.GetDisplayName())
{
injectionRequest.Type = EnumTransSubType.Issue_Manual.ToString();
}
foreach (var detail in injectionRequest.Details)
{
var locationDto= await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
CheckLocation(locationDto,detail.ToLocationCode);
var itemBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto,detail.ItemCode);
detail.ToLocationArea = locationDto.AreaCode;
detail.ToLocationErpCode = locationDto.ErpLocationCode;
detail.ToLocationGroup = locationDto.LocationGroupCode;
detail.ToWarehouseCode = locationDto.WarehouseCode;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2= itemBasicDto.Desc2;
detail.ItemName= itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
}
}
return dictionary;
}
public override async Task<InjectionRequestDTO> HandleAsync(Guid id)
{
var entity=await _repository.GetAsync(id).ConfigureAwait(false);
@ -117,159 +69,15 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
return ObjectMapper.Map<InjectionRequest, InjectionRequestDTO>(entity);
}
#region 校验
private void CheckItemBasic(ItemBasicDTO ItemBasicDto, string itemCode)
{
if (ItemBasicDto == null)
{
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
}
}
private void CheckLocation(LocationDTO LocationDto, string LocationCode)
{
if (LocationDto == null)
{
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在");
}
if (LocationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
}
#endregion
#endregion
[HttpPost("")]
//[Authorize(InjectionRequestPermissions.Create)]
public override async Task<InjectionRequestDTO> CreateAsync(InjectionRequestEditInput input)
{
foreach (var item in input.Details)
{
if (item.Qty <= 0)
{
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于 0");
}
}
//检验备料计划是否存在要料请求
if (!string.IsNullOrWhiteSpace(input.PreparationPlanNumber))
{
var exist = await CheckExistByPreparationPlanAsync(input.PreparationPlanNumber).ConfigureAwait(false);
if (exist.Count > 0)
{
throw new UserFriendlyException($"{input.PreparationPlanNumber} 备料计划已存在要料申请");
}
}
foreach (var item in input.Details) //赋值生产线
{
var location = await LocationAclService.GetByCodeAsync(item.ToLocationCode).ConfigureAwait(false);
item.ProdLine = location.LocationGroupCode;
input.ProdLine = location.LocationGroupCode;
}
var entity = ObjectMapper.Map<InjectionRequestEditInput, InjectionRequest>(input);
var result = await _injectionRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionRequest, InjectionRequestDTO>(result);
return dto;
}
/// <summary>
/// 创建并且执行叫料请求
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("create-and-handle-api")]
//[Authorize(InjectionRequestPermissions.Create)]
public virtual async Task<InjectionRequestDTO> CreateAndHandleByAPIAsync(InjectionRequestEditInput input)
{
foreach (var item in input.Details)
{
if (item.Qty <= 0)
{
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于 0");
}
}
input.AutoSubmit = true;
input.AutoAgree = true;
input.AutoHandle = true;
input.AutoCompleteJob = false;
input.DirectCreateNote = false;
foreach (var detailInput in input.Details)
{
var toLocationDto= await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode);
detailInput.ItemDesc1 = itemBasicDto.Desc1;
if(detailInput.PositionCode.Contains('W'))
{
detailInput.RecommendType = EnumRecommendType.W;
}
else if(detailInput.PositionCode.Contains('Q'))
{
detailInput.RecommendType = EnumRecommendType.Q;
}
else if(detailInput.PositionCode.Contains('K'))
{
detailInput.RecommendType = EnumRecommendType.K;
}
else
{
detailInput.RecommendType = EnumRecommendType.None;
}
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
if (productionLineDto != null)
{
detailInput.ProdLine = productionLineDto.Code;
}
}
var entity = ObjectMapper.Map<InjectionRequestEditInput, InjectionRequest>(input);
foreach (var detail in entity.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detail.ToLocationArea= toLocationDto.AreaCode;
detail.ToLocationErpCode = toLocationDto.ErpLocationCode;
detail.ToLocationGroup = toLocationDto.LocationGroupCode;
detail.ToWarehouseCode= toLocationDto.WarehouseCode;
}
entity.UseOnTheWayLocation = false;
var result = await _injectionRequestManager.CreateBynNumberAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionRequest, InjectionRequestDTO>(result);
return dto;
return await CreateAndHandleAsync(input).ConfigureAwait(false);
}
/// <summary>
/// 创建并且执行叫料请求
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("create-and-handle")]
//[Authorize(InjectionRequestPermissions.Create)]
public virtual async Task<InjectionRequestDTO> CreateAndHandleAsync(InjectionRequestEditInput input)
private async Task<InjectionRequestDTO> CreateAndHandleAsync(InjectionRequestEditInput input)
{
foreach (var item in input.Details)
{
@ -279,16 +87,6 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
}
}
//检验备料计划是否存在要料请求
if (!string.IsNullOrWhiteSpace(input.PreparationPlanNumber))
{
var exist = await CheckExistByPreparationPlanAsync(input.PreparationPlanNumber).ConfigureAwait(false);
if (exist.Count > 0)
{
throw new UserFriendlyException($"{input.PreparationPlanNumber} 备料计划已存在要料申请");
}
}
foreach (var detailInput in input.Details) //赋值生产线
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
@ -296,10 +94,8 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode);
var location = await LocationAclService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
detailInput.ProdLine = location.LocationGroupCode;
input.ProdLine = location.LocationGroupCode;
input.Worker = input.Worker;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
}
input.AutoSubmit = true;
@ -318,82 +114,63 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
}
/// <summary>
/// 根据备料计划生成 叫料请求
/// 根据类型 获取叫料申请
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpPost("create-and-handle-by-preparation-plan/{number}")]
public virtual async Task<InjectionRequestDTO> CreateAndHandleByPreparationPlan(string number)
[HttpGet("list/by-type/{type}")]
public virtual async Task<List<InjectionRequestDTO>> GetListByTypeAsync(string type)
{
var prodPreparationPlan = await _preparationPlanManager.GetByNumberAsync(number).ConfigureAwait(false);
var injectionRequestCreateInput = new InjectionRequestEditInput { Worker = CurrentUser.GetUserName() };
foreach (var preparationPlanDetail in prodPreparationPlan.Details)
{
var detail = new InjectionRequestDetailInput
{
ItemCode = preparationPlanDetail.ItemCode,
ItemName = preparationPlanDetail.ItemName,
ItemDesc1 = preparationPlanDetail.ItemDesc1,
ItemDesc2 = preparationPlanDetail.ItemDesc2,
Uom = preparationPlanDetail.Uom,
Qty = preparationPlanDetail.Qty,
StdPackQty = preparationPlanDetail.StdPackQty,
ToLocationCode = preparationPlanDetail.ToLocationCode
};
injectionRequestCreateInput.Details.Add(detail);
}
var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
var dto = await CreateAndHandleAsync(injectionRequestCreateInput).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<InjectionRequest>, List<InjectionRequestDTO>>(entities);
return dto;
return dtos;
}
/// <summary>
/// 检验备料计划是否存在要料请求
/// </summary>
/// <param name="preparationPlanNumber"></param>
/// <returns></returns>
private async Task<List<InjectionRequest>> CheckExistByPreparationPlanAsync(string preparationPlanNumber)
{
var entities = await _repository.GetListAsync(c => c.PreparationPlanNumber == preparationPlanNumber)
.ConfigureAwait(false);
return entities;
}
#region 导入
/// <summary>
/// 根据类型获取叫料请求
/// 用来重写 导入数据时可以加工数据
/// </summary>
/// <param name="requestInput"></param>
/// <param name="type">
/// 叫料请求类型:
/// 人工拉动:Issue_Manual;
/// 线边拉动:Issue_WIP;
/// </param>
/// <param name="includeDetails"></param>
/// <param name="cancellationToken"></param>
/// <param name="dictionary"></param>
/// <returns></returns>
[HttpPost("by-type/{type}")]
public virtual async Task<PagedResultDto<InjectionRequestDTO>> GetListByTypeAsync(
SfsStoreRequestInputBase requestInput,
string type,
bool includeDetails = false,
CancellationToken cancellationToken = default)
protected override async Task<Dictionary<InjectionRequest, EntityState>> ImportProcessingEntityAsync(
Dictionary<InjectionRequest, EntityState> dictionary)
{
Expression<Func<InjectionRequest, bool>> expression = p => p.Type == type;
if (requestInput.Condition.Filters?.Count > 0)
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
foreach (var injectionRequest in addList)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<InjectionRequest>());
injectionRequest.Worker = CurrentUser.GetUserName();
injectionRequest.CreatorId = CurrentUser.Id;
if (injectionRequest.Type == EnumTransSubType.Issue_Manual.GetDisplayName())
{
injectionRequest.Type = EnumTransSubType.Issue_Manual.ToString();
}
foreach (var detail in injectionRequest.Details)
{
var locationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
CheckLocation(locationDto, detail.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detail.ItemCode);
detail.ToLocationArea = locationDto.AreaCode;
detail.ToLocationErpCode = locationDto.ErpLocationCode;
detail.ToLocationGroup = locationDto.LocationGroupCode;
detail.ToWarehouseCode = locationDto.WarehouseCode;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
}
}
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
return dictionary;
}
#region 导入
/// <summary>
/// 导入验证
/// </summary>
@ -486,18 +263,29 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
#endregion
/// <summary>
/// 根据类型 获取叫料申请
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet("list/by-type/{type}")]
public virtual async Task<List<InjectionRequestDTO>> GetListByTypeAsync(string type)
#region 校验
private void CheckItemBasic(ItemBasicDTO ItemBasicDto, string itemCode)
{
var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
if (ItemBasicDto == null)
{
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
}
}
var dtos = ObjectMapper.Map<List<InjectionRequest>, List<InjectionRequestDTO>>(entities);
private void CheckLocation(LocationDTO LocationDto, string LocationCode)
{
if (LocationDto == null)
{
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在");
}
return dtos;
if (LocationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
}
#endregion
}

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs

@ -231,20 +231,20 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR
detailInput.RecommendType = EnumRecommendType.None;
}
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
if (productionLineDto != null)
{
detailInput.ProdLine = productionLineDto.Code;
}
//if (productionLineDto != null)
//{
// detailInput.ProdLine = productionLineDto.Code;
//}
}
var entity = ObjectMapper.Map<MaterialRequestEditInput, MaterialRequest>(input);
foreach (var detail in entity.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detail.ToLocationArea= toLocationDto.AreaCode;
detail.ToLocationErpCode = toLocationDto.ErpLocationCode;

144
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/PreparationPlans/PreparationPlanManager.cs

@ -31,78 +31,78 @@ public class PreparationPlanManager : SfsStoreManagerBase<PreparationPlan, Prepa
public virtual async Task<PreparationPlan> CreateFromProductionPlanAsync(ProductionPlan productionPlan)
{
//判断
Check.NotNull(productionPlan, nameof(productionPlan));
var prodLine = productionPlan.ProdLine;
//开始生产计划时,生成备料计划,开关控制
//①根据BOM拆分备料记录:备料计划的数量 = bom的用量 * 生产计划的计划数量
//②bom的父物料号 = 生产计划的Item_code
var preparationPlan = BuildPreparationPlan(productionPlan);
var boms = new List<BomDTO>();
//根据生产计划明细获取一层BOM信息,如果子零件为虚零件则下穿一层
foreach (var productionPlanDetail in productionPlan.Details.Where(productionPlanDetail =>
productionPlanDetail.PlanQty > 0))
{
//获得BOM信息
var productBoms = await _bomAppService.GetPlanListAsync(productionPlanDetail.ItemCode, prodLine).ConfigureAwait(false);
if (productBoms.Count == 0)
{
throw new UserFriendlyException(
$"生成备料计划失败:{productionPlanDetail.ItemCode} 在 {prodLine} 缺少对应的Bom信息!");
}
productBoms.ForEach(p => p.Product = productionPlanDetail.ItemCode);
boms.AddRange(productBoms);
}
var productionLine = await _productionLineAppService.GetByCodeAsync(prodLine).ConfigureAwait(false);
Check.NotNull(productionLine, "生产线代码", $"生产线 {prodLine} 不存在");
var rawLocationCodeOfProductionLine = productionLine.RawLocationCode;
//将BOM按子零件分组
var bomGroupByItemCode = boms.GroupBy(p => p.Component);
foreach (var bomGroup in bomGroupByItemCode)
{
var itemCode = bomGroup.Key;
var item = await ItemBasicAppService.GetByCodeAsync(itemCode).ConfigureAwait(false);
Check.NotNull(item, "物品代码", $"物品 {itemCode} 不存在");
//成品零件号
var productItemCode = bomGroup.First().Product;
//取整方式
var trunkType = bomGroup.First().TruncType;
//计量单位
var uom = bomGroup.First().ComponentUom;
//子零件的BOM用量为各个BOM用量的汇总
var bomGroupQty = bomGroup.Sum(p => p.ComponentQty);
//从生产计划明细中获得
var planQty = productionPlan.Details.First(p => p.ItemCode == productItemCode).PlanQty;
//实际需求量为成品计划生产量 * 汇总BOM用
var sumQty = planQty * bomGroupQty;
//获取标包数量,计算备料数量
var (stdPackQty, detailQty) = await CalcDetailQtyAsync(sumQty, item.StdPackQty, trunkType).ConfigureAwait(false);
//TODO 从物料存储关系中根据 库位组 = 生产线代码 查找是一个预定假设,需要改成可配置的
//从物料存储关系中查找 库位组 = 生产线代码 的库位
var locationCodeFromItemStoreRelation =
await GetFirstLocationFromItemStoreRelationAsync(prodLine, itemCode).ConfigureAwait(false);
//备料的物料没有物料存储关系,则目标库位取生产线的原料库位
var locationCode = string.IsNullOrEmpty(locationCodeFromItemStoreRelation)
? rawLocationCodeOfProductionLine
: locationCodeFromItemStoreRelation;
//构造备料计划明细
var detail = BuildPreparationPlanDetail(item, detailQty, stdPackQty, locationCode);
preparationPlan.Details.Add(detail);
}
await CreateAsync(preparationPlan).ConfigureAwait(false);
return preparationPlan;
////判断
//Check.NotNull(productionPlan, nameof(productionPlan));
//var prodLine = productionPlan.ProdLine;
////开始生产计划时,生成备料计划,开关控制
////①根据BOM拆分备料记录:备料计划的数量 = bom的用量 * 生产计划的计划数量
////②bom的父物料号 = 生产计划的Item_code
//var preparationPlan = BuildPreparationPlan(productionPlan);
//var boms = new List<BomDTO>();
////根据生产计划明细获取一层BOM信息,如果子零件为虚零件则下穿一层
//foreach (var productionPlanDetail in productionPlan.Details.Where(productionPlanDetail =>
// productionPlanDetail.PlanQty > 0))
//{
// //获得BOM信息
// var productBoms = await _bomAppService.GetPlanListAsync(productionPlanDetail.ItemCode, prodLine).ConfigureAwait(false);
// if (productBoms.Count == 0)
// {
// throw new UserFriendlyException(
// $"生成备料计划失败:{productionPlanDetail.ItemCode} 在 {prodLine} 缺少对应的Bom信息!");
// }
// productBoms.ForEach(p => p.Product = productionPlanDetail.ItemCode);
// boms.AddRange(productBoms);
//}
//var productionLine = await _productionLineAppService.GetByCodeAsync(prodLine).ConfigureAwait(false);
//Check.NotNull(productionLine, "生产线代码", $"生产线 {prodLine} 不存在");
////将BOM按子零件分组
//var bomGroupByItemCode = boms.GroupBy(p => p.Component);
//foreach (var bomGroup in bomGroupByItemCode)
//{
// var itemCode = bomGroup.Key;
// var item = await ItemBasicAppService.GetByCodeAsync(itemCode).ConfigureAwait(false);
// Check.NotNull(item, "物品代码", $"物品 {itemCode} 不存在");
// //成品零件号
// var productItemCode = bomGroup.First().Product;
// //取整方式
// var trunkType = bomGroup.First().TruncType;
// //计量单位
// var uom = bomGroup.First().ComponentUom;
// //子零件的BOM用量为各个BOM用量的汇总
// var bomGroupQty = bomGroup.Sum(p => p.ComponentQty);
// //从生产计划明细中获得
// var planQty = productionPlan.Details.First(p => p.ItemCode == productItemCode).PlanQty;
// //实际需求量为成品计划生产量 * 汇总BOM用量
// var sumQty = planQty * bomGroupQty;
// //获取标包数量,计算备料数
// var (stdPackQty, detailQty) = await CalcDetailQtyAsync(sumQty, item.StdPackQty, trunkType).ConfigureAwait(false);
// //TODO 从物料存储关系中根据 库位组 = 生产线代码 查找是一个预定假设,需要改成可配置的
// //从物料存储关系中查找 库位组 = 生产线代码 的库位
// var locationCodeFromItemStoreRelation =
// await GetFirstLocationFromItemStoreRelationAsync(prodLine, itemCode).ConfigureAwait(false);
// //备料的物料没有物料存储关系,则目标库位取生产线的原料库位
// var locationCode = string.IsNullOrEmpty(locationCodeFromItemStoreRelation)
// ? rawLocationCodeOfProductionLine
// : locationCodeFromItemStoreRelation;
// //构造备料计划明细
// var detail = BuildPreparationPlanDetail(item, detailQty, stdPackQty, locationCode);
// preparationPlan.Details.Add(detail);
//}
//await CreateAsync(preparationPlan).ConfigureAwait(false);
//return preparationPlan;
return null;
}
private async Task<string> GetFirstLocationFromItemStoreRelationAsync(string prodLine, string itemCode)

26195
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240328035332_Update_2024_03_28_ProductLine.Designer.cs

File diff suppressed because it is too large

801
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240328035332_Update_2024_03_28_ProductLine.cs

@ -0,0 +1,801 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Update_2024_03_28_ProductLine : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Confirmed",
table: "Job_TransferLibJob",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "Job_CoatingIssueJob",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
MaterialRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
UpStreamJobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
JobDescription = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
JobType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
JobStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Priority = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
PriorityIncrement = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
WorkGroupCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IsAutoComplete = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
AcceptUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
AcceptUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
AcceptTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CompleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CompleteUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CompleteTime = table.Column<DateTime>(type: "datetime2", nullable: true),
WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_CoatingIssueJob", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Job_InjectionJob",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
InjectionRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
UpStreamJobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
JobDescription = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
JobType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
JobStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Priority = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
PriorityIncrement = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
WorkGroupCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IsAutoComplete = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
AcceptUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
AcceptUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
AcceptTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CompleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CompleteUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CompleteTime = table.Column<DateTime>(type: "datetime2", nullable: true),
WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_InjectionJob", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_CoatingIssueNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
Confirmed = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_CoatingIssueNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_CoatingMaterialRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PreparationPlanNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AutoSubmit = table.Column<bool>(type: "bit", nullable: false),
AutoAgree = table.Column<bool>(type: "bit", nullable: false),
AutoHandle = table.Column<bool>(type: "bit", nullable: false),
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false),
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false),
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_CoatingMaterialRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_InjectionNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
Confirmed = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_InjectionNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_InjectionRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PreparationPlanNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Workshop = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AutoSubmit = table.Column<bool>(type: "bit", nullable: false),
AutoAgree = table.Column<bool>(type: "bit", nullable: false),
AutoHandle = table.Column<bool>(type: "bit", nullable: false),
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false),
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false),
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_InjectionRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Job_CoatingIssueJobDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequestLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
Operation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
DistributionType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
TruncType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RoundedQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PlannedSplitRule = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PlanBeginTime = table.Column<DateTime>(type: "datetime2", nullable: false),
DeliveryQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RecommendContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_CoatingIssueJobDetail", x => x.Id);
table.ForeignKey(
name: "FK_Job_CoatingIssueJobDetail_Job_CoatingIssueJob_MasterID",
column: x => x.MasterID,
principalTable: "Job_CoatingIssueJob",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Job_InjectionJobDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequestLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
Operation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
DistributionType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
TruncType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RoundedQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PlannedSplitRule = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PlanBeginTime = table.Column<DateTime>(type: "datetime2", nullable: false),
DeliveryQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RecommendContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_InjectionJobDetail", x => x.Id);
table.ForeignKey(
name: "FK_Job_InjectionJobDetail_Job_InjectionJob_MasterID",
column: x => x.MasterID,
principalTable: "Job_InjectionJob",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_CoatingIssueNoteDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IssueTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PositionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
FromPackingCode = table.Column<string>(type: "nvarchar(450)", nullable: true),
ToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
FromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
ToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
FromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
ToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
FromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
FromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
FromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RecommendContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_CoatingIssueNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_CoatingIssueNoteDetail_Store_CoatingIssueNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_CoatingIssueNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_CoatingMaterialRequestDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_CoatingMaterialRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_CoatingMaterialRequestDetail_Store_CoatingMaterialRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_CoatingMaterialRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_InjectionNoteDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IssueTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
FromPackingCode = table.Column<string>(type: "nvarchar(450)", nullable: true),
ToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
FromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
ToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
FromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
ToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
FromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
FromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
FromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RecommendContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledPackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledSupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledLot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_InjectionNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_InjectionNoteDetail_Store_InjectionNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_InjectionNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_InjectionRequestDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
FromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
WorkStation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExpiredTime = table.Column<DateTime>(type: "datetime2", nullable: false),
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_InjectionRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_InjectionRequestDetail_Store_InjectionRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_InjectionRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Job_CoatingIssueJob_Number",
table: "Job_CoatingIssueJob",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Job_CoatingIssueJobDetail_MasterID",
table: "Job_CoatingIssueJobDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Job_InjectionJob_Number",
table: "Job_InjectionJob",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Job_InjectionJobDetail_MasterID",
table: "Job_InjectionJobDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingIssueNote_Number",
table: "Store_CoatingIssueNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingIssueNoteDetail_FromPackingCode",
table: "Store_CoatingIssueNoteDetail",
column: "FromPackingCode");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingIssueNoteDetail_MasterID",
table: "Store_CoatingIssueNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingIssueNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode",
table: "Store_CoatingIssueNoteDetail",
columns: new[] { "Number", "FromPackingCode", "FromLocationCode", "ToLocationCode" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingMaterialRequest_Number",
table: "Store_CoatingMaterialRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingMaterialRequestDetail_ItemCode",
table: "Store_CoatingMaterialRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingMaterialRequestDetail_MasterID",
table: "Store_CoatingMaterialRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_CoatingMaterialRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_CoatingMaterialRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionNote_Number",
table: "Store_InjectionNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionNoteDetail_FromPackingCode",
table: "Store_InjectionNoteDetail",
column: "FromPackingCode");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionNoteDetail_MasterID",
table: "Store_InjectionNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode",
table: "Store_InjectionNoteDetail",
columns: new[] { "Number", "FromPackingCode", "FromLocationCode", "ToLocationCode" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionRequest_Number",
table: "Store_InjectionRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionRequestDetail_ItemCode",
table: "Store_InjectionRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionRequestDetail_MasterID",
table: "Store_InjectionRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectionRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_InjectionRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Job_CoatingIssueJobDetail");
migrationBuilder.DropTable(
name: "Job_InjectionJobDetail");
migrationBuilder.DropTable(
name: "Store_CoatingIssueNoteDetail");
migrationBuilder.DropTable(
name: "Store_CoatingMaterialRequestDetail");
migrationBuilder.DropTable(
name: "Store_InjectionNoteDetail");
migrationBuilder.DropTable(
name: "Store_InjectionRequestDetail");
migrationBuilder.DropTable(
name: "Job_CoatingIssueJob");
migrationBuilder.DropTable(
name: "Job_InjectionJob");
migrationBuilder.DropTable(
name: "Store_CoatingIssueNote");
migrationBuilder.DropTable(
name: "Store_CoatingMaterialRequest");
migrationBuilder.DropTable(
name: "Store_InjectionNote");
migrationBuilder.DropTable(
name: "Store_InjectionRequest");
migrationBuilder.DropColumn(
name: "Confirmed",
table: "Job_TransferLibJob");
}
}
}

9431
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs

File diff suppressed because it is too large

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InjectionRequestEventHandler.cs

@ -234,7 +234,7 @@ public class InjectionRequestEventHandler
private async Task<InjectionJobDetailInput> BuildInjectionJobDetailAsync(InjectionRequestDetail injectionRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, InjectionJobDetailInput>(balance);
detail.RequestLocationCode = injectionRequestDetail.ToLocationCode;
@ -265,7 +265,7 @@ public class InjectionRequestEventHandler
detail.ToWarehouseCode = injectionRequestDetail.ToWarehouseCode;
detail.ToLocationGroup = injectionRequestDetail.ToLocationGroup;
detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
await Task.CompletedTask.ConfigureAwait(false);
return detail;

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs

@ -238,7 +238,7 @@ public class MaterialRequestEventHandler
private async Task<IssueJobDetailInput> BuildIssueJobDetailAsync(MaterialRequestDetail materialRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, IssueJobDetailInput>(balance);
detail.RequestLocationCode = materialRequestDetail.ToLocationCode;
@ -294,7 +294,7 @@ public class MaterialRequestEventHandler
// detail.RecommendQty = balance.Qty;
// detail.RecommendUom = balance.Uom;
detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
await Task.CompletedTask.ConfigureAwait(false);
return detail;

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductReceiptRequestEventHandler.cs

@ -128,13 +128,13 @@ public class ProductReceiptRequestEventHandler
{
var detail = ObjectMapper.Map<ProductReceiptRequestDetail, ProductReceiveJobDetailInput>(productionPlanDetail);
detail.ProdLine = productionPlan.ProdLine;
detail.RawLocationCode = productionLine.RawLocationCode; //原料回冲库位
//detail.RawLocationCode = productionLine.RawLocationCode; //原料回冲库位
detail.RecommendSupplierBatch = productionPlanDetail.SupplierBatch;
detail.RecommendArriveDate = productionPlanDetail.ArriveDate;
detail.RecommendProduceDate = productionPlanDetail.ProduceDate;
detail.RecommendExpireDate = productionPlanDetail.ExpireDate;
detail.RecommendLot = productionPlanDetail.Lot;
detail.RecommendToLocationCode = productionLine.ProductLocationCode;
//detail.RecommendToLocationCode = productionLine.ProductLocationCode;
detail.RecommendQty = productionPlanDetail.Qty;
detail.Uom = productionPlanDetail.Uom;
detail.StdPackQty = productionPlanDetail.StdPackQty;
@ -153,8 +153,8 @@ public class ProductReceiptRequestEventHandler
var productionLine = await _productionLineAppService.GetByCodeAsync(productionPlan.ProdLine).ConfigureAwait(false);
Check.NotNull(productionLine, "生产线代码", $"生产线 {productionPlan.ProdLine} 不存在");
var location = await LocationAclService.GetByCodeAsync(productionLine.ProductLocationCode).ConfigureAwait(false);
Check.NotNull(location, "库位代码", $"库位 {productionLine.ProductLocationCode} 不存在");
//var location = await LocationAclService.GetByCodeAsync(productionLine.ProductLocationCode).ConfigureAwait(false);
//Check.NotNull(location, "库位代码", $"库位 {productionLine.ProductLocationCode} 不存在");
var num = itemPack == 0 ? 1 : (int)Math.Ceiling(productionPlanDetail.Qty / itemPack);
for (var n = 0; n < num; n++)
@ -169,8 +169,8 @@ public class ProductReceiptRequestEventHandler
//设置工作组和任务优先级
entity.Priority = PriorityHelper.GetPriority(Clock);
entity.PriorityIncrement = 1;
entity.WarehouseCode = location.WarehouseCode;
entity.WorkGroupCode = location.WorkGroupCode;
//entity.WarehouseCode = location.WarehouseCode;
//entity.WorkGroupCode = location.WorkGroupCode;
return entity;

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductionPlanEventHandler.cs

@ -66,13 +66,13 @@ public class ProductionPlanEventHandler
{
var detail = ObjectMapper.Map<ProductionPlanDetail, ProductReceiveJobDetailInput>(productionPlanDetail);
detail.ProdLine = productionPlan.ProdLine;
detail.RawLocationCode = productionLine.RawLocationCode; //原料回冲库位
//detail.RawLocationCode = productionLine.RawLocationCode; //原料回冲库位
detail.RecommendSupplierBatch = productionPlanDetail.SupplierBatch;
detail.RecommendArriveDate = productionPlanDetail.ArriveDate;
detail.RecommendProduceDate = productionPlanDetail.ProduceDate;
detail.RecommendExpireDate = productionPlanDetail.ExpireDate;
detail.RecommendLot = productionPlanDetail.Lot;
detail.RecommendToLocationCode = productionLine.ProductLocationCode;
//detail.RecommendToLocationCode = productionLine.ProductLocationCode;
detail.RecommendQty = productionPlanDetail.PlanQty;
detail.Uom = productionPlanDetail.Uom;
detail.StdPackQty = stdPackQty;
@ -91,8 +91,8 @@ public class ProductionPlanEventHandler
var productionLine = await _productionLineAppService.GetByCodeAsync(productionPlan.ProdLine).ConfigureAwait(false);
Check.NotNull(productionLine, "生产线代码", $"生产线 {productionPlan.ProdLine} 不存在");
var location = await LocationAclService.GetByCodeAsync(productionLine.ProductLocationCode).ConfigureAwait(false);
Check.NotNull(location, "库位代码", $"库位 {productionLine.ProductLocationCode} 不存在");
//var location = await LocationAclService.GetByCodeAsync(productionLine.ProductLocationCode).ConfigureAwait(false);
//Check.NotNull(location, "库位代码", $"库位 {productionLine.ProductLocationCode} 不存在");
var num = (int)Math.Ceiling(productionPlanDetail.PlanQty / item.StdPackQty);
for (var n = 0; n < num; n++)
@ -107,8 +107,8 @@ public class ProductionPlanEventHandler
//设置工作组和任务优先级
entity.Priority = PriorityHelper.GetPriority(Clock);
entity.PriorityIncrement = 1;
entity.WarehouseCode = location.WarehouseCode;
entity.WorkGroupCode = location.WorkGroupCode;
//entity.WarehouseCode = location.WarehouseCode;
//entity.WorkGroupCode = location.WorkGroupCode;
return entity;

Loading…
Cancel
Save