Browse Source

更新

dev_DY_CC
赵新宇 1 year ago
parent
commit
ee3cb0beb4
  1. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
  2. 3
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs
  3. 4
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs
  4. 1
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj
  5. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Boms/IBomAppService.cs
  6. 13
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
  7. 34
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
  8. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/IBomManager.cs
  9. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDTO.cs
  10. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDetailDTO.cs
  11. 25
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestDetailInput.cs
  12. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestEditInput.cs
  13. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs
  14. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs
  15. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs
  16. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs
  17. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  18. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Bases/SfsStoreManagerBase.cs
  19. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobManager.cs
  20. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestDetail.cs
  21. 27363
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240403071320_transferLib_3temp.Designer.cs
  22. 454
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240403071320_transferLib_3temp.cs
  23. 1112
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  24. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/TransferLibRequestAutoMapperProfile.cs
  25. 82
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  26. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs

2
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs

@ -120,7 +120,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
case EnumIncomingDataType.Item:
await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Location:
case EnumIncomingDataType.ErpLocation:
await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Bom:

3
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs

@ -13,7 +13,7 @@ public enum EnumIncomingDataType
/// <summary>
/// ERP库位
/// </summary>
Location = 2,
ErpLocation = 2,
/// <summary>
/// 物料清单
/// </summary>
@ -110,5 +110,4 @@ public enum EnumIncomingDataType
/// 标准成本价格
/// </summary>
StdCostPrice=26,
}

4
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs

@ -19,6 +19,7 @@ using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.Swashbuckle;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Volo.Abp.VirtualFileSystem;
using Win_in.Sfs.Auth;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -77,7 +78,8 @@ namespace Win_in.Sfs.Wms.Store;
typeof(BasedataApplicationContractsModule),
typeof(FileStorageApplicationContractsModule),
typeof(MessageApplicationContractsModule),
typeof(LabelApplicationContractsModule)
typeof(LabelApplicationContractsModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule)
)]
public class StoreHttpApiHostModule : ModuleBase<StoreHttpApiHostModule>
{

1
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj

@ -30,6 +30,7 @@
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="5.3.5" />
</ItemGroup>
<ItemGroup>

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Boms/IBomAppService.cs

@ -44,6 +44,7 @@ public interface IBomAppService
/// <param name="productNum">总成数量</param>
/// <returns></returns>
Task<List<BomDTO>> GetMaterialTotalQtyAsync(string productCode, int productNum);
Task<List<BomDTO>> GetBomTreeByCodeAsync(string productCode);
Task<List<BomComponentDTO>> GetSubcomponentsRecursiveList(List<BomComponentDTO> p_lst, EnumBomSelectedType p_type);

13
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs

@ -93,7 +93,20 @@ public class BomAppService :
{
return await _bomManager.GetListOfComponentAsync(component).ConfigureAwait(false);
}
/// <summary>
/// 获取bomtree
/// </summary>
/// <param name="productCode"></param>
/// <returns></returns>
[HttpGet("get-bom-tree-by-code")]
public virtual async Task<List<BomDTO>> GetBomTreeByCodeAsync(string productCode)
{
var entities = await _bomManager.GetAllItemByCode(productCode).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<Bom>, List<BomDTO>>(entities);
return dtos;
}
/// <summary>
/// 获取所有子物料关系
/// </summary>

34
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs

@ -380,21 +380,21 @@ public class BomManager : DomainService, IBomManager
}
/// <summary>
/// 获取所有bomtree
/// </summary>
/// <param name="productCode"></param>
/// <returns></returns>
public virtual async Task<List<Bom>> GetAllItemByCode(string productCode)
{
List<Bom> boms = new List<Bom>();
var lst = await _repository.GetListAsync(p => p.Product == productCode).ConfigureAwait(false);
foreach (var bom in lst)
{
boms.Add(bom);
var results= await GetAllItemByCode(bom.Component).ConfigureAwait(false);
boms.AddRange(results);
}
return boms;
}
}

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/IBomManager.cs

@ -42,6 +42,7 @@ public interface IBomManager : IDomainService, IBulkImportService<Bom>
/// <param name="productNum">总成数量</param>
/// <returns></returns>
Task<List<Bom>> GetMaterialTotalQtyAsync(string productCode, int productNum);
Task<List<Bom>> GetAllItemByCode(string productCode);
Task<List<BomComponent>> GetSubcomponentsRecursiveList(List<BomComponent> p_lst, EnumBomSelectedType p_type);
}

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDTO.cs

@ -20,4 +20,30 @@ public class TransferLibRequestDTO : SfsStoreRequestDTOBase<TransferLibRequestDe
[Display(Name = "使用中间库")]
public bool UseOnTheWayLocation { get; set; }
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDetailDTO.cs

@ -20,4 +20,30 @@ public class TransferLibRequestDetailDTO : SfsStoreDetailWithFromToDTOBase
/// </summary>
public EnumJobStatus JobStatus { get; set; }
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

25
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestDetailInput.cs

@ -21,5 +21,30 @@ public class TransferLibRequestDetailInput : SfsStoreDetailWithFromToInputBase
/// </summary>
public EnumJobStatus JobStatus { get; set; }
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestEditInput.cs

@ -37,4 +37,31 @@ public class TransferLibRequestEditInput : SfsStoreRequestCreateOrUpdateInputBas
[Display(Name = "明细列表")]
public List<TransferLibRequestDetailInput> Details { get; set; }
#endregion
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs

@ -153,12 +153,12 @@ public abstract class SfsJobAppServiceBase<TEntity, TDetail, TEntityDto, TReques
[UnitOfWork]
public virtual async Task<TEntityDto> CompleteAsync(Guid id, TEntityDto dto)
{
var handleEntity = ObjectMapper.Map<TEntityDto, TEntity>(dto);
var job= await _repository.GetAsync(id).ConfigureAwait(false);
var job = await _repository.GetAsync(id).ConfigureAwait(false);
if (job.JobStatus is EnumJobStatus.Closed or EnumJobStatus.Cancelled or EnumJobStatus.None or EnumJobStatus.Done)//需要考虑下 多次提交的问题 所以不判断 进行中
{
throw new UserFriendlyException($"任务状态错误:编号为【{job.Number}】的任务已经【{job.JobStatus.GetDisplayName()}】");
}
var handleEntity = ObjectMapper.Map<TEntityDto, TEntity>(dto);
var handleResult = await _jobManager.CompleteAsync(handleEntity, CurrentUser).ConfigureAwait(false);
var handleDto = ObjectMapper.Map<TEntity, TEntityDto>(handleResult);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs

@ -60,7 +60,7 @@ public class TransferLibJobAppService
{
throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象");
}
var instance = Activator.CreateInstance(ty, dto.CallBusinessType, dto.CallRequestNumber, dto.CallJobNumber);
var instance = Activator.CreateInstance(ty);
if (instance == null)
{
throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败");

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/ITransferLibCallback.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs

@ -12,6 +12,10 @@ public interface ITransferLibCallback
public class TestTransferLibCallback : ITransferLibCallback
{
public TestTransferLibCallback()
{
}
public Tuple<bool?, string> DoTransferLibCallback(string businessType, string requestNum, string jobNum)
{
return Tuple.Create<bool?, string>(true, "调用新移库回调方法成功!");

15
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

@ -69,7 +69,7 @@ public class DeliverRequestAppService :
public override async Task<DeliverRequestDTO> CreateAsync(DeliverRequestEditInput input)
{
var entity = ObjectMapper.Map<DeliverRequestEditInput, DeliverRequest>(input);
await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false);
await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<DeliverRequest, DeliverRequestDTO>(entity);
@ -248,7 +248,16 @@ public class DeliverRequestAppService :
private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity)
{
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.Deliver_Standard).ConfigureAwait(false);
var transType = EnumTransSubType.Deliver_Standard;
if (entity.DeliverRequestType == EnumDeliverRequestType.FIS)
{
transType = EnumTransSubType.Deliver_FIS;
}
else if (entity.DeliverRequestType == EnumDeliverRequestType.RAW)
{
transType = EnumTransSubType.Deliver_RAW;
}
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, transType).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在");
@ -257,7 +266,7 @@ public class DeliverRequestAppService :
entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest;
entity.DirectCreateNote = tranType.DirectCreateNote;
entity.DeliverRequestType = EnumDeliverRequestType.Normal;
entity.DeliverRequestType = entity.DeliverRequestType;
}
private static void CheckTransactionType(TransactionTypeDTO transactionType, ItemBasicDTO item)

39
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs

@ -15,6 +15,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -42,6 +43,8 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionJobAppService _issueJobAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public ThirdLocationRequestAppService(
IThirdLocationRequestRepository repository,
IThirdLocationRequestManager thirdLocationRequestManager,
@ -51,6 +54,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService,
ITransactionTypeAppService transactionTypeAppService,
IInjectionJobAppService issueJobAppService)
: base(repository, thirdLocationRequestManager)
{
@ -61,6 +65,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
_itemBasicAppService = itemBasicAppService;
_productionLineAppService = productionLineAppService;
_issueJobAppService = issueJobAppService;
_transactionTypeAppService = transactionTypeAppService;
}
@ -94,6 +99,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
}
input.AutoSubmit = true;
@ -104,6 +110,21 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
var entity = ObjectMapper.Map<ThirdLocationRequestEditInput, ThirdLocationRequest>(input);
foreach (var detail in entity.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
detail.ToLocationArea = toLocationDto.AreaCode;
detail.ToLocationErpCode = toLocationDto.ErpLocationCode;
detail.ToLocationGroup = toLocationDto.LocationGroupCode;
detail.ToWarehouseCode = toLocationDto.WarehouseCode;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
}
var result = await _thirdLocationRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<ThirdLocationRequest, ThirdLocationRequestDTO>(result);
@ -111,6 +132,24 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
return dto;
}
/// <summary>
/// 赋值Request业务属性
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task SetRequestAutoPropertiesAsync(ThirdLocationRequestEditInput entity)
{
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.PurchaseReturn, EnumTransSubType.None).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在");
entity.AutoCompleteJob = tranType.AutoCompleteJob;
entity.AutoSubmit = tranType.AutoSubmitRequest;
entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest;
entity.DirectCreateNote = tranType.DirectCreateNote;
}
//[Authorize(ThirdLocationRequestPermissions.Create)]
[HttpPost("create-and-handle")]
public async Task<ThirdLocationRequestDTO> CreateAndHandleAsync(ThirdLocationRequestEditInput input)

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Bases/SfsStoreManagerBase.cs

@ -85,7 +85,9 @@ public abstract class SfsStoreManagerBase<TEntity, TDetailEntity>
public virtual async Task<TEntity> GetByNumberAsync(string number)
{
return await Repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
//return await Repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
var ret = await Repository.FirstOrDefaultAsync(itm => itm.Number == number).ConfigureAwait(false);
return ret;
}
[UnitOfWork]

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobManager.cs

@ -43,4 +43,10 @@ public class TransferLibJobManager : SfsJobManagerBase<TransferLibJob, TransferL
{
await Repository.UpdateAsync(TransferLibJob).ConfigureAwait(false);
}
public override async Task<TransferLibJob> CompleteAsync(TransferLibJob input, ICurrentUser user)
{
TransferLibJob entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestDetail.cs

@ -7,7 +7,6 @@ namespace Win_in.Sfs.Wms.Store.Domain;
/// </summary>
public class TransferLibRequestDetail : SfsStoreDetailWithFromToEntityBase
{
/// <summary>
/// 原因代码
/// </summary>

27363
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240403071320_transferLib_3temp.Designer.cs

File diff suppressed because it is too large

454
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240403071320_transferLib_3temp.cs

@ -0,0 +1,454 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class transferLib_3temp : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PreparationPlanNumber",
table: "Store_InjectionRequest");
migrationBuilder.DropColumn(
name: "Workshop",
table: "Store_InjectionRequest");
migrationBuilder.AddColumn<string>(
name: "JobNumber",
table: "Store_ProductRecycleNote",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "ExecutedQty",
table: "Job_ProductRecycleJobDetail",
type: "decimal(18,6)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "RequestNumber",
table: "Job_ProductRecycleJob",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.CreateTable(
name: "Job_AssembleJob",
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),
AssembleRequestNumber = 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_AssembleJob", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_AssembleNote",
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_AssembleNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_AssembleRequest",
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_AssembleRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Job_AssembleJobDetail",
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_AssembleJobDetail", x => x.Id);
table.ForeignKey(
name: "FK_Job_AssembleJobDetail_Job_AssembleJob_MasterID",
column: x => x.MasterID,
principalTable: "Job_AssembleJob",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_AssembleNoteDetail",
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_AssembleNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_AssembleNoteDetail_Store_AssembleNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_AssembleNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_AssembleRequestDetail",
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_AssembleRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_AssembleRequestDetail_Store_AssembleRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_AssembleRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Job_AssembleJob_Number",
table: "Job_AssembleJob",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Job_AssembleJobDetail_MasterID",
table: "Job_AssembleJobDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleNote_Number",
table: "Store_AssembleNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleNoteDetail_FromPackingCode",
table: "Store_AssembleNoteDetail",
column: "FromPackingCode");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleNoteDetail_MasterID",
table: "Store_AssembleNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode",
table: "Store_AssembleNoteDetail",
columns: new[] { "Number", "FromPackingCode", "FromLocationCode", "ToLocationCode" },
unique: true,
filter: "[FromPackingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleRequest_Number",
table: "Store_AssembleRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleRequestDetail_ItemCode",
table: "Store_AssembleRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleRequestDetail_MasterID",
table: "Store_AssembleRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_AssembleRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Job_AssembleJobDetail");
migrationBuilder.DropTable(
name: "Store_AssembleNoteDetail");
migrationBuilder.DropTable(
name: "Store_AssembleRequestDetail");
migrationBuilder.DropTable(
name: "Job_AssembleJob");
migrationBuilder.DropTable(
name: "Store_AssembleNote");
migrationBuilder.DropTable(
name: "Store_AssembleRequest");
migrationBuilder.DropColumn(
name: "JobNumber",
table: "Store_ProductRecycleNote");
migrationBuilder.DropColumn(
name: "ExecutedQty",
table: "Job_ProductRecycleJobDetail");
migrationBuilder.DropColumn(
name: "RequestNumber",
table: "Job_ProductRecycleJob");
migrationBuilder.AddColumn<string>(
name: "PreparationPlanNumber",
table: "Store_InjectionRequest",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Workshop",
table: "Store_InjectionRequest",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
}
}
}

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

File diff suppressed because it is too large

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/TransferLibRequestAutoMapperProfile.cs

@ -25,12 +25,13 @@ public partial class StoreEventAutoMapperProfile : Profile
.IgnoreAuditedObjectProperties()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.Confirmed, y => y.MapFrom(d => !d.UseOnTheWayLocation))
.ForMember(dest => dest.Details, option => option.MapFrom(src => src.Details))
.Ignore(x => x.ConfirmTime)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Number)
.Ignore(x => x.Id)
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.Details)
//.Ignore(x => x.Details)
.Ignore(x => x.IsAutoComplete)
.Ignore(x => x.JobType)
.Ignore(x => x.JobDescription)

82
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs

@ -26,20 +26,20 @@ public class ThirdLocationRequestEventHandler
{
private readonly IThirdLocationJobAppService _thirdLocationJobAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IThirdLocationRequestManager _assembleRequestManager;
private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
private readonly ILocationAppService _locationAppService;
private readonly IBalanceAppService _balanceAppService;
public ThirdLocationRequestEventHandler(
IThirdLocationJobAppService thirdLocationJobAppService
, IProductionLineAppService productionLineAppService
, IThirdLocationRequestManager assembleRequestManager
, IThirdLocationRequestManager thirdLocationRequestManager
, ILocationAppService locationAppService
, IBalanceAppService balanceAppService)
{
_thirdLocationJobAppService = thirdLocationJobAppService;
_productionLineAppService = productionLineAppService;
_assembleRequestManager = assembleRequestManager;
_thirdLocationRequestManager = thirdLocationRequestManager;
_locationAppService = locationAppService;
_balanceAppService = balanceAppService;
}
@ -54,7 +54,7 @@ public class ThirdLocationRequestEventHandler
//if (entity.AutoSubmit)
//{
// await _assembleRequestManager.SubmitAsync(entity).ConfigureAwait(false);
// await _thirdLocationRequestManager.SubmitAsync(entity).ConfigureAwait(false);
//}
}
@ -69,7 +69,7 @@ public class ThirdLocationRequestEventHandler
{
if (entity.AutoSubmit)
{
await _assembleRequestManager.SubmitAsync(entity).ConfigureAwait(false);
await _thirdLocationRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
@ -116,23 +116,23 @@ public class ThirdLocationRequestEventHandler
#region 私有
private async Task<List<ThirdLocationJobEditInput>> BuildThirdLocationJobAsync
(ThirdLocationRequest assembleRequest)
(ThirdLocationRequest thirdLocationRequest)
{
var jobs = new List<ThirdLocationJobEditInput>();
var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);//库存事务
var toLocationCodes = assembleRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合
var toLocationCodes = thirdLocationRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合
var assembleRequestDetails = assembleRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合
foreach (var assembleRequestDetail in assembleRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务
var thirdLocationRequestDetails = thirdLocationRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合
foreach (var thirdLocationRequestDetail in thirdLocationRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务
{
var toLocation = toLocations.FirstOrDefault(p => p.Code == assembleRequestDetail.ToLocationCode);//判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {assembleRequestDetail.ToLocationCode} 不存在");
var toLocation = toLocations.FirstOrDefault(p => p.Code == thirdLocationRequestDetail.ToLocationCode);//判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {thirdLocationRequestDetail.ToLocationCode} 不存在");
//创建详情
var jobDetails = await BuildThirdLocationJobDetailInputsAsync(assembleRequest, assembleRequestDetail, transactionType, toLocation.LocationGroupCode).ConfigureAwait(false);
var jobDetails = await BuildThirdLocationJobDetailInputsAsync(thirdLocationRequest, thirdLocationRequestDetail, transactionType, toLocation.LocationGroupCode).ConfigureAwait(false);
if (!jobDetails.Any())
{
continue;
@ -141,22 +141,22 @@ public class ThirdLocationRequestEventHandler
var fromLocationCode = jobDetails[0].RecommendFromLocationCode;
var fromLocation = await _locationAppService.GetByCodeAsync(fromLocationCode).ConfigureAwait(false);
var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode);
if (job == null || job.Details.Any(p => p.ToLocationCode != assembleRequestDetail.ToLocationCode))
if (job == null || job.Details.Any(p => p.ToLocationCode != thirdLocationRequestDetail.ToLocationCode))
{
job = BuildThirdLocationJobCreateInput(assembleRequest, fromLocation);
job = BuildThirdLocationJobCreateInput(thirdLocationRequest, fromLocation);
jobs.Add(job);
}
job.Details.AddRange(jobDetails);
if (assembleRequestDetail.ToBeIssuedQty < 0)
if (thirdLocationRequestDetail.ToBeIssuedQty < 0)
{
assembleRequestDetail.Status = EnumStatus.Close;
thirdLocationRequestDetail.Status = EnumStatus.Close;
}
}
jobs = jobs.Where(p => p.Details.Any()).ToList();
var openRequestDetails =
assembleRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
thirdLocationRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
if (!openRequestDetails.Any())
{
@ -168,7 +168,7 @@ public class ThirdLocationRequestEventHandler
if (enableMultipleCreateThirdLocationJob)
{
//assembleRequest.Partial();
//thirdLocationRequest.Partial();
}
else
{
@ -182,34 +182,34 @@ public class ThirdLocationRequestEventHandler
return jobs;
}
private ThirdLocationJobEditInput BuildThirdLocationJobCreateInput(ThirdLocationRequest assembleRequest, LocationDTO fromLocation)
private ThirdLocationJobEditInput BuildThirdLocationJobCreateInput(ThirdLocationRequest thirdLocationRequest, LocationDTO fromLocation)
{
ThirdLocationJobEditInput job;
job = ObjectMapper.Map<ThirdLocationRequest, ThirdLocationJobEditInput>(assembleRequest);
job = ObjectMapper.Map<ThirdLocationRequest, ThirdLocationJobEditInput>(thirdLocationRequest);
job.JobType = EnumJobType.IssueJob;
job.JobStatus = EnumJobStatus.Open;
job.WorkGroupCode = fromLocation.WorkGroupCode;
job.WarehouseCode = fromLocation.WarehouseCode;
job.ProdLine = fromLocation.LocationGroupCode;
job.Worker = assembleRequest.Worker;
job.Worker = thirdLocationRequest.Worker;
if (string.IsNullOrEmpty(job.Worker))
{
job.Worker = "admin";
}
job.RequestNumber = assembleRequest.Number;
job.RequestNumber = thirdLocationRequest.Number;
return job;
}
private async Task<List<ThirdLocationJobDetailInput>> BuildThirdLocationJobDetailInputsAsync(ThirdLocationRequest assembleRequest,
ThirdLocationRequestDetail assembleRequestDetail, TransactionTypeDTO transactionType, string toLocationGroupCode)
private async Task<List<ThirdLocationJobDetailInput>> BuildThirdLocationJobDetailInputsAsync(ThirdLocationRequest thirdLocationRequest,
ThirdLocationRequestDetail thirdLocationRequestDetail, TransactionTypeDTO transactionType, string toLocationGroupCode)
{
var jobDetails = new List<ThirdLocationJobDetailInput>();
var input = new RecommendBalanceRequestInput()
{
ItemCode = assembleRequestDetail.ItemCode,
Qty = assembleRequestDetail.ToBeIssuedQty,
ItemCode = thirdLocationRequestDetail.ItemCode,
Qty = thirdLocationRequestDetail.ToBeIssuedQty,
LocationTypes = transactionType.OutLocationTypes,
LocationAreas = new List<string> { assembleRequestDetail.FromLocationArea },
LocationAreas = new List<string> { thirdLocationRequestDetail.FromLocationArea },
Statuses = transactionType.OutInventoryStatuses,
};
//获取推荐库存
@ -220,8 +220,8 @@ public class ThirdLocationRequestEventHandler
foreach (var recommend in recommendList)
{
//拿走需求量
var detail = await BuildThirdLocationJobDetailAsync(assembleRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false);
if (assembleRequest.UseOnTheWayLocation)
var detail = await BuildThirdLocationJobDetailAsync(thirdLocationRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false);
if (thirdLocationRequest.UseOnTheWayLocation)
{
//获取在途库
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
@ -230,26 +230,26 @@ public class ThirdLocationRequestEventHandler
}
jobDetails.Add(detail);
assembleRequestDetail.IssuedQty += recommend.Qty;
thirdLocationRequestDetail.IssuedQty += recommend.Qty;
//await _assembleRequestManager.UpdateDetailsAsync(assembleRequest).ConfigureAwait(false);
//await _thirdLocationRequestManager.UpdateDetailsAsync(thirdLocationRequest).ConfigureAwait(false);
}
}
return jobDetails;
}
private async Task<ThirdLocationJobDetailInput> BuildThirdLocationJobDetailAsync(ThirdLocationRequestDetail assembleRequestDetail, BalanceDTO balance, string toLocationGroupCode)
private async Task<ThirdLocationJobDetailInput> BuildThirdLocationJobDetailAsync(ThirdLocationRequestDetail thirdLocationRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance);
detail.RequestLocationCode = assembleRequestDetail.ToLocationCode;
detail.WorkStation = assembleRequestDetail.WorkStation;
detail.ExpiredTime = assembleRequestDetail.ExpiredTime;
detail.PositionCode = assembleRequestDetail.PositionCode;
detail.RecommendType = assembleRequestDetail.RecommendType;
detail.RequestLocationCode = thirdLocationRequestDetail.ToLocationCode;
detail.WorkStation = thirdLocationRequestDetail.WorkStation;
detail.ExpiredTime = thirdLocationRequestDetail.ExpiredTime;
detail.PositionCode = thirdLocationRequestDetail.PositionCode;
detail.RecommendType = thirdLocationRequestDetail.RecommendType;
detail.RecommendPackingCode = balance.PackingCode;
detail.RecommendContainerCode = balance.ContainerCode;
@ -267,10 +267,10 @@ public class ThirdLocationRequestEventHandler
detail.RecommendQty = balance.Qty;
detail.Uom = balance.Uom;
detail.ToLocationCode = assembleRequestDetail.ToLocationCode;
detail.ToLocationErpCode = assembleRequestDetail.ToLocationErpCode;
detail.ToLocationArea = assembleRequestDetail.ToLocationArea;
detail.ToWarehouseCode = assembleRequestDetail.ToWarehouseCode;
detail.ToLocationCode = thirdLocationRequestDetail.ToLocationCode;
detail.ToLocationErpCode = thirdLocationRequestDetail.ToLocationErpCode;
detail.ToLocationArea = thirdLocationRequestDetail.ToLocationArea;
detail.ToWarehouseCode = thirdLocationRequestDetail.ToWarehouseCode;
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.ProdLine = toLocationGroupCode;

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs

@ -106,11 +106,11 @@ public class TransferLibRequestEventHandler
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<TransferLibRequest> eventData)
{
var entity = eventData.Entity;
if (entity.AutoSubmit)
{
await _transferLibRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
//var entity = eventData.Entity;
//if (entity.AutoSubmit)
//{
// await _transferLibRequestManager.SubmitAsync(entity).ConfigureAwait(false);
//}
}
/// <summary>

Loading…
Cancel
Save