Browse Source

修改 InjectionRequestDetai新增BoxQty

dev_DY_CC
郑勃旭 1 year ago
parent
commit
ff1241b15c
  1. 21
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueType.cs
  2. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/DTOs/InjectionRequestDetailDTO.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/IInjectionRequestAppService.cs
  4. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestDetailInput.cs
  5. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs
  6. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/InjectionRequests/InjectionRequestDetail.cs
  7. 29578
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240409090529_Update_InjectionRequest_2024_04_09.Designer.cs
  8. 730
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240409090529_Update_InjectionRequest_2024_04_09.cs
  9. 3719
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  10. 42
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/InjectionRequestEventHandler.cs

21
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueType.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
public enum EnumIssueType
{
None=0,
/// <summary>
/// 按箱 叫料
/// </summary>
Box=1,
/// <summary>
/// 按数量 叫料
/// </summary>
Num=2,
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/DTOs/InjectionRequestDetailDTO.cs

@ -47,4 +47,9 @@ public class InjectionRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
[NotMapped]
public decimal NotFinishQty => Qty - ReceivedQty;
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

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

@ -9,5 +9,5 @@ public interface IInjectionRequestAppService
: ISfsStoreRequestMasterAppServiceBase<InjectionRequestDTO, SfsStoreRequestInputBase, InjectionRequestEditInput, InjectionRequestDetailDTO, SfsStoreRequestInputBase>
{
Task<InjectionRequestDTO> CreateAndHandleAsync(InjectionRequestEditInput input);
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestDetailInput.cs

@ -96,5 +96,9 @@ public class InjectionRequestDetailInput : SfsStoreDetailWithQtyInputBase
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

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

@ -67,17 +67,11 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
public override async Task<InjectionRequestDTO> HandleAsync(Guid id)
{
//var entity = await _repository.GetAsync(id).ConfigureAwait(false);
//await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<InjectionRequest>(entity), false)
// .ConfigureAwait(false);
//return ObjectMapper.Map<InjectionRequest, InjectionRequestDTO>(entity);
await Task.CompletedTask.ConfigureAwait(false);
return null;
}
[HttpPost("")]
//[Authorize(InjectionRequestPermissions.Create)]
public override async Task<InjectionRequestDTO> CreateAsync(InjectionRequestEditInput input)
{
foreach (var item in input.Details)
@ -121,7 +115,6 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
return dto;
}
//[Authorize(InjectionRequestPermissions.Create)]
[HttpPost("create-and-handle")]
public async Task<InjectionRequestDTO> CreateAndHandleAsync(InjectionRequestEditInput input)
{
@ -134,21 +127,6 @@ 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)
{
var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<InjectionRequest>, List<InjectionRequestDTO>>(entities);
return dtos;
}
#region 导入
/// <summary>

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/InjectionRequests/InjectionRequestDetail.cs

@ -108,4 +108,10 @@ public class InjectionRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLoc
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

29578
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240409090529_Update_InjectionRequest_2024_04_09.Designer.cs

File diff suppressed because it is too large

730
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240409090529_Update_InjectionRequest_2024_04_09.cs

@ -0,0 +1,730 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Update_InjectionRequest_2024_04_09 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<decimal>(
name: "BoxQty",
table: "Store_InjectionRequestDetail",
type: "decimal(18,6)",
nullable: false,
defaultValue: 0m);
migrationBuilder.CreateTable(
name: "Job_ThirdLocationJob",
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),
RequestNumber = 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_ThirdLocationJob", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_CustomerProductionReturnNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProductionReturnRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ReturnTime = table.Column<DateTime>(type: "datetime2", 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_CustomerProductionReturnNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_InjectioModelPlan",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
PlanDate = table.Column<DateTime>(type: "datetime2", nullable: false),
PlanTime = table.Column<DateTime>(type: "datetime2", 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_InjectioModelPlan", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_MesRecord",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
MesRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
State = table.Column<int>(type: "int", 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_MesRecord", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_ThirdLocationNote",
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_ThirdLocationNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_ThirdLocationRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = 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_ThirdLocationRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Job_ThirdLocationJobDetail",
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_ThirdLocationJobDetail", x => x.Id);
table.ForeignKey(
name: "FK_Job_ThirdLocationJobDetail_Job_ThirdLocationJob_MasterID",
column: x => x.MasterID,
principalTable: "Job_ThirdLocationJob",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_CustomerProductionReturnNoteDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", 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(450)", 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),
RecommendToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendToWarehouseCode = 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),
HandledToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
HandledToWarehouseCode = 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_CustomerProductionReturnNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_CustomerProductionReturnNoteDetail_Store_CustomerProductionReturnNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_CustomerProductionReturnNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_InjectioModelPlanDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
PlanQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, 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),
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)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_InjectioModelPlanDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_InjectioModelPlanDetail_Store_InjectioModelPlan_MasterID",
column: x => x.MasterID,
principalTable: "Store_InjectioModelPlan",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_MesRecordDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ReasonCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, 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),
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(64)", maxLength: 64, 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(450)", 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)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_MesRecordDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_MesRecordDetail_Store_MesRecord_MasterID",
column: x => x.MasterID,
principalTable: "Store_MesRecord",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_ThirdLocationNoteDetail",
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_ThirdLocationNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_ThirdLocationNoteDetail_Store_ThirdLocationNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_ThirdLocationNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_ThirdLocationRequestDetail",
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_ThirdLocationRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_ThirdLocationRequestDetail_Store_ThirdLocationRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_ThirdLocationRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Job_ThirdLocationJob_Number",
table: "Job_ThirdLocationJob",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Job_ThirdLocationJobDetail_MasterID",
table: "Job_ThirdLocationJobDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_CustomerProductionReturnNote_Number",
table: "Store_CustomerProductionReturnNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_CustomerProductionReturnNoteDetail_MasterID",
table: "Store_CustomerProductionReturnNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_CustomerProductionReturnNoteDetail_Number_ItemCode_FromPackingCode_ToPackingCode_FromLocationCode_ToLocationCode",
table: "Store_CustomerProductionReturnNoteDetail",
columns: new[] { "Number", "ItemCode", "FromPackingCode", "ToPackingCode", "FromLocationCode", "ToLocationCode" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL AND [ToPackingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectioModelPlan_Number",
table: "Store_InjectioModelPlan",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_InjectioModelPlanDetail_MasterID",
table: "Store_InjectioModelPlanDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_InjectioModelPlanDetail_Number_ItemCode",
table: "Store_InjectioModelPlanDetail",
columns: new[] { "Number", "ItemCode" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_MesRecord_Number",
table: "Store_MesRecord",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_MesRecordDetail_MasterID",
table: "Store_MesRecordDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_MesRecordDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus",
table: "Store_MesRecordDetail",
columns: new[] { "Number", "ItemCode", "FromPackingCode", "FromLocationCode", "ToLocationCode", "FromLot", "FromStatus" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationNote_Number",
table: "Store_ThirdLocationNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationNoteDetail_FromPackingCode",
table: "Store_ThirdLocationNoteDetail",
column: "FromPackingCode");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationNoteDetail_MasterID",
table: "Store_ThirdLocationNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode",
table: "Store_ThirdLocationNoteDetail",
columns: new[] { "Number", "FromPackingCode", "FromLocationCode", "ToLocationCode" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationRequest_Number",
table: "Store_ThirdLocationRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationRequestDetail_ItemCode",
table: "Store_ThirdLocationRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationRequestDetail_MasterID",
table: "Store_ThirdLocationRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_ThirdLocationRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_ThirdLocationRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Job_ThirdLocationJobDetail");
migrationBuilder.DropTable(
name: "Store_CustomerProductionReturnNoteDetail");
migrationBuilder.DropTable(
name: "Store_InjectioModelPlanDetail");
migrationBuilder.DropTable(
name: "Store_MesRecordDetail");
migrationBuilder.DropTable(
name: "Store_ThirdLocationNoteDetail");
migrationBuilder.DropTable(
name: "Store_ThirdLocationRequestDetail");
migrationBuilder.DropTable(
name: "Job_ThirdLocationJob");
migrationBuilder.DropTable(
name: "Store_CustomerProductionReturnNote");
migrationBuilder.DropTable(
name: "Store_InjectioModelPlan");
migrationBuilder.DropTable(
name: "Store_MesRecord");
migrationBuilder.DropTable(
name: "Store_ThirdLocationNote");
migrationBuilder.DropTable(
name: "Store_ThirdLocationRequest");
migrationBuilder.DropColumn(
name: "BoxQty",
table: "Store_InjectionRequestDetail");
}
}
}

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

File diff suppressed because it is too large

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

@ -8,6 +8,7 @@ using Volo.Abp;
using Volo.Abp.EventBus;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -70,7 +71,19 @@ public class InjectionRequestEventHandler
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<InjectionRequest> eventData)
{
var entity = eventData.Entity;
var injectionJobs = await CreateInjectionJobAsync(entity).ConfigureAwait(false);
List<InjectionJobEditInput> injectionJobs = new EditableList<InjectionJobEditInput>();
switch (entity.Type)
{
case nameof(EnumIssueType.Box):
break;
case nameof(EnumIssueType.Num):
injectionJobs = await CreateInjectionJobWithBoxTypeAsync(entity).ConfigureAwait(false);
break;
}
if (injectionJobs.Any())
{
await _injectionJobAppService.CreateManyAsync(injectionJobs).ConfigureAwait(false);
@ -102,13 +115,15 @@ public class InjectionRequestEventHandler
#region 私有
#region 按数量叫料
/// <summary>
/// 创建注塑任务
/// </summary>
/// <param name="injectionRequest"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<InjectionJobEditInput>> CreateInjectionJobAsync
private async Task<List<InjectionJobEditInput>> CreateInjectionJobWithBoxTypeAsync
(InjectionRequest injectionRequest)
{
var jobs = new List<InjectionJobEditInput>();
@ -128,7 +143,7 @@ public class InjectionRequestEventHandler
//创建详情
var jobDetails =
await CreateInjectionJobDetailInputsAsync(injectionRequest, injectionRequestDetail,
await CreateInjectionJobDetailInputsWithBoxTypeAsync(injectionRequest, injectionRequestDetail,
toLocation.LocationGroupCode).ConfigureAwait(false);
if (!jobDetails.Any())
{
@ -140,7 +155,7 @@ public class InjectionRequestEventHandler
var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode);
if (job == null || job.Details.Any(p => p.ToLocationCode != injectionRequestDetail.ToLocationCode))
{
job = BuildInjectionJobCreateInput(injectionRequest, fromLocation);
job = await BuildInjectionJobCreateInputWithBoxTypeAsync(injectionRequest, fromLocation).ConfigureAwait(false);
jobs.Add(job);
}
@ -189,7 +204,7 @@ public class InjectionRequestEventHandler
/// <param name="injectionRequest"></param>
/// <param name="fromLocation"></param>
/// <returns></returns>
private InjectionJobEditInput BuildInjectionJobCreateInput(InjectionRequest injectionRequest,
private async Task<InjectionJobEditInput> BuildInjectionJobCreateInputWithBoxTypeAsync(InjectionRequest injectionRequest,
LocationDTO fromLocation)
{
InjectionJobEditInput job;
@ -206,6 +221,9 @@ public class InjectionRequestEventHandler
}
job.InjectionRequestNumber = injectionRequest.Number;
await Task.CompletedTask.ConfigureAwait(false);
return job;
}
@ -217,7 +235,7 @@ public class InjectionRequestEventHandler
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<InjectionJobDetailInput>> CreateInjectionJobDetailInputsAsync(
private async Task<List<InjectionJobDetailInput>> CreateInjectionJobDetailInputsWithBoxTypeAsync(
InjectionRequest injectionRequest,
InjectionRequestDetail injectionRequestDetail, string toLocationGroupCode)
{
@ -251,7 +269,7 @@ public class InjectionRequestEventHandler
foreach (var recommend in recommendList)
{
//拿走需求量
var detail = await BuildInjectionJobDetailAsync(injectionRequestDetail, recommend, toLocationGroupCode)
var detail = await BuildInjectionJobDetailWithBoxTypeAsync(injectionRequestDetail, recommend, toLocationGroupCode)
.ConfigureAwait(false);
if (injectionRequest.UseOnTheWayLocation)
{
@ -279,7 +297,7 @@ public class InjectionRequestEventHandler
/// <param name="balance"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
private async Task<InjectionJobDetailInput> BuildInjectionJobDetailAsync(
private async Task<InjectionJobDetailInput> BuildInjectionJobDetailWithBoxTypeAsync(
InjectionRequestDetail injectionRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
@ -319,4 +337,12 @@ public class InjectionRequestEventHandler
}
#endregion
#region 按箱叫料
#endregion
#endregion
}

Loading…
Cancel
Save