diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibNoteController.cs
new file mode 100644
index 000000000..1dc534f75
--- /dev/null
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibNoteController.cs
@@ -0,0 +1,187 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.AspNetCore.Mvc;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+
+namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
+
+///
+///
+///
+[ApiController]
+[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-note")]
+
+public class TransferLibNoteController : AbpController
+{
+ private readonly ITransferLibNoteAppService _transferLibNoteAppService;
+
+ ///
+ ///
+ ///
+ ///
+ public TransferLibNoteController(ITransferLibNoteAppService transferLibNoteAppService)
+ {
+ _transferLibNoteAppService = transferLibNoteAppService;
+ }
+
+ ///
+ /// 获取盘点任务详情
+ ///
+ ///
+ ///
+ [HttpGet("{id}")]
+
+ public virtual async Task> GetAsync(Guid id)
+ {
+ var result = await _transferLibNoteAppService.GetAsync(id).ConfigureAwait(false);
+ return Ok(result);
+ }
+
+ ///
+ /// 获取列表 筛选
+ ///
+ ///
+ ///
+ [HttpPost("list")]
+ public virtual async Task> GetListAsync(SfsStoreRequestInputBase sfsRequestDTO)
+ {
+ var list = await _transferLibNoteAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false);
+ return list;
+ }
+
+ ///
+ /// 获取列表
+ ///
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ public virtual async Task> GetListAsync(int pageSize, int pageIndex)
+ {
+
+ var request = new SfsStoreRequestInputBase
+ {
+ MaxResultCount = pageSize,
+ SkipCount = (pageIndex - 1) * pageSize,
+ Sorting = $"{nameof(TransferLibNoteDTO.Number)} ASC",
+ Condition = new Condition
+ {
+ Filters = new List
+ {
+ new(nameof(TransferLibNoteDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="),
+ new(nameof(TransferLibNoteDTO.Confirmed),"false","==")
+ }
+ }
+ };
+
+ var list = await _transferLibNoteAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false);
+ return list;
+ }
+
+ ///
+ /// 获取任务数量
+ ///
+ ///
+ [HttpGet("count")]
+ public virtual async Task> CountAsync()
+ {
+ var request = new SfsStoreRequestInputBase
+ {
+ Sorting = $"{nameof(TransferLibNoteDTO.Number)} ASC",
+ Condition = new Condition
+ {
+ Filters = new List
+ {
+ new(nameof(TransferLibNoteDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="),
+ new(nameof(TransferLibNoteDTO.Confirmed),"false","==")
+ }
+ }
+ };
+
+ var count = await _transferLibNoteAppService.GetCountByFilterAsync(request).ConfigureAwait(false);
+
+ return Ok(count);
+ }
+
+ ///
+ /// 根据number获取要料详情
+ ///
+ ///
+ ///
+ [HttpGet("{number}")]
+
+ public virtual async Task> GetAsync(string number)
+ {
+ var result = await _transferLibNoteAppService.GetByNumberAsync(number).ConfigureAwait(false);
+ return Ok(result);
+ }
+
+ ///
+ /// 完成对应的请求
+ ///
+ ///
+ ///
+ [HttpPost("complete/{id}")]
+
+ public virtual async Task CompleteAsync(Guid id)
+ {
+ var entity = await _transferLibNoteAppService.ConfirmAsync(id).ConfigureAwait(false);
+ return entity;
+ }
+
+ ///
+ /// 库存转移
+ ///
+ ///
+ ///
+ [HttpPost("")]
+ public virtual async Task Create(TransferLibNoteEditInput input)
+ {
+ return await _transferLibNoteAppService.CreateAsync(input).ConfigureAwait(false);
+ }
+
+ ///
+ /// 拆箱
+ ///
+ ///
+ ///
+ [HttpPost("split-packing")]
+ public async Task SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput)
+ {
+ return await _transferLibNoteAppService.SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false);
+ }
+
+ ///
+ /// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-purchase-receipt")]
+ public async Task SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
+ {
+ var ret = await _transferLibNoteAppService.SplitPacking_PurchaseReceiptAsync(transferLibNoteEditInput, updateJobDetailInput).ConfigureAwait(false);
+ return ret;
+ }
+
+ ///
+ /// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-issue")]
+ public async Task SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
+ {
+ var ret = await _transferLibNoteAppService.SplitPacking_IssueAsync(transferLibNoteEditInput, updateJobDetailInput).ConfigureAwait(false);
+ return ret;
+ }
+
+
+
+}
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibRequestController.cs
new file mode 100644
index 000000000..9bb7561e1
--- /dev/null
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferLibRequestController.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.AspNetCore.Mvc;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+
+namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
+
+///
+///
+///
+[ApiController]
+[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-request")]
+
+public class TransferLibRequestController : AbpController
+{
+ private readonly ITransferLibRequestAppService _transferLibRequestAppService;
+
+ ///
+ ///
+ ///
+ ///
+ public TransferLibRequestController(ITransferLibRequestAppService transferLibRequestAppService)
+ {
+ _transferLibRequestAppService = transferLibRequestAppService;
+ }
+
+ ///
+ /// 获取盘点任务详情
+ ///
+ ///
+ ///
+ [HttpGet("{id}")]
+
+ public virtual async Task> GetAsync(Guid id)
+ {
+ var result = await _transferLibRequestAppService.GetAsync(id).ConfigureAwait(false);
+ return Ok(result);
+ }
+
+ ///
+ /// 获取列表 筛选
+ ///
+ ///
+ ///
+ [HttpPost("list")]
+ public virtual async Task> GetListAsync(SfsStoreRequestInputBase sfsRequestDTO)
+ {
+ var list = await _transferLibRequestAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false);
+ return list;
+ }
+
+ ///
+ /// 获取列表
+ ///
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ public virtual async Task> GetListAsync(int pageSize, int pageIndex)
+ {
+
+ var request = new SfsStoreRequestInputBase
+ {
+ MaxResultCount = pageSize,
+ SkipCount = (pageIndex - 1) * pageSize,
+ Sorting = $"{nameof(TransferLibRequestDTO.Number)} ASC",
+ Condition = new Condition
+ {
+ Filters = new List
+ {
+ new(nameof(TransferLibRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="),
+ new(nameof(TransferLibRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==")
+ }
+ }
+ };
+
+ var list = await _transferLibRequestAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false);
+ return list;
+ }
+
+ ///
+ /// 获取任务数量
+ ///
+ ///
+ [HttpGet("count")]
+ public virtual async Task> CountAsync()
+ {
+ var request = new SfsStoreRequestInputBase
+ {
+ Sorting = $"{nameof(TransferLibRequestDTO.Number)} ASC",
+ Condition = new Condition
+ {
+ Filters = new List
+ {
+ new(nameof(TransferLibRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="),
+ new(nameof(TransferLibRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==")
+ }
+ }
+ };
+
+ var count = await _transferLibRequestAppService.GetCountByFilterAsync(request).ConfigureAwait(false);
+
+ return Ok(count);
+ }
+
+ ///
+ /// 根据number获取要料详情
+ ///
+ ///
+ ///
+ [HttpGet("{number}")]
+
+ public virtual async Task> GetAsync(string number)
+ {
+ var result = await _transferLibRequestAppService.GetByNumberAsync(number).ConfigureAwait(false);
+ return Ok(result);
+ }
+
+ ///
+ /// 完成对应的请求
+ ///
+ ///
+ ///
+ [HttpPost("complete/{id}")]
+
+ public virtual async Task CompleteAsync(Guid id)
+ {
+ var entity = await _transferLibRequestAppService.CompleteAsync(id).ConfigureAwait(false);
+ return entity;
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDTO.cs
new file mode 100644
index 000000000..4f7c46397
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDTO.cs
@@ -0,0 +1,50 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 非生产领料任务
+///
+[Display(Name = "非生产领料任务")]
+public class TransferLibJobDTO : SfsJobDTOBase, IHasNumber
+{
+ ///
+ /// 调拨申请单号
+ ///
+ [Display(Name = "调拨申请单号")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ public DateTime? ConfirmTime { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDetailDTO.cs
new file mode 100644
index 000000000..140bc8f91
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/DTOs/TransferLibJobDetailDTO.cs
@@ -0,0 +1,25 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibJobDetailDTO : SfsStoreDetailWithFromToDTOBase
+{
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ public string OnTheWayLocationCode { get; set; }
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs
new file mode 100644
index 000000000..d98931e79
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs
@@ -0,0 +1,7 @@
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public interface ITransferLibJobAppService
+ : ISfsJobAppServiceBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobCheckInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobCheckInput.cs
new file mode 100644
index 000000000..6b606f80a
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobCheckInput.cs
@@ -0,0 +1,6 @@
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibJobCheckInput : SfsJobCheckInputBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobDetailInput.cs
new file mode 100644
index 000000000..c7fc99f54
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobDetailInput.cs
@@ -0,0 +1,29 @@
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Data;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibJobDetailInput : SfsStoreDetailWithFromToInputBase
+{
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobEditInput.cs
new file mode 100644
index 000000000..bcd2cc091
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/Inputs/TransferLibJobEditInput.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput
+{
+ #region Base
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+ #endregion
+
+ #region Update
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ public DateTime? ConfirmTime { get; set; }
+ #endregion
+
+ ///
+ /// 调拨申请单号
+ ///
+ [Display(Name = "调拨申请单号")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+
+ ///
+ /// 任务明细
+ ///
+ [Display(Name = "任务明细")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public List Details { get; set; }
+ public string UpStreamJobNumber { get; set; }
+ public EnumJobType JobType { get; set; }
+ public bool IsAutoComplete { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/TransferLibJobPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/TransferLibJobPermissions.cs
new file mode 100644
index 000000000..de3768e3e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/TransferLibJobPermissions.cs
@@ -0,0 +1,21 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class TransferLibJobPermissions
+{
+
+ public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibJob);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ public static void AddTransferLibJobPermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var IssueJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibJob)));
+ IssueJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ IssueJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ IssueJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDTO.cs
new file mode 100644
index 000000000..ca3b97c07
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDTO.cs
@@ -0,0 +1,47 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-实体DTO
+///
+public class TransferLibNoteDTO : SfsStoreDTOBase, IHasNumber
+{
+ ///
+ /// 调拨申请单号
+ ///
+ [Display(Name = "调拨申请单号")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ public DateTime? ConfirmTime { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDetailDTO.cs
new file mode 100644
index 000000000..21f1b2f9f
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/DTOs/TransferLibNoteDetailDTO.cs
@@ -0,0 +1,28 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-明细表
+///
+public class TransferLibNoteDetailDTO : SfsStoreDetailWithFromToDTOBase
+{
+
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ public string OnTheWayLocationCode { get; set; }
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/ITransferLibNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/ITransferLibNoteAppService.cs
new file mode 100644
index 000000000..548a8cb10
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/ITransferLibNoteAppService.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public interface ITransferLibNoteAppService :
+ ISfsStoreMasterReadOnlyAppServiceBase
+{
+ Task CreateAsync(TransferLibNoteEditInput input);
+
+ Task> GetWipTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetAreaTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetCustomerTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetListForDiffERPLocAsync(
+ SfsStoreRequestInputBase sfsRequestDTO,
+ bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetInsideTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO,
+ bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task ConfirmAsync(Guid id);
+
+ ///
+ /// 库存转移
+ ///
+ ///
+ ///
+ Task> CreateManyAsync(List input);
+
+ ///
+ /// 拆箱
+ ///
+ ///
+ ///
+ Task SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput);
+
+ ///
+ /// 按条件获取拆箱的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task> GetSplitPackingTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ ///
+ /// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
+ ///
+ ///
+ ///
+ ///
+ Task SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput);
+
+ ///
+ /// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
+ ///
+ ///
+ ///
+ ///
+ Task SplitPacking_InspectAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput);
+
+ ///
+ /// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
+ ///
+ ///
+ ///
+ ///
+ Task SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteDetailInput.cs
new file mode 100644
index 000000000..81a4bdb89
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteDetailInput.cs
@@ -0,0 +1,32 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-明细表
+///
+public class TransferLibNoteDetailInput : SfsStoreDetailWithFromToInputBase
+{
+
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Reason { get; set; }
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteEditInput.cs
new file mode 100644
index 000000000..2e45f8df1
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteEditInput.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 新增和更新基础DTO
+///
+public class TransferLibNoteEditInput : SfsStoreCreateOrUpdateInputBase, IHasNumber
+{
+ #region Base
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+ #endregion
+
+ #region Update
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ public DateTime? ConfirmTime { get; set; }
+ #endregion
+
+ ///
+ /// 调拨申请单号
+ ///
+ [Display(Name = "调拨申请单号")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ [Display(Name = "详情")]
+ public List Details { get; set; } = new List();
+ public string Number { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteImportInput.cs
new file mode 100644
index 000000000..4c3652ac0
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/Inputs/TransferLibNoteImportInput.cs
@@ -0,0 +1,85 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using DocumentFormat.OpenXml.Drawing;
+using Win_in.Sfs.Shared.Application.Contracts;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibNoteImportInput : SfsStoreImportInputBase
+{
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [ImporterHeader(Name = "调拨类型")]
+ [ExporterHeader(DisplayName = "调拨类型")]
+ [ValueMapping("区域内调拨(储位内移库)", EnumTransSubType.Transfer_Inside)]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ [ImporterHeader(IsIgnore = true)]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ [ImporterHeader(IsIgnore = true)]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public bool Confirmed { get; set; }
+
+ ///
+ /// 物料号
+ ///
+ [Display(Name = "物料号")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string ItemCode { get; set; }
+
+ ///
+ /// 调拨数量
+ ///
+ [Display(Name = "调拨数量")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 调出库位
+ ///
+ [Display(Name = "调出库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string FromLocationCode { get; set; }
+
+ ///
+ /// 调入库位
+ ///
+ [Display(Name = "调入库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 箱码
+ ///
+ [Display(Name = "箱码")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string PackingCode { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [Display(Name = "状态")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public EnumInventoryStatus Status { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/TransferLibNotePermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/TransferLibNotePermissions.cs
new file mode 100644
index 000000000..1337fc9d0
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferLibNotes/TransferLibNotePermissions.cs
@@ -0,0 +1,41 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class TransferLibNotePermissions
+{
+ public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibNote);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ //线边调拨记录
+ public const string WipTransferLibNote = StorePermissions.GroupName + "." + nameof(WipTransferLibNote);
+ //线边调拨记录确认
+ public const string WipTransferLibNoteConfirm = StorePermissions.GroupName + "." + nameof(WipTransferLibNoteConfirm);
+ //客户调拨记录
+ public const string CustomerTransferLibNote = StorePermissions.GroupName + "." + nameof(CustomerTransferLibNote);
+ //客户调拨记录确认
+ public const string CustomerTransferLibNoteConfirm = StorePermissions.GroupName + "." + nameof(CustomerTransferLibNoteConfirm);
+ //库区间调拨记录
+ public const string BetweenAreaTransferLibNote = StorePermissions.GroupName + "." + nameof(BetweenAreaTransferLibNote);
+ //库区内调拨记录
+ public const string WithinAreaTransferLibNote = StorePermissions.GroupName + "." + nameof(WithinAreaTransferLibNote);
+
+ public static void AddTransferLibNotePermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var transferLibNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibNote)));
+ transferLibNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ transferLibNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ transferLibNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+
+ permissionGroup.AddPermission(WipTransferLibNote, StorePermissionDefinitionProvider.L(nameof(WipTransferLibNote)));
+ permissionGroup.AddPermission(WipTransferLibNoteConfirm, StorePermissionDefinitionProvider.L(nameof(WipTransferLibNoteConfirm)));
+ permissionGroup.AddPermission(CustomerTransferLibNote, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibNote)));
+ permissionGroup.AddPermission(CustomerTransferLibNoteConfirm, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibNoteConfirm)));
+ permissionGroup.AddPermission(BetweenAreaTransferLibNote, StorePermissionDefinitionProvider.L(nameof(BetweenAreaTransferLibNote)));
+ permissionGroup.AddPermission(WithinAreaTransferLibNote, StorePermissionDefinitionProvider.L(nameof(WithinAreaTransferLibNote)));
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDTO.cs
new file mode 100644
index 000000000..924a47290
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDTO.cs
@@ -0,0 +1,23 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-实体DTO
+///
+public class TransferLibRequestDTO : SfsStoreRequestDTOBase, IHasNumber
+{
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDetailDTO.cs
new file mode 100644
index 000000000..afcac60e0
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/DTOs/TransferLibRequestDetailDTO.cs
@@ -0,0 +1,23 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-明细表
+///
+public class TransferLibRequestDetailDTO : SfsStoreDetailWithFromToDTOBase
+{
+
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs
new file mode 100644
index 000000000..c42656894
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs
@@ -0,0 +1,20 @@
+using System.Threading;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public interface ITransferLibRequestAppService
+: ISfsStoreRequestMasterAppServiceBase
+{
+
+ Task> GetListForWipAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetListForERPLocAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+ Task> GetListForCustomAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default);
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestDetailInput.cs
new file mode 100644
index 000000000..d4c93f493
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestDetailInput.cs
@@ -0,0 +1,25 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 库存转移记录-明细表
+///
+public class TransferLibRequestDetailInput : SfsStoreDetailWithFromToInputBase
+{
+ ///
+ /// 原因
+ ///
+ [Display(Name = "原因")]
+ [StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestEditInput.cs
new file mode 100644
index 000000000..0c32b5949
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestEditInput.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 新增和更新基础DTO
+///
+public class TransferLibRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
+{
+ #region Base
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+ #endregion
+
+ #region Create
+ ///
+ /// 转移记录单号
+ ///
+ [Display(Name = "转移记录单号")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Number { get; set; }
+
+ ///
+ /// 明细列表
+ ///
+ [Display(Name = "明细列表")]
+ public List Details { get; set; }
+ #endregion
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestImportInput.cs
new file mode 100644
index 000000000..d58c187c3
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/Inputs/TransferLibRequestImportInput.cs
@@ -0,0 +1,75 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Application.Contracts;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class TransferLibRequestImportInput : SfsStoreImportInputBase
+{
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [ImporterHeader(Name = "调拨类型")]
+ [ExporterHeader(DisplayName = "调拨类型")]
+ [ValueMapping("区域间调拨(储位调拨)", EnumTransSubType.Transfer_Area)]
+ [ValueMapping("线边调拨(线边仓调拨)", EnumTransSubType.Transfer_WIP)]
+ [ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 在途库地址
+ ///
+ [Display(Name = "在途库地址")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 物料号
+ ///
+ [Display(Name = "物料号")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string ItemCode { get; set; }
+
+ ///
+ /// 调拨数量
+ ///
+ [Display(Name = "调拨数量")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 调出库位
+ ///
+ [Display(Name = "调出库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string FromLocationCode { get; set; }
+
+ ///
+ /// 调入库位
+ ///
+ [Display(Name = "调入库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 箱码
+ ///
+ [Display(Name = "箱码")]
+ public string PackingCode { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [Display(Name = "状态")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public EnumInventoryStatus Status { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/TransferLibRequestPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/TransferLibRequestPermissions.cs
new file mode 100644
index 000000000..83115206b
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/TransferLibRequestPermissions.cs
@@ -0,0 +1,29 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class TransferLibRequestPermissions
+{
+ public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibRequest);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ //线边调拨记录
+ public const string WipTransferLibRequest = StorePermissions.GroupName + "." + nameof(WipTransferLibRequest);
+ //客户调拨记录
+ public const string CustomerTransferLibRequest = StorePermissions.GroupName + "." + nameof(CustomerTransferLibRequest);
+
+ public static void AddTransferLibRequestPermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var transferLibRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibRequest)));
+ transferLibRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ transferLibRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ transferLibRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+
+ permissionGroup.AddPermission(WipTransferLibRequest, StorePermissionDefinitionProvider.L(nameof(WipTransferLibRequest)));
+ permissionGroup.AddPermission(CustomerTransferLibRequest, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibRequest)));
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs
new file mode 100644
index 000000000..fd4796d16
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+using Win_in.Sfs.Wms.Store.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+[Authorize]
+[Route($"{StoreConsts.RootPath}transfer-lib-job")]
+
+public class TransferLibJobAppService
+ : SfsJobAppServiceBase,
+ ITransferLibJobAppService
+{
+ public TransferLibJobAppService(
+ ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager
+ ) : base(repository, TransferLibJobManager)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAutoMapperProfile.cs
new file mode 100644
index 000000000..f7ecc2eec
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAutoMapperProfile.cs
@@ -0,0 +1,25 @@
+using AutoMapper;
+using Volo.Abp.AutoMapper;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+public partial class StoreApplicationAutoMapperProfile : Profile
+{
+ private void TransferLibJobAutoMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteAppService.cs
new file mode 100644
index 000000000..2467421e4
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteAppService.cs
@@ -0,0 +1,512 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Basedata.Domain.Shared;
+using Win_in.Sfs.Basedata.SplitPackings.Commons;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Inventory.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+using Win_in.Sfs.Wms.Store.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+///
+/// 调拨转移记录
+///
+[Authorize]
+[Route($"{StoreConsts.RootPath}transferlib-note")]
+public class TransferLibNoteAppService : SfsStoreWithDetailsAppServiceBase
+ ,
+ ITransferLibNoteAppService
+{
+ private readonly ITransferLibNoteManager _transferLibNoteManager;
+ private readonly IBalanceAppService _balanceAppService;
+ private readonly ILocationAppService _locationAppService;
+ private readonly ISplitPackingRecAppService _splitPackingRecAppService;
+ private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService;
+ private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; //采购收货
+ private readonly IInspectJobAppService _inspectJobAppService; //质检
+ private readonly IIssueJobAppService _issueJobAppService; //发料
+
+ private readonly IExpectOutAppService _expectOutAppService; //
+
+
+
+
+
+ public TransferLibNoteAppService(
+ ITransferLibNoteRepository repository,
+ ITransferLibNoteManager transferLibNoteManager,
+ IBalanceAppService balanceAppService,
+ ILocationAppService locationAppService,
+ ISplitPackingRecAppService splitPackingRecAppService,
+ IPurchaseReceiptJobAppService purchaseReceiptJobAppService,
+ IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService,
+ IInspectJobAppService inspectJobAppService,
+ IIssueJobAppService issueJobAppService,
+ IExpectOutAppService expectOutAppService) : base(repository)
+ {
+ _transferLibNoteManager = transferLibNoteManager;
+ _balanceAppService = balanceAppService;
+ _locationAppService = locationAppService;
+ _splitPackingRecAppService = splitPackingRecAppService;
+ _purchaseReceiptJobAppService = purchaseReceiptJobAppService;
+ _purchaseReceiptRequestAppService = purchaseReceiptRequestAppService;
+ _inspectJobAppService = inspectJobAppService;
+ _issueJobAppService = issueJobAppService;
+ _expectOutAppService = expectOutAppService;
+ }
+
+ #region 东阳使用
+
+ ///
+ /// 用来重写 导入数据时可以加工数据
+ ///
+ ///
+ ///
+ protected override async Task> ImportProcessingEntityAsync(
+ Dictionary dictionary)
+ {
+ var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
+
+ foreach (var transferLibNote in addList)
+ {
+ if (transferLibNote.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) //储位内调拨
+ {
+ transferLibNote.Type = EnumTransSubType.Transfer_Inside.ToString();//重点 需要转换
+ foreach (var detail in transferLibNote.Details)
+ {
+ var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode,
+ detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false);
+ var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
+ var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
+
+ CheckLocation(toLocationDto, detail);
+ CheckFromLocation(fromLocationDto, detail);
+ if (toLocationDto.Type != fromLocationDto.Type)
+ {
+ throw new UserFriendlyException($"来源库位与目标库位类型不一致");
+ }
+
+ detail.OnTheWayLocationCode = bool.FalseString;
+ detail.ItemCode=balanceDto.ItemCode;
+ detail.ArriveDate=balanceDto.ArriveDate;
+ detail.ItemDesc1=balanceDto.ItemDesc1;
+ detail.ItemDesc2=balanceDto.ItemDesc2;
+ detail.ItemName=balanceDto.ItemName;
+ detail.ProduceDate=balanceDto.ProduceDate;
+ detail.Qty=balanceDto.Qty;
+ detail.Uom=balanceDto.Uom;
+ detail.ExpireDate=balanceDto.ExpireDate;
+ detail.StdPackQty=balanceDto.StdPackQty;
+ detail.SupplierBatch=balanceDto.SupplierBatch;
+
+ detail.FromLocationArea = balanceDto.LocationArea;
+ detail.FromContainerCode = balanceDto.ContainerCode;
+ detail.FromLocationErpCode = balanceDto.LocationErpCode;
+ detail.FromLocationGroup = balanceDto.LocationGroup;
+ detail.FromPackingCode = balanceDto.PackingCode;
+ detail.FromLocationArea = balanceDto.LocationArea;
+ detail.FromStatus = balanceDto.Status;
+ detail.FromWarehouseCode = balanceDto.WarehouseCode;
+ detail.FromLot = balanceDto.Lot;
+
+ detail.ToLocationArea = toLocationDto.AreaCode;
+ detail.ToLocationErpCode = toLocationDto.ErpLocationCode;
+ detail.ToLocationGroup = toLocationDto.LocationGroupCode;
+ detail.ToWarehouseCode = toLocationDto.WarehouseCode;
+ detail.ToContainerCode = balanceDto.ContainerCode;
+ detail.ToPackingCode = balanceDto.PackingCode;
+ detail.ToLocationArea = balanceDto.LocationArea;
+ detail.ToStatus = balanceDto.Status;
+ detail.ToLot = balanceDto.Lot;
+ }
+ }
+ }
+
+ return dictionary;
+ }
+
+ ///
+ /// 拆箱
+ ///
+ ///
+ ///
+ [HttpPost("split-packing")]
+ public async Task SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput)
+ {
+ //插入拆箱记录表
+ await WriteSplitPackingRec(transferLibNoteEditInput).ConfigureAwait(false);
+ //更新库存
+ transferLibNoteEditInput.Type = EnumTransSubType.Transfer_SplitPacking.ToString();
+ return await CreateAsync(transferLibNoteEditInput).ConfigureAwait(false);
+ }
+
+ #region 校验
+ private void CheckLocation(LocationDTO locationDto, TransferLibNoteDetail detail)
+ {
+ if (locationDto == null)
+ {
+ throw new UserFriendlyException($"库位代码为【{detail.ToLocationCode}】不存在");
+ }
+ }
+ private void CheckFromLocation(LocationDTO locationDto, TransferLibNoteDetail detail)
+ {
+ if (locationDto == null)
+ {
+ throw new UserFriendlyException($"库位代码为【{detail.FromLocationCode}】不存在");
+ }
+ }
+ #endregion
+
+ ///
+ /// 按条件获取拆箱的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-split-packing-list")]
+ public virtual async Task> GetSplitPackingTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_SplitPacking, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取线边调拨的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-wip-list")]
+ public virtual async Task> GetWipTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_WIP, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取储位间调拨的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-erp-loc-list")]
+ public virtual async Task> GetAreaTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Area, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取储位内移库的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-inside-list")]
+ public virtual async Task> GetInsideTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取客户储位间调拨的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-custom-loc-list")]
+ public virtual async Task> GetCustomerTransferListAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Customer, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取储位间调拨的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-diff-erp-loc-list")]
+ public virtual async Task> GetListForDiffERPLocAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Warehouse, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ private async Task> GetSubTypeListAsync(SfsStoreRequestInputBase sfsRequestDTO,
+ EnumTransSubType type, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ sfsRequestDTO.Condition.Filters.Add(new Filter
+ {
+ Action = "==",
+ Column = "Type",
+ Logic = EnumFilterLogic.And.ToString(),
+ Value = type.ToString()
+ });
+
+ var expression = sfsRequestDTO.Condition.Filters?.Count > 0
+ ? sfsRequestDTO.Condition.Filters.ToLambda()
+ : p => true;
+
+ return await GetPagedListAsync(expression, sfsRequestDTO.SkipCount, sfsRequestDTO.MaxResultCount,
+ sfsRequestDTO.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
+ }
+
+ #endregion
+
+ ///
+ /// 库存转移
+ ///
+ ///
+ ///
+ [HttpPost("")]
+ public override async Task CreateAsync(TransferLibNoteEditInput input)
+ {
+ var entity = ObjectMapper.Map(input);
+
+ entity=await _transferLibNoteManager.CreateAsync(entity).ConfigureAwait(false);
+
+ var dto = ObjectMapper.Map(entity);
+
+ return dto;
+ }
+
+ ///
+ /// 【批量】 库存转移
+ ///
+ ///
+ ///
+ [HttpPost("create-many")]
+ public async Task> CreateManyAsync(List input)
+ {
+ var entitys = ObjectMapper.Map, List>(input);
+
+ var resultEntity = new List();
+
+ foreach (var entity in entitys)
+ {
+ resultEntity.Add(await _transferLibNoteManager.CreateAsync(entity).ConfigureAwait(false));
+ _ = ObjectMapper.Map(entity);
+ }
+
+ return ObjectMapper.Map, List>(resultEntity);
+ }
+
+ ///
+ /// 确认对应的记录单
+ ///
+ ///
+ ///
+ [HttpPost("confirm/{id}")]
+ public virtual async Task ConfirmAsync(Guid id)
+ {
+ var entity = await _transferLibNoteManager.ConfirmAsync(id).ConfigureAwait(false);
+ var dto = ObjectMapper.Map(entity);
+ return dto;
+ }
+
+ ///
+ /// 插入拆箱记录表
+ ///
+ ///
+ ///
+ private async Task WriteSplitPackingRec(TransferLibNoteEditInput transferLibNoteEditInput)
+ {
+ List recLst = new List();
+ foreach (var inputDetail in transferLibNoteEditInput.Details)
+ {
+ SplitPackingRecEditInput packRec = new SplitPackingRecEditInput();
+ packRec.OprType = OprTypeEnum.SplitBox;
+ packRec.FromPackingCode = inputDetail.FromPackingCode;
+ //packRec.FromTopPackingCode = inputDetail.;
+ packRec.FromStdPackQty = inputDetail.StdPackQty;
+ packRec.FromUom = inputDetail.Uom;
+ packRec.FromQty = inputDetail.Qty;
+ packRec.ToPackingCode = inputDetail.ToPackingCode;
+ //packRec.ToTopPackingCode = inputDetail.;
+ packRec.ToStdPackQty = inputDetail.StdPackQty;
+ packRec.ToUom = inputDetail.Uom;
+ packRec.ToQty = inputDetail.Qty;
+ packRec.ItemCode = inputDetail.ItemCode;
+ packRec.ItemName = inputDetail.ItemName;
+ packRec.ItemDesc1 = inputDetail.ItemDesc1;
+ packRec.ItemDesc2 = inputDetail.ItemDesc2;
+ packRec.FromLot = inputDetail.FromLot;
+ packRec.ToLot = inputDetail.ToLot;
+ //packRec.PurchaseInfo_PoNumber = inputDetail.; // 采购订单
+ //packRec.PurchaseInfo_AsnNumber = inputDetail.; //供应商发货单
+ //packRec.ArrivalNoticNumber = inputDetail.; //到货通知
+ //packRec.TaskOrderNumber = inputDetail.; //任务单
+ //packRec.ReceiptRecNumber = inputDetail.; //收货记录单
+ //packRec.PutOnShelfNumber = inputDetail.; //上架单
+ recLst.Add(packRec);
+ }
+ var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false);
+ return ret;
+ }
+
+ ///
+ /// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-purchase-receipt")]
+ public async Task SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
+ {
+ var jobRet = await _purchaseReceiptJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false);
+ var requestRet = await _purchaseReceiptRequestAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput, jobRet.PurchaseReceiptRequestNumber).ConfigureAwait(false);
+ bool ret = await WriteSplitPackingRec(transferLibNoteEditInput).ConfigureAwait(false); //采购收货-目检-拆箱时,还没有入库,不涉及库存操作
+ return ret;
+ }
+
+ ///
+ /// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-inspect")]
+ public async Task SplitPacking_InspectAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
+ {
+ //SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
+ //newInput.Number = updateJobDetailInput.Number;
+ //newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
+ //newInput.FromQty = updateJobDetailInput.FromQty;
+ //newInput.ToPackingCode = updateJobDetailInput.ToPackingCode;
+ //newInput.ToQty = updateJobDetailInput.ToQty;
+ //newInput.FromLocationCode = transferLibNoteEditInput.Details[0].FromLocationCode;
+ //newInput.ToLocationCode = transferLibNoteEditInput.Details[0].ToLocationCode;
+ //var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
+ var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false);
+ var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); //库存操作
+ return ret;
+ }
+
+ ///
+ /// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-issue")]
+ public async Task SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
+ {
+ SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
+ newInput.Number = updateJobDetailInput.Number;
+ newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
+ newInput.FromQty = updateJobDetailInput.FromQty;
+ newInput.ToPackingCode = updateJobDetailInput.ToPackingCode;
+ newInput.ToQty = updateJobDetailInput.ToQty;
+ newInput.FromLocationCode = transferLibNoteEditInput.Details[0].FromLocationCode;
+ newInput.ToLocationCode = transferLibNoteEditInput.Details[0].ToLocationCode;
+ var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
+ var jobRet = await _issueJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false);
+ var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); //库存操作
+ return ret;
+ }
+
+ ///
+ /// 拆箱,预计出表存在数据时不允许办理
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("split-packing-check-expect-out")]
+ public async Task SplitPackingCheckExpectOutAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInputBase updateJobDetailInputBase)
+ {
+ var detailObj = transferLibNoteEditInput.Details[0];
+ SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
+ newInput.Number = updateJobDetailInputBase.Number;
+ newInput.FromPackingCode = detailObj.FromPackingCode;
+ newInput.FromQty = detailObj.Qty;
+ newInput.ToPackingCode = detailObj.ToPackingCode;
+ newInput.ToQty = detailObj.Qty;
+ newInput.FromLocationCode = detailObj.FromLocationCode;
+ newInput.ToLocationCode = detailObj.ToLocationCode;
+ var expectOutLst = await _expectOutAppService.GetListByJobNumberAsync(newInput).ConfigureAwait(false);
+ if (expectOutLst.Count > 0)
+ {
+ throw new UserFriendlyException($"预计出表存在数据,不允许办理拆箱:JobNumber={newInput.Number}|PackingCode={newInput.FromPackingCode}|Qty={newInput.FromQty}|LocationCode={newInput.FromLocationCode}");
+ }
+ var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false);
+ return ret;
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteMapperProfile.cs
new file mode 100644
index 000000000..ea28afa69
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/TransferLibNoteMapperProfile.cs
@@ -0,0 +1,79 @@
+using AutoMapper;
+using Volo.Abp.AutoMapper;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+public partial class StoreApplicationAutoMapperProfile : Profile
+{
+ private void TransferLibNoteMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ ;
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ ;
+
+ CreateMap();
+
+ CreateMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.ConfirmTime)
+ .Ignore(x => x.RequestNumber)
+ .Ignore(x => x.JobNumber)
+ .Ignore(x => x.ActiveDate)
+ .Ignore(x => x.Remark)
+ .Ignore(x => x.ExtraProperties)
+ .Ignore(x => x.ConcurrencyStamp)
+ .Ignore(x => x.Details)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode))
+ .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode))
+ .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
+ .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
+ .Ignore(x => x.FromLocationGroup)
+ .Ignore(x => x.FromLocationArea)
+ .Ignore(x => x.FromLocationErpCode)
+ .Ignore(x => x.FromWarehouseCode)
+ .Ignore(x => x.ToLocationArea)
+ .Ignore(x => x.ToLocationGroup)
+ .Ignore(x => x.ToLocationErpCode)
+ .Ignore(x => x.ToWarehouseCode)
+ .Ignore(x => x.Reason)
+ .Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate)
+ .Ignore(x => x.Remark)
+ .Ignore(x => x.ItemName)
+ .Ignore(x => x.ItemDesc1)
+ .Ignore(x => x.ItemDesc2)
+ .Ignore(x => x.FromContainerCode)
+ .Ignore(x => x.ToContainerCode)
+ .Ignore(x => x.FromLot)
+ .Ignore(x => x.ToLot)
+ .Ignore(x => x.StdPackQty)
+ .Ignore(x => x.Uom)
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs
new file mode 100644
index 000000000..4f43dd476
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs
@@ -0,0 +1,384 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Shared.Application.Contracts;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Inventory.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+using Win_in.Sfs.Wms.Store.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+///
+/// 调拨转移记录
+///
+[Authorize]
+[Route($"{StoreConsts.RootPath}transferlib-request")]
+public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase
+ ,
+ ITransferLibRequestAppService
+{
+ private readonly ITransferLibRequestManager _transferLibRequestManager;
+ private readonly IBalanceAppService _balanceAppService;
+ private readonly ILocationAppService _locationAppService;
+
+ public TransferLibRequestAppService(
+ ITransferLibRequestRepository repository,
+ ITransferLibRequestManager transferLibRequestManager,
+ IBalanceAppService balanceAppService,
+ ILocationAppService locationAppService) : base(repository, transferLibRequestManager)
+ {
+ _transferLibRequestManager = transferLibRequestManager;
+ _balanceAppService = balanceAppService;
+ _locationAppService = locationAppService;
+ }
+
+ #region 东阳使用
+
+ ///
+ /// 用来重写 导入数据时可以加工数据
+ ///
+ ///
+ ///
+ protected override async Task> ImportProcessingEntityAsync(
+ Dictionary dictionary)
+ {
+ var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
+
+ foreach (var transferLibRequest in addList)
+ {
+ EnumTransSubType enumTransSubType = EnumTransSubType.None;
+
+ //储位
+ if (transferLibRequest.Type == EnumTransSubType.Transfer_Area.GetDisplayName())
+ {
+ transferLibRequest.Type = EnumTransSubType.Transfer_Area.ToString(); //重点 需要转换
+ enumTransSubType = EnumTransSubType.Transfer_Area;
+ transferLibRequest.UseOnTheWayLocation = false;
+ }
+ //储位内
+ if (transferLibRequest.Type == EnumTransSubType.Transfer_Inside.GetDisplayName())
+ {
+ transferLibRequest.Type = EnumTransSubType.Transfer_Inside.ToString(); //重点 需要转换
+ enumTransSubType = EnumTransSubType.Transfer_Inside;
+ transferLibRequest.UseOnTheWayLocation = false;
+ }
+
+ //库间
+ if (transferLibRequest.Type == EnumTransSubType.Transfer_Warehouse.GetDisplayName())
+ {
+ transferLibRequest.Type = EnumTransSubType.Transfer_Warehouse.ToString(); //重点 需要转换
+ enumTransSubType = EnumTransSubType.Transfer_Warehouse;
+ transferLibRequest.UseOnTheWayLocation = true;
+ }
+ //客户储位
+ if (transferLibRequest.Type == EnumTransSubType.Transfer_Customer.GetDisplayName())
+ {
+ transferLibRequest.Type = EnumTransSubType.Transfer_Customer.ToString(); //重点 需要转换
+ enumTransSubType = EnumTransSubType.Transfer_Customer;
+ transferLibRequest.UseOnTheWayLocation = true;
+ }
+ //线边调拨
+ if (transferLibRequest.Type == EnumTransSubType.Transfer_WIP.GetDisplayName())
+ {
+ transferLibRequest.Type = EnumTransSubType.Transfer_WIP.ToString(); //重点 需要转换
+ enumTransSubType = EnumTransSubType.Transfer_WIP;
+ transferLibRequest.UseOnTheWayLocation = true;
+ }
+
+ foreach (var detail in transferLibRequest.Details)
+ {
+ var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode,
+ detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false);
+ var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode)
+ .ConfigureAwait(false);
+ var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode)
+ .ConfigureAwait(false);
+
+ CheckLocation(toLocationDto, detail.ToLocationCode);
+ CheckLocation(fromLocationDto, detail.FromLocationCode);
+ if (toLocationDto.Type != fromLocationDto.Type)
+ {
+ throw new UserFriendlyException($"来源库位与目标库位类型不一致");
+ }
+
+ detail.ItemCode = balanceDto.ItemCode;
+ detail.ArriveDate = balanceDto.ArriveDate;
+ detail.ItemDesc1 = balanceDto.ItemDesc1;
+ detail.ItemDesc2 = balanceDto.ItemDesc2;
+ detail.ItemName = balanceDto.ItemName;
+ detail.ProduceDate = balanceDto.ProduceDate;
+ detail.Qty = detail.Qty;
+ detail.Uom = balanceDto.Uom;
+ detail.ExpireDate = balanceDto.ExpireDate;
+ detail.StdPackQty = balanceDto.StdPackQty;
+ detail.SupplierBatch = balanceDto.SupplierBatch;
+
+ detail.FromLocationArea = balanceDto.LocationArea;
+ detail.FromContainerCode = balanceDto.ContainerCode;
+ detail.FromLocationErpCode = balanceDto.LocationErpCode;
+ detail.FromLocationGroup = balanceDto.LocationGroup;
+ detail.FromPackingCode = balanceDto.PackingCode;
+ detail.FromLocationArea = balanceDto.LocationArea;
+ detail.FromStatus = balanceDto.Status;
+ detail.FromWarehouseCode = balanceDto.WarehouseCode;
+ detail.FromLot = balanceDto.Lot;
+
+ detail.ToLocationArea = toLocationDto.AreaCode;
+ detail.ToLocationErpCode = toLocationDto.ErpLocationCode;
+ detail.ToLocationGroup = toLocationDto.LocationGroupCode;
+ detail.ToWarehouseCode = toLocationDto.WarehouseCode;
+ detail.ToContainerCode = balanceDto.ContainerCode;
+ detail.ToPackingCode = balanceDto.PackingCode;
+ detail.ToLocationArea = balanceDto.LocationArea;
+ detail.ToStatus = balanceDto.Status;
+ detail.ToLot = balanceDto.Lot;
+ }
+
+ await SetEntityPropertiesAsync(transferLibRequest, enumTransSubType)
+ .ConfigureAwait(false);
+ }
+
+ return dictionary;
+ }
+
+ #region 校验
+ private void CheckLocation(LocationDTO locationDTO, string locationCode)
+ {
+ if (locationDTO == null)
+ {
+ throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
+ }
+ }
+ #endregion
+
+ private async Task SetEntityPropertiesAsync(TransferLibRequest entity, EnumTransSubType subType)
+ {
+ var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType)
+ .ConfigureAwait(false);
+ Check.NotNull(tranType, "事务类型", "事务类型不存在");
+ entity.Worker = CurrentUser.GetUserName();
+
+ entity.AutoCompleteJob = tranType.AutoCompleteJob;
+ entity.AutoSubmit = tranType.AutoSubmitRequest;
+ entity.AutoAgree = tranType.AutoAgreeRequest;
+ entity.AutoHandle = tranType.AutoHandleRequest;
+ entity.DirectCreateNote = tranType.DirectCreateNote;
+ }
+
+ #region 查询相关
+
+ ///
+ /// 按条件获取【客户储位间调拨】的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-custom-loc-list")]
+ public virtual async Task> GetListForCustomAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Customer, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取【储位间调拨】的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-erp-loc-list")]
+ public virtual async Task> GetListForERPLocAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Area, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取【储位内移库】的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-custom-inside-list")]
+ public virtual async Task> GetListForInsideAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取【线边调拨】的分页列表
+ /// request sample
+ /// {
+ /// "maxResultCount": 1000,
+ /// "skipCount": 0,
+ /// "sorting": "",
+ /// "condition": { "filters": []}
+ /// }
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("get-wip-list")]
+ public virtual async Task> GetListForWipAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_WIP, includeDetails,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// 按条件获取分页列表
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private async Task> GetListForOtherBaseAsync(
+ SfsStoreRequestInputBase sfsRequestDTO, EnumTransSubType type, bool includeDetails = false,
+ CancellationToken cancellationToken = default)
+ {
+ sfsRequestDTO.Condition.Filters.Add(new Filter
+ {
+ Action = "==", Column = "Type", Logic = EnumFilterLogic.And.ToString(), Value = type.ToString()
+ });
+
+ var expression = sfsRequestDTO.Condition.Filters?.Count > 0
+ ? sfsRequestDTO.Condition.Filters.ToLambda()
+ : p => true;
+
+ return await GetPagedListAsync(expression, sfsRequestDTO.SkipCount, sfsRequestDTO.MaxResultCount,
+ sfsRequestDTO.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
+ }
+
+ #endregion
+
+ #endregion
+
+
+ ///
+ /// 【创建】库移请求
+ ///
+ ///
+ ///
+ [HttpPost("")]
+ public override async Task CreateAsync(TransferLibRequestEditInput input)
+ {
+ var entity = ObjectMapper.Map(input);
+
+ var subType = Enum.Parse(input.Type);
+ var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType)
+ .ConfigureAwait(false);
+ entity.Type = ((int)subType).ToString();
+ entity.AutoCompleteJob = tranType.AutoCompleteJob;
+ entity.AutoSubmit = tranType.AutoSubmitRequest;
+ entity.AutoAgree = tranType.AutoAgreeRequest;
+ entity.AutoHandle = tranType.AutoHandleRequest;
+ entity.DirectCreateNote = tranType.DirectCreateNote;
+
+ await _transferLibRequestManager.CreateAsync(entity).ConfigureAwait(false);
+
+ var dto = ObjectMapper.Map(entity);
+
+ return dto;
+ }
+
+ protected async Task CheckFromLocationAsync(string locationCode, List validationRresult)
+ {
+ var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false);
+ if (location == null)
+ {
+ validationRresult.Add("来源库位代码", $"来源库位代码{locationCode}不存在");
+ }
+ }
+
+ protected virtual async Task CheckImportInputBusinessAsync(TransferLibRequestImportInput importInput,
+ EnumImportMethod importMethod, List validationRresult)
+ {
+ ChecktQty(importInput, validationRresult);
+ await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false);
+
+ await CheckFromLocationAsync(importInput.FromLocationCode, validationRresult).ConfigureAwait(false);
+ await CheckToLocationAsync(importInput.ToLocationCode, validationRresult).ConfigureAwait(false);
+ }
+
+ protected async Task CheckItemBasicAsync(TransferLibRequestImportInput importInput,
+ List validationRresult)
+ {
+ var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false);
+ if (item == null)
+ {
+ validationRresult.Add("物品代码", $"物品代码{importInput.ItemCode}不存在");
+ }
+
+ if (importInput.Qty <= 0)
+ {
+ validationRresult.Add("调整数量", $"调整数量{importInput.Qty}必须大于0");
+ }
+ }
+
+ protected async Task CheckToLocationAsync(string locationCode, List validationRresult)
+ {
+ var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false);
+ if (location == null)
+ {
+ validationRresult.Add("目标库位代码", $"目标库位代码{locationCode}不存在");
+ }
+ }
+
+ protected void ChecktQty(TransferLibRequestImportInput importInput, List validationRresult)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestMapperProfile.cs
new file mode 100644
index 000000000..9d0327fb8
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestMapperProfile.cs
@@ -0,0 +1,69 @@
+using AutoMapper;
+using Volo.Abp.AutoMapper;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application;
+
+public partial class StoreApplicationAutoMapperProfile : Profile
+{
+ private void TransferLibRequestMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap();
+
+ CreateMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.ActiveDate)
+ .Ignore(x => x.Remark)
+ .Ignore(x => x.ExtraProperties)
+ .Ignore(x => x.ConcurrencyStamp)
+ .Ignore(x => x.RequestStatus)
+ .Ignore(x => x.Details)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode ?? string.Empty))
+ .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode ?? string.Empty))
+ .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
+ .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
+ .Ignore(x => x.FromLocationGroup)
+ .Ignore(x => x.FromLocationArea)
+ .Ignore(x => x.FromLocationErpCode)
+ .Ignore(x => x.FromWarehouseCode)
+ .Ignore(x => x.ToLocationArea)
+ .Ignore(x => x.ToLocationGroup)
+ .Ignore(x => x.ToLocationErpCode)
+ .Ignore(x => x.ToWarehouseCode)
+ .Ignore(x => x.Reason)
+ .Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate)
+ .Ignore(x => x.Remark)
+ .Ignore(x => x.ItemName)
+ .Ignore(x => x.ItemDesc1)
+ .Ignore(x => x.ItemDesc2)
+ .Ignore(x => x.FromContainerCode)
+ .Ignore(x => x.ToContainerCode)
+ .Ignore(x => x.FromLot)
+ .Ignore(x => x.ToLot)
+ .Ignore(x => x.StdPackQty)
+ .Ignore(x => x.Uom)
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs
index 3cd3760a5..d1a07929e 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs
@@ -20,6 +20,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
UnplannedIssueRequestAutoMapperProfile();
UnplannedReceiptRequestAutoMapperProfile();
TransferRequestMapperProfile();
+ TransferLibRequestMapperProfile();
PurchaseReturnRequestAutoMapperProfile();
ProductRecycleRequestAutoMapperProfile();
PutawayRequestAutoMapperProfile();
@@ -114,6 +115,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
ExchangeDataAutoMapperProfile();
EquipmentRecordAutoMapperProfile();
-
+ TransferLibJobAutoMapperProfile();
}
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobManager.cs
new file mode 100644
index 000000000..dbb6d6d62
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobManager.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibJobManager : IJobManager
+{
+ Task GetAsync(Expression> expression);
+ Task UpdateAsync(TransferLibJob issueJob);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobRepository.cs
new file mode 100644
index 000000000..71cdc8aa7
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/ITransferLibJobRepository.cs
@@ -0,0 +1,6 @@
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibJobRepository : ISfsJobRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJob.cs
new file mode 100644
index 000000000..fa4dc9919
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJob.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Threading.Tasks;
+using Volo.Abp.Data;
+using Win_in.Sfs.Shared.Domain.Entities;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 计划外出库任务
+///
+[Display(Name = "计划外出库任务")]
+public class TransferLibJob : SfsJobAggregateRootBase
+{
+ ///
+ /// 申请单号
+ ///
+ [IgnoreUpdate]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务单号
+ ///
+ [IgnoreUpdate]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ [Required(ErrorMessage = "调拨类型不能为空")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ [IgnoreUpdate]
+ public DateTime? ConfirmTime { get; set; }
+
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+
+ ///
+ /// 任务明细
+ ///
+ [IgnoreUpdate]
+ public override List Details { get; set; } = new List();
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobDetail.cs
new file mode 100644
index 000000000..287480739
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobDetail.cs
@@ -0,0 +1,25 @@
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Data;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class TransferLibJobDetail : SfsStoreDetailWithFromToEntityBase
+{
+ ///
+ /// 中间库地址
+ ///
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 原因
+ ///
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobManager.cs
new file mode 100644
index 000000000..c9a5ae4fb
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/TransferLibJobs/TransferLibJobManager.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+using Volo.Abp.Users;
+using Volo.Abp.Validation;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class TransferLibJobManager : SfsJobManagerBase, ITransferLibJobManager
+{
+
+ public TransferLibJobManager(
+ ITransferLibJobRepository repository
+ ) : base(repository)
+ {
+ }
+
+ public override void CheckDetails(TransferLibJob entity, AbpValidationResult result)
+ {
+ throw new NotImplementedException();
+ }
+
+ public async Task GetAsync(Expression> expression)
+ {
+ return await Repository.FindAsync(expression).ConfigureAwait(false);
+ }
+
+ public override Task> GetWorkingListByContainerAsync(string containerCode)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override Task> GetWorkingListByPackingAsync(string packingCode)
+ {
+ throw new NotImplementedException();
+ }
+
+ public async Task UpdateAsync(TransferLibJob TransferLibJob)
+ {
+ await Repository.UpdateAsync(TransferLibJob).ConfigureAwait(false);
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteManager.cs
new file mode 100644
index 000000000..e7d39056d
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteManager.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Threading.Tasks;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibNoteManager : ISfsStoreManager, IBulkImportService
+{
+ Task ConfirmAsync(Guid id);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteRepository.cs
new file mode 100644
index 000000000..3b912a83d
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/ITransferLibNoteRepository.cs
@@ -0,0 +1,8 @@
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibNoteRepository : ISfsStoreRepositoryBase, ISfsBulkRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNote.cs
new file mode 100644
index 000000000..9776cc17a
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNote.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp;
+using Win_in.Sfs.Shared.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 调拨转移记录
+///
+public class TransferLibNote : SfsStoreAggregateRootBase, IHasJobNumber
+{
+
+ ///
+ /// 申请单号
+ ///
+ [IgnoreUpdate]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 任务单号
+ ///
+ [IgnoreUpdate]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ [Required(ErrorMessage = "调拨类型不能为空")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ [IgnoreUpdate]
+ public DateTime? ConfirmTime { get; set; }
+
+ ///
+ /// 明细列表
+ ///
+ [IgnoreUpdate]
+ public override List Details { get; set; } = new List();
+
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+
+ public void Confirm(DateTime confirmTime)
+ {
+
+ CheckStatus(Confirmed);
+ Confirmed = true;
+ ConfirmTime = confirmTime;
+ }
+
+ private static void CheckStatus(bool confirmed)
+ {
+ if (confirmed)
+ {
+ throw new UserFriendlyException($"当前状态为 【已确认】 ,无法再次确认!");
+ }
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteDetail.cs
new file mode 100644
index 000000000..12c31ba6f
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteDetail.cs
@@ -0,0 +1,26 @@
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 库存转移记录-明细表
+///
+public class TransferLibNoteDetail : SfsStoreDetailWithFromToEntityBase
+{
+
+ ///
+ /// 中间库地址
+ ///
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 原因
+ ///
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteManager.cs
new file mode 100644
index 000000000..20a70d244
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/TransferLibNotes/TransferLibNoteManager.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Volo.Abp;
+using Volo.Abp.Uow;
+using Win_in.Sfs.Shared.Event;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class TransferLibNoteManager : SfsStoreManagerBase, ITransferLibNoteManager
+{
+
+ private readonly ITransferLibNoteRepository _repository;
+
+ public TransferLibNoteManager(
+ ITransferLibNoteRepository repository
+ ) : base(repository)
+ {
+ _repository = repository;
+ }
+
+ [UnitOfWork]
+ public virtual async Task ConfirmAsync(Guid id)
+ {
+ var entity = await Repository.FindAsync(id).ConfigureAwait(false);
+ Check.NotNull(entity, EntityClassName);
+ entity.Confirm(Clock.Now);
+ await PublishConfirmedAsync(entity).ConfigureAwait(false);
+ return await Repository.UpdateAsync(entity).ConfigureAwait(false);
+ }
+
+ private async Task PublishConfirmedAsync(TransferLibNote entity)
+ {
+ try
+ {
+ await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(entity), false).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ Logger.LogDebug($"{nameof(TransferLibNote)} Confirmed Event:{ex.Message}", null);
+ Console.WriteLine(ex.Source);
+ throw;
+ }
+ }
+
+ ///
+ /// 执行导入
+ ///
+ public virtual async Task ImportDataAsync(List mergeEntities, List deleteEntities = null)
+ {
+ if (deleteEntities != null && deleteEntities.Count > 0)
+ {
+ await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
+ }
+
+ foreach (var entity in mergeEntities)
+ {
+ entity.SetIdAndNumberWithDetails(GuidGenerator, await GenerateNumberAsync(nameof(TransferLibNote), Clock.Now).ConfigureAwait(false));
+ }
+
+ await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false);
+
+ var insertDetails = new List();
+
+ foreach (var item in mergeEntities)
+ {
+ await SetDetailAsync(item.Details).ConfigureAwait(false);
+
+ insertDetails.AddRange(item.Details);
+ }
+
+ await _repository.BulkInsertAsync(insertDetails).ConfigureAwait(false);
+ }
+
+ private async Task SetDetailAsync(List details)
+ {
+ foreach (var detail in details)
+ {
+ var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
+ Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在");
+
+ if (item != null)
+ {
+ detail.ItemName = item.Name;
+ detail.ItemDesc1 = item.Desc1;
+ detail.ItemDesc2 = item.Desc2;
+ }
+
+ var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false);
+
+ Check.NotNull(balance, "库存", $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!");
+
+ detail.SupplierBatch = balance.SupplierBatch;
+ detail.ArriveDate = balance.ArriveDate;
+ detail.ProduceDate = balance.ProduceDate;
+ detail.ExpireDate = balance.ExpireDate;
+
+ //通过箱码和库位获取库存信息
+ detail.FromStatus = balance.Status;
+
+ detail.FromLot = balance.Lot;
+ detail.FromWarehouseCode = balance.WarehouseCode;
+ detail.FromContainerCode = balance.ContainerCode;
+
+ detail.ToLot = balance.Lot;
+ detail.ToWarehouseCode = balance.WarehouseCode;
+ detail.ToContainerCode = balance.ContainerCode;
+
+ detail.ToStatus = balance.Status;
+
+ }
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestManager.cs
new file mode 100644
index 000000000..ec499a59e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestManager.cs
@@ -0,0 +1,8 @@
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibRequestManager : ISfsStoreRequestManager, IBulkImportService
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestRepository.cs
new file mode 100644
index 000000000..fe570bdf5
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/ITransferLibRequestRepository.cs
@@ -0,0 +1,8 @@
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface ITransferLibRequestRepository : ISfsStoreRepositoryBase, ISfsBulkRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequest.cs
new file mode 100644
index 000000000..18b1eabe3
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequest.cs
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 调拨申请
+///
+public class TransferLibRequest : SfsStoreRequestAggregateRootBase
+{
+
+ ///
+ /// 调拨类型
+ ///
+ [Display(Name = "调拨类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 使用中间库
+ ///
+ [Display(Name = "使用中间库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 明细列表
+ ///
+ [IgnoreUpdate]
+ public override List Details { get; set; } = new List();
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestDetail.cs
new file mode 100644
index 000000000..16637ceaa
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestDetail.cs
@@ -0,0 +1,24 @@
+using System.Text.Json;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class TransferLibRequestDetail : SfsStoreDetailWithFromToEntityBase
+{
+
+ ///
+ /// 原因代码
+ ///
+ public string Reason { get; set; }
+
+ ///
+ /// 执行任务状态
+ ///
+ public EnumJobStatus JobStatus { get; set; }
+
+ public override string ToString()
+ {
+ return JsonSerializer.Serialize(this);
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestManager.cs
new file mode 100644
index 000000000..31d512142
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/TransferLibRequests/TransferLibRequestManager.cs
@@ -0,0 +1,75 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class TransferLibRequestManager : SfsStoreRequestManagerBase, ITransferLibRequestManager
+{
+ private readonly ITransferLibRequestRepository _repository;
+
+ public TransferLibRequestManager(
+ ITransferLibRequestRepository repository
+ ) : base(repository)
+ {
+ _repository = repository;
+ }
+
+ ///
+ /// 执行导入
+ ///
+ public virtual async Task ImportDataAsync(List transferLibRequests, List deleteEntities = null)
+ {
+ if (deleteEntities != null && deleteEntities.Count > 0)
+ {
+ await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
+ }
+
+ _ = new List();
+
+ foreach (var item in transferLibRequests)
+ {
+ await BuildDetailAsync(item.Details).ConfigureAwait(false);
+ }
+
+ await CreateManyAsync(transferLibRequests).ConfigureAwait(false);
+ }
+
+ private async Task BuildDetailAsync(List details)
+ {
+ foreach (var detail in details)
+ {
+ var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
+ Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在");
+
+ if (item != null)
+ {
+ detail.ItemName = item.Name;
+ detail.ItemDesc1 = item.Desc1;
+ detail.ItemDesc2 = item.Desc2;
+ }
+
+ var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false);
+
+ Check.NotNull(balance, "库存", $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!");
+
+ detail.SupplierBatch = balance.SupplierBatch;
+ detail.ArriveDate = balance.ArriveDate;
+ detail.ProduceDate = balance.ProduceDate;
+ detail.ExpireDate = balance.ExpireDate;
+
+ //通过箱码和库位获取库存信息
+ detail.FromStatus = balance.Status;
+
+ detail.FromLot = balance.Lot;
+ detail.FromWarehouseCode = balance.WarehouseCode;
+ detail.FromContainerCode = balance.ContainerCode;
+
+ detail.ToLot = balance.Lot;
+ detail.ToWarehouseCode = balance.WarehouseCode;
+ detail.ToContainerCode = balance.ContainerCode;
+
+ detail.ToStatus = balance.Status;
+ }
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
index 3e88393d3..33e6c1708 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
@@ -16,6 +16,9 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet ItemTransformRequests { get; }
public DbSet TransferRequests { get; }
+
+ public DbSet TransferLibRequests { get; }
+
public DbSet ProductReceiptRequests { get; }
public DbSet MaterialRequests { get; }
public DbSet InjectionRequests { get; }
@@ -58,6 +61,9 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet ItemTransformNotes { get; }
public DbSet RecycledMaterialReceiptNotes { get; }
public DbSet TransferNotes { get; }
+
+ public DbSet TransferLibNotes { get; }
+
public DbSet JisProductReceiptNotes { get; }
public DbSet ProductReceiptNotes { get; }
public DbSet OfflineSettlementNotes { get; }
@@ -109,6 +115,8 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet UnplannedReceiptJobs { get; }
public DbSet ProductionReturnJobs { get; }
+ public DbSet TransferLibJobs { get; }
+
#endregion
public DbSet ExchangeDatas { get; }
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..2597e8524
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobDbContextModelCreatingExtensions.cs
@@ -0,0 +1,52 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.EntityFrameworkCore;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
+
+public static class TransferLibJobDbContextModelCreatingExtensions
+{
+ public static void ConfigureTransferLibJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(TransferLibJob), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsBase();
+ //Configure Job base properties
+ b.ConfigureJob();
+ //Properties
+ //b.Property(q => q.DeptCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ //b.Property(q => q.DeptName).HasMaxLength(SfsPropertyConst.NameLength);
+ //b.Property(q => q.TransferLibRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
+ //Relations
+ b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
+ //Indexes
+ b.HasIndex(q => new { q.Number }).IsUnique();
+ });
+
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(TransferLibJobDetail), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsBase();
+ //Configure Job base properties
+ //b.ConfigureJobRecommendFromDetail();
+ //Properties
+
+ //Relations
+ //None
+
+ //Indexes
+ //b.HasIndex(q => new { q.PackingCode }).IsUnique();
+ });
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobEfCoreRepository.cs
new file mode 100644
index 000000000..7a12c870e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/TransferLibJobs/TransferLibJobEfCoreRepository.cs
@@ -0,0 +1,11 @@
+using Volo.Abp.EntityFrameworkCore;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
+
+public class TransferLibJobEfCoreRepository : SfsJobEfCoreRepositoryBase, ITransferLibJobRepository
+{
+ public TransferLibJobEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240223055707_temp.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240223055707_temp.cs
deleted file mode 100644
index 058326ded..000000000
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240223055707_temp.cs
+++ /dev/null
@@ -1,8075 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Win_in.Sfs.Wms.Store.Migrations
-{
- public partial class temp : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Job_CheckJob",
- columns: table => new
- {
- Id = table.Column(type: "uniqueidentifier", nullable: false),
- DeliverNoteNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
- CreationTime = table.Column(type: "datetime2", nullable: false),
- CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
- LastModificationTime = table.Column(type: "datetime2", nullable: true),
- LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
- TenantId = table.Column(type: "uniqueidentifier", nullable: true),
- Remark = table.Column(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
- Worker = table.Column(type: "nvarchar(max)", nullable: true),
- Number = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- UpStreamJobNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- JobDescription = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
- JobType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- JobStatus = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- Priority = table.Column(type: "int", nullable: false, defaultValue: 0),
- PriorityIncrement = table.Column(type: "int", nullable: false, defaultValue: 0),
- WorkGroupCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- IsAutoComplete = table.Column(type: "bit", nullable: false, defaultValue: false),
- AcceptUserId = table.Column(type: "uniqueidentifier", nullable: true),
- AcceptUserName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- AcceptTime = table.Column(type: "datetime2", nullable: true),
- CompleteUserId = table.Column(type: "uniqueidentifier", nullable: true),
- CompleteUserName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- CompleteTime = table.Column(type: "datetime2", nullable: true),
- WarehouseCode = table.Column(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Job_CheckJob", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Job_CountJob",
- columns: table => new
- {
- Id = table.Column(type: "uniqueidentifier", nullable: false),
- CountPlanNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- CountStage = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- CountMethod = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- Description = table.Column(type: "nvarchar(max)", nullable: true),
- ItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- LocationCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
- CreationTime = table.Column(type: "datetime2", nullable: false),
- CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
- LastModificationTime = table.Column(type: "datetime2", nullable: true),
- LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
- TenantId = table.Column(type: "uniqueidentifier", nullable: true),
- Remark = table.Column(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
- Worker = table.Column(type: "nvarchar(max)", nullable: true),
- Number = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- UpStreamJobNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- JobDescription = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
- JobType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- JobStatus = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- Priority = table.Column(type: "int", nullable: false, defaultValue: 0),
- PriorityIncrement = table.Column(type: "int", nullable: false, defaultValue: 0),
- WorkGroupCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- IsAutoComplete = table.Column(type: "bit", nullable: false, defaultValue: false),
- AcceptUserId = table.Column(type: "uniqueidentifier", nullable: true),
- AcceptUserName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- AcceptTime = table.Column(type: "datetime2", nullable: true),
- CompleteUserId = table.Column(type: "uniqueidentifier", nullable: true),
- CompleteUserName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- CompleteTime = table.Column(type: "datetime2", nullable: true),
- WarehouseCode = table.Column(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Job_CountJob", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Job_DeliverJob",
- columns: table => new
- {
- Id = table.Column(type: "uniqueidentifier", nullable: false),
- DeliverRequestNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- CustomerCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- CustomerAddressCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- DeliverTime = table.Column(type: "datetime2", nullable: false),
- DeliverPlanNumber = table.Column(type: "nvarchar(max)", nullable: true),
- ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
- CreationTime = table.Column(type: "datetime2", nullable: false),
- CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
- LastModificationTime = table.Column(type: "datetime2", nullable: true),
- LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
- TenantId = table.Column(type: "uniqueidentifier", nullable: true),
- Remark = table.Column(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
- Worker = table.Column(type: "nvarchar(max)", nullable: true),
- Number = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
- UpStreamJobNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
- JobDescription = table.Column