diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs
index 33fdd9dc1..fbffb43a2 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/DTOs/EquipmentDTO.cs
@@ -16,7 +16,7 @@ public class EquipmentDTO : SfsBaseDataDTOBase, IHasCode
/// 类型
///
[Display(Name = "类型")]
- public EnumContainerType Type { get; set; }
+ public string Type { get; set; }
///
/// 器具编号
///
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs
index 29f3c2020..03b54c027 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentEditInput.cs
@@ -12,7 +12,7 @@ public class EquipmentEditInput : SfsBaseDataCreateOrUpdateInputBase
/// 类型
///
[Display(Name = "类型")]
- public EnumContainerType Type { get; set; }
+ public string Type { get; set; }
///
/// 器具编号
///
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs
index 88d88bfce..b06546790 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Equipments/Inputs/EquipmentImportInput.cs
@@ -12,7 +12,7 @@ public class EquipmentImportInput : SfsBaseDataImportInputBase
/// 类型
///
[Display(Name = "类型")]
- public EnumContainerType Type { get; set; }
+ public string Type { get; set; }
///
/// 器具编号
///
@@ -37,7 +37,7 @@ public class EquipmentImportInput : SfsBaseDataImportInputBase
/// 库位编号
///
[Display(Name = "库位代码")]
- //[Required(ErrorMessage = "{0}是必填项")]
+ [Required(ErrorMessage = "{0}是必填项")]
public string LocCode { get; set; } = string.Empty;
///
/// 状态
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
index 1a620f23a..aae825f3f 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
@@ -212,3 +212,8 @@ public class BomAppService :
}
+
+
+
+
+
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Enum/EnumBomSelectedType.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Enum/EnumBomSelectedType.cs
new file mode 100644
index 000000000..6db151b9e
--- /dev/null
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Enum/EnumBomSelectedType.cs
@@ -0,0 +1,24 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Basedata.Domain.Shared;
+
+public enum EnumBomSelectedType
+{
+ ///
+ /// 树状
+ ///
+ [Display(Name = "树装")]
+ Tree = 0,
+ ///
+ /// 一维
+ ///
+ [Display(Name = "一维")]
+ Dimension = 1,
+
+ ///
+ /// 最终子节点
+ ///
+ [Display(Name = "最终子节点")]
+ Last = 2,
+
+}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomComponent.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomComponent.cs
new file mode 100644
index 000000000..9a61976a2
--- /dev/null
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomComponent.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Basedata.Boms;
+public class BomComponent
+{
+ public string Root { get; set; }
+ public string Component { get; set; }
+ public string ComponentUom { get; set; }
+ public decimal ComponentQty { get; set; }
+
+
+ public string ParentComponent { get; set; }
+
+ public decimal SumQty { get; set; }
+ public int Level { get; set; }
+ public List SubComponents { get; set; }
+}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
index 2479c3625..d22087315 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
@@ -4,9 +4,13 @@ using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
+using Omu.ValueInjecter;
using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
+using Win_in.Sfs.Basedata.Boms;
+using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@@ -213,6 +217,134 @@ public class BomManager : DomainService, IBomManager
}
return lst;
}
+
+ ///
+ /// Bom操作
+ ///
+ ///
+ ///
+ ///
+ private async Task> GetSubcomponentsRecursiveLast(BomComponent p_component, EnumBomSelectedType p_type
+ )
+ {
+ List lastList = new List();
+ List dimensionList=new List();
+ var treeList=await GetSubcomponentsRecursive(p_component, 1, p_component.ComponentQty, p_component.Component,
+ (rs) => lastList.Add(rs)
+ ,
+ (rs1)=>{
+ dimensionList.Add(rs1);
+ }).ConfigureAwait(false);
+
+
+
+ List lastBomList = new List();
+ List dimensionBomList = new List();
+ List treeBomList = new List();
+ foreach (var itm in dimensionList)
+ {
+ Bom bom = new Bom();
+ bom.InjectFrom(itm);
+ dimensionBomList.Add(bom);
+ }
+ foreach (var itm in lastList)
+ {
+ Bom bom = new Bom();
+ bom.InjectFrom(itm);
+ lastBomList.Add(bom);
+ }
+ foreach (var itm in treeList)
+ {
+ Bom bom = new Bom();
+ bom.InjectFrom(itm);
+ treeBomList.Add(bom);
+ }
+ List returnList=new List();
+ switch (p_type)
+ {
+ case EnumBomSelectedType.Last:
+ returnList.AddRange(lastBomList);
+ break;
+ case EnumBomSelectedType.Tree:
+ returnList.AddRange(treeBomList);
+ break;
+ case EnumBomSelectedType.Dimension:
+ returnList.AddRange(dimensionBomList);
+ break;
+ }
+ return returnList;
+ }
+
+ ///
+ /// 层级、拆解、一维结构、树状结构
+ ///
+ /// 上级组件(初始时为根元素)
+ /// 层级一般为1
+ /// 累计数量
+ /// 根
+ /// 拆解到最终零件时
+ /// 树型转成一维表用
+ ///
+ private async Task> GetSubcomponentsRecursive(BomComponent p_component, int level, decimal sumQty, string root, Action p_actionLast,
+ Action p_actionDimension
+ )
+ {
+ List subComponents = new List();
+ // 假设 GetComponentsByProduct 方法可获取某个物料号下的所有子零件
+ List directSubComponents =await GetComponentsByProduct(p_component.Component).ConfigureAwait(false);
+
+ if (!directSubComponents.Any() && level != 1)//不是根元素
+ {
+ p_actionLast(p_component);
+ }
+ foreach (var component in directSubComponents)
+ {
+ component.Root = root;
+ component.SumQty = sumQty * component.ComponentQty;
+ component.ParentComponent = p_component.Component;
+ component.Level = level;
+ component.SubComponents =await GetSubcomponentsRecursive(component, level + 1, sumQty * component.ComponentQty, component.Root, p_actionLast, p_actionDimension).ConfigureAwait(false);
+ p_actionDimension(component);
+ subComponents.Add(component);
+ }
+ return subComponents;
+ }
+
+ private async Task> GetComponentsByProduct(string product)
+ {
+
+ var list= await _repository.GetListAsync(p => p.Product == product).ConfigureAwait(false);
+ List components = new List();
+ foreach (var component in list)
+ {
+ BomComponent bomComponent = new BomComponent();
+ bomComponent.InjectFrom(component);
+ components.Add(bomComponent);
+ }
+
+
+ // 其他物料号的子零件信息类似添加
+ return components;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
///
/// 获取所有bomtree
///
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs
index 154422405..c57ae54f6 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Equipments/Equipment.cs
@@ -22,7 +22,7 @@ public class Equipment : SfsBaseDataAggregateRootBase, IHasCode
///
/// 器具类型
///
- public EnumContainerType Type { get; set; }
+ public string Type { get; set; }
///
/// 器具规格
///
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Win_in.Sfs.Basedata.Domain.csproj b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Win_in.Sfs.Basedata.Domain.csproj
index 7caf3bd8e..2011bcbb2 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Win_in.Sfs.Basedata.Domain.csproj
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Win_in.Sfs.Basedata.Domain.csproj
@@ -8,6 +8,7 @@
+
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Equipments/EquipmentDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Equipments/EquipmentDbContextModelCreatingExtensions.cs
index e45466955..1d2edbf0f 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Equipments/EquipmentDbContextModelCreatingExtensions.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Equipments/EquipmentDbContextModelCreatingExtensions.cs
@@ -21,6 +21,8 @@ public static class EquipmentDbContextModelCreatingExtensions
//Properties
b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true);
+ b.Property(q => q.Model).HasMaxLength(SfsPropertyConst.CodeLength);
+
b.Property(q => q.Model).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.LocCode).HasMaxLength(SfsPropertyConst.CodeLength);
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs
index a8408e666..dc94a25de 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs
@@ -50,7 +50,7 @@ public class BalanceAppService
ILocationAclService locationAclService,
IItemBasicAclService itemBasicAclService,
IItemBasicAppService itemBasicAppService,
- IStdCostPriceSheetAppService stdCostPriceSheetAppService) : base(repository)
+ IStdCostPriceSheetAppService stdCostPriceSheetAppService) : base(repository)
{
_repository = repository;
_transferLogManager = transferLogManager;
@@ -654,24 +654,19 @@ public class BalanceAppService
{
input.Condition.Filters.Add(new Filter("ContainerCode", listInput.containerCode));
}
-
if (listInput.locationTypes != null && listInput.locationTypes.Any())
{
var locationCodes = (await _locationAclService.GetListByTypesAsync(listInput.locationTypes).ConfigureAwait(false)).Select(t => t.Code).ToList();
-
if (locationCodes.Any())
{
input.Condition.Filters.Add(new Filter("LocationCode", JsonSerializer.Serialize(locationCodes), "In"));
}
}
-
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
{
input.Condition.Filters.Add(new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
}
-
var balanceDTOs = await GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
-
return balanceDTOs;
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDTO.cs
new file mode 100644
index 000000000..a3f522c74
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDTO.cs
@@ -0,0 +1,46 @@
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+///
+/// 三方库库移任务
+///
+[Display(Name = "三方库库移任务")]
+public class ThirdLocationJobDTO : SfsJobDTOBase
+{
+ ///
+ /// 叫料请求类型
+ ///
+ [Display(Name = "叫料请求类型")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestType { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 要货申请单号
+ ///
+ [Display(Name = "要货申请单号")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [Display(Name = "车间")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Workshop { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [Display(Name = "使用在途库")]
+ public bool UseOnTheWayLocation { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs
new file mode 100644
index 000000000..509727793
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs
@@ -0,0 +1,112 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasToLocation
+{
+
+ ///
+ /// 请求库位
+ ///
+ [Display(Name = "请求库位")]
+ public string RequestLocationCode { get; set; }
+
+ ///
+ /// 到库位
+ ///
+ [Display(Name = "到库位")]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 到库区
+ ///
+ [Display(Name = "到库区")]
+ public string ToLocationArea { get; set; }
+
+ ///
+ /// 到库位组
+ ///
+ [Display(Name = "到库位组")]
+ public string ToLocationGroup { get; set; }
+
+ ///
+ /// 到ERP库位
+ ///
+ [Display(Name = "到ERP库位")]
+ public string ToLocationErpCode { get; set; }
+
+ ///
+ /// 到仓库
+ ///
+ [Display(Name = "到仓库")]
+ public string ToWarehouseCode { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ [Display(Name = "在途库库位")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [Display(Name = "工作中心")]
+ public string WorkStation { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 工序
+ ///
+ [Display(Name = "工序")]
+ public string Operation { get; set; }
+
+ ///
+ /// 配送方式
+ ///
+ [Display(Name = "配送方式")]
+ public EnumDistributionType DistributionType { get; set; }
+
+ ///
+ /// 取整方式
+ ///
+ [Display(Name = "取整方式")]
+ public EnumTruncType TruncType { get; set; }
+
+ ///
+ /// 取整后数量
+ ///
+ [Display(Name = "取整后数量")]
+ public decimal RoundedQty { get; set; }
+
+ ///
+ /// 计划拆分规则
+ ///
+ [Display(Name = "计划拆分规则")]
+ public EnumPlannedSplitRule PlannedSplitRule { get; set; }
+
+ ///
+ /// 计划开始时间
+ ///
+ [Display(Name = "计划开始时间")]
+ public DateTime PlanBeginTime { get; set; }
+
+ ///
+ /// 每次配送数量
+ ///
+ [Display(Name = "每次配送数量")]
+ public decimal DeliveryQty { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs
new file mode 100644
index 000000000..8bb1eef89
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs
@@ -0,0 +1,26 @@
+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 IThirdLocationJobAppService
+ : ISfsJobAppServiceBase
+{
+ Task> CheckJobExistByItemCodeAndLocationCode(string itemCode, string locationCode);
+
+ Task CancelByMaterialRequestAsync(string thirdLocationNumber);
+
+ Task> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType,
+ bool includeDetails = false, CancellationToken cancellationToken = default);
+
+ Task> GetByRequestNumberAsync(string requestNumber);
+
+ ///
+ /// 保存拆箱时涉及的明细修改
+ ///
+ ///
+ Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input);
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobCheckInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobCheckInput.cs
new file mode 100644
index 000000000..3ababbe79
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobCheckInput.cs
@@ -0,0 +1,6 @@
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationJobCheckInput : SfsJobCheckInputBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs
new file mode 100644
index 000000000..c41ae9bff
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs
@@ -0,0 +1,134 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLocation
+{
+
+ ///
+ /// 请求库位
+ ///
+ [Display(Name = "请求库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestLocationCode { get; set; }
+
+ ///
+ /// 到库位
+ ///
+ [Display(Name = "到库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 到库区
+ ///
+ [Display(Name = "到库区")]
+ public string ToLocationArea { get; set; }
+
+ ///
+ /// 到库位组
+ ///
+ [Display(Name = "到库位组")]
+ public string ToLocationGroup { get; set; }
+
+ ///
+ /// 到ERP库位
+ ///
+ [Display(Name = "到ERP库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ToLocationErpCode { get; set; }
+
+ ///
+ /// 到仓库
+ ///
+ [Display(Name = "到仓库")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ToWarehouseCode { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ [Display(Name = "在途库库位")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [Display(Name = "工作中心")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string WorkStation { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 工序
+ ///
+ [Display(Name = "工序")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Operation { get; set; }
+
+ ///
+ /// 配送方式
+ ///
+ [Display(Name = "配送方式")]
+ public EnumDistributionType DistributionType { get; set; }
+
+ ///
+ /// 取整方式
+ ///
+ [Display(Name = "取整方式")]
+ public EnumTruncType TruncType { get; set; }
+
+ ///
+ /// 取整后数量
+ ///
+ [Display(Name = "取整后数量")]
+ public decimal RoundedQty { get; set; }
+
+ ///
+ /// 计划拆分规则
+ ///
+ [Display(Name = "计划拆分规则")]
+ public EnumPlannedSplitRule PlannedSplitRule { get; set; }
+
+ ///
+ /// 计划开始时间
+ ///
+ [Display(Name = "计划开始时间")]
+ public DateTime PlanBeginTime { get; set; }
+
+ ///
+ /// 每次配送数量
+ ///
+ [Display(Name = "每次配送数量")]
+ public decimal DeliveryQty { get; set; }
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobEditInput.cs
new file mode 100644
index 000000000..18a65ca49
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobEditInput.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+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 ThirdLocationJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput
+{
+ #region Create
+ ///
+ /// 上游任务编号
+ ///
+ [Display(Name = "上游任务编号")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string UpStreamJobNumber { get; set; }
+
+ ///
+ /// 要货单号
+ ///
+ [Display(Name = "要货单号")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 叫料请求类型
+ ///
+ [Display(Name = "叫料请求类型")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestType { get; set; }
+
+ ///
+ /// 任务类型
+ ///
+ [Display(Name = "任务类型")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public EnumJobType JobType { get; set; }
+
+ ///
+ /// 是否自动完成
+ ///
+ [Display(Name = "是否自动完成")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public bool IsAutoComplete { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 任务明细
+ ///
+ [Display(Name = "任务明细")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public List Details { get; set; } = new();
+
+ ///
+ /// 车间
+ ///
+ [Display(Name = "车间")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Workshop { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [Display(Name = "使用在途库")]
+ public bool UseOnTheWayLocation { get; set; }
+ #endregion
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/ThirdLocationJobPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/ThirdLocationJobPermissions.cs
new file mode 100644
index 000000000..be4151800
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/ThirdLocationJobPermissions.cs
@@ -0,0 +1,27 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class ThirdLocationJobPermissions
+{
+
+ public const string Default = StorePermissions.GroupName + "." + nameof(ThirdLocationJob);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ //自动发料任务
+ public const string AutoThirdLocationJob = StorePermissions.GroupName + "." + nameof(AutoThirdLocationJob);
+
+ public static void AddThirdLocationJobPermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var thirdLocationJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ThirdLocationJob)));
+ thirdLocationJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ thirdLocationJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ thirdLocationJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+
+ permissionGroup.AddPermission(AutoThirdLocationJob, StorePermissionDefinitionProvider.L(nameof(AutoThirdLocationJob)));
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/DTOs/ThirdLocationNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/DTOs/ThirdLocationNoteDTO.cs
new file mode 100644
index 000000000..ea67e0660
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/DTOs/ThirdLocationNoteDTO.cs
@@ -0,0 +1,54 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationNoteDTO : SfsStoreDTOBase, IHasJobNumber, IHasRequestNumber
+{
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [Display(Name = "车间")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Workshop { get; set; }
+
+ ///
+ /// 请求代码
+ ///
+ [Display(Name = "请求代码")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 叫料请求类型
+ ///
+ [Display(Name = "叫料请求类型")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestType { 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/ThirdLocationNotes/DTOs/ThirdLocationNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/DTOs/ThirdLocationNoteDetailDTO.cs
new file mode 100644
index 000000000..5b0413a05
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/DTOs/ThirdLocationNoteDetailDTO.cs
@@ -0,0 +1,42 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase
+{
+
+ ///
+ /// 发料时间
+ ///
+ [Display(Name = "发料时间")]
+ public DateTime IssueTime { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [Display(Name = "工作中心")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string WorkStation { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ [Display(Name = "在途库库位")]
+ public string OnTheWayLocationCode { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/IThirdLocationNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/IThirdLocationNoteAppService.cs
new file mode 100644
index 000000000..3befdb64d
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/IThirdLocationNoteAppService.cs
@@ -0,0 +1,21 @@
+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 IThirdLocationNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase
+{
+ Task CreateAsync(ThirdLocationNoteEditInput input);
+
+ Task ConfirmAsync(Guid id);
+
+ Task ConfirmAsync(string number);
+
+ Task> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
+ string requestType, bool includeDetails = false, CancellationToken cancellationToken = default);
+
+ Task> GetListUnConfirmedByTypeAsync(string requestType);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteDetailInput.cs
new file mode 100644
index 000000000..46aad25fa
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteDetailInput.cs
@@ -0,0 +1,53 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBase
+{
+
+ ///
+ /// 发料时间
+ ///
+ [Display(Name = "发料时间")]
+ public DateTime IssueTime { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [Display(Name = "工作中心")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string WorkStation { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ [Display(Name = "在途库库位")]
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteEditInput.cs
new file mode 100644
index 000000000..371588dab
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteEditInput.cs
@@ -0,0 +1,63 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationNoteEditInput : SfsStoreCreateOrUpdateInputBase
+{
+ #region Base
+ ///
+ /// 已确认
+ ///
+ [Display(Name = "已确认")]
+ public bool Confirmed { get; set; }
+ #endregion
+
+ #region Create
+ ///
+ /// 发料记录号
+ ///
+ [Display(Name = "发料记录号")]
+ public string Number { get; set; }
+
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [Display(Name = "车间")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string Workshop { get; set; }
+
+ ///
+ /// 明细列表
+ ///
+ [Display(Name = "明细列表")]
+ public List Details { get; set; }
+
+ ///
+ /// 请求号码
+ ///
+ [Display(Name = "请求号码")]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 叫料请求类型
+ ///
+ [Display(Name = "叫料请求类型")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string RequestType { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [Display(Name = "使用在途库")]
+ public bool UseOnTheWayLocation { get; set; }
+ #endregion
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteImportInput.cs
new file mode 100644
index 000000000..f267c18ea
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/Inputs/ThirdLocationNoteImportInput.cs
@@ -0,0 +1,33 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber
+{
+ ///
+ /// 任务ID
+ ///
+ [Display(Name = "任务ID")]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [Display(Name = "车间")]
+ public string Workshop { get; set; }
+
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 叫料请求类型
+ ///
+ [Display(Name = "叫料请求类型")]
+ public string RequestType { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [Display(Name = "使用在途库")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public bool UseOnTheWayLocation { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/ThirdLocationNotePermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/ThirdLocationNotePermissions.cs
new file mode 100644
index 000000000..79e634b2c
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/ThirdLocationNotePermissions.cs
@@ -0,0 +1,30 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class ThirdLocationNotePermissions
+{
+
+ public const string Default = StorePermissions.GroupName + "." + nameof(ThirdLocationNote);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ //自动发料记录
+ public const string AutoThirdLocationNote = StorePermissions.GroupName + "." + nameof(AutoThirdLocationNote);
+
+ //直接发料
+ public const string DirectThirdLocationNote = StorePermissions.GroupName + "." + nameof(DirectThirdLocationNote);
+
+ public static void AddThirdLocationNotePermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var thirdLocationNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ThirdLocationNote)));
+ thirdLocationNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ thirdLocationNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ thirdLocationNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+
+ permissionGroup.AddPermission(AutoThirdLocationNote, StorePermissionDefinitionProvider.L(nameof(AutoThirdLocationNote)));
+ permissionGroup.AddPermission(DirectThirdLocationNote, StorePermissionDefinitionProvider.L(nameof(DirectThirdLocationNote)));
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
index 9c8dad174..f58153b14 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
@@ -28,10 +28,12 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddMaterialRequestPermission();
storeGroup.AddInjectionRequestPermission();
storeGroup.AddAssembleRequestPermission();
+ storeGroup.AddThirdLocationRequestPermission();
storeGroup.AddContainerRequestPermission();
storeGroup.AddIssueNotePermission();
storeGroup.AddInjectionNotePermission();
storeGroup.AddAssembleNotePermission();
+ storeGroup.AddThirdLocationNotePermission();
storeGroup.AddContainerNotePermission();
storeGroup.AddUnplannedReceiptNotePermission();
storeGroup.AddUnplannedIssueNotePermission();
@@ -98,6 +100,7 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddIssueJobPermission();
storeGroup.AddInjectionJobPermission();
storeGroup.AddAssembleJobPermission();
+ storeGroup.AddThirdLocationJobPermission();
storeGroup.AddContainerJobPermission();
storeGroup.AddDeliverJobPermission();
storeGroup.AddPurchaseReturnJobPermission();
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs
new file mode 100644
index 000000000..b5b062fae
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs
@@ -0,0 +1,40 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationRequestDTO : SfsStoreRequestDTOBase, IHasNumber
+{
+ ///
+ /// 叫料类型
+ ///
+ [Display(Name = "叫料类型")]
+ public string Type { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 是否使用在途库
+ ///
+ [Display(Name = "是否使用在途库")]
+ public bool IsUseOnTheWayLocation { get; set; }
+
+ ///
+ /// 可用来源库位Json集合
+ ///
+ public string FromLocationCodeJsonList { get; set; }
+
+ ///
+ /// 叫料库位
+ ///
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 目标ERP储位
+ ///
+ [Display(Name = "目标ERP储位")]
+ public string ToLocationErpCode { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
new file mode 100644
index 000000000..bd0610ac6
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
@@ -0,0 +1,50 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
+{
+ ///
+ /// 已发数量
+ ///
+ [Display(Name = "已发数量")]
+ public decimal IssuedQty { get; set; }
+
+ ///
+ /// 已收数量
+ ///
+ [Display(Name = "已收数量")]
+ public decimal ReceivedQty { get; set; }
+
+ ///
+ /// 明细状态
+ ///
+ [Display(Name = "明细状态")]
+ public EnumStatus Status { get; set; }
+
+ ///
+ /// 请求未发
+ ///
+ [Display(Name = "请求未发")]
+ [NotMapped]
+ public decimal ToBeIssuedQty => Qty - IssuedQty;
+
+ ///
+ /// 已发未收
+ ///
+ [Display(Name = "已发未收")]
+ [NotMapped]
+ public decimal ToBeReceivedQty => IssuedQty - ReceivedQty;
+
+ ///
+ /// 请求未收
+ ///
+ [Display(Name = "请求未收")]
+ [NotMapped]
+ public decimal NotFinishQty => Qty - ReceivedQty;
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/IThirdLocationRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/IThirdLocationRequestAppService.cs
new file mode 100644
index 000000000..e1f47cb2d
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/IThirdLocationRequestAppService.cs
@@ -0,0 +1,13 @@
+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 IThirdLocationRequestAppService
+ : ISfsStoreRequestMasterAppServiceBase
+
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
new file mode 100644
index 000000000..913c639c2
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
@@ -0,0 +1,85 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase
+{
+ ///
+ /// 目标库位
+ ///
+ [Display(Name = "目标库位")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 来源库区
+ ///
+ [Display(Name = "来源库区")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string FromLocationArea { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ [Display(Name = "工作中心")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string WorkStation { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ [Display(Name = "过期时间")]
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 状态
+ ///
+ [Display(Name = "状态")]
+ public EnumRequestStatus RequestStatus { get; set; } = EnumRequestStatus.New;
+
+ ///
+ /// ERP储位
+ ///
+ [Display(Name = "ERP储位")]
+ public string ToLocationErpCode { get; set; }
+
+ ///
+ /// 已发数量
+ ///
+ [Display(Name = "已发数量")]
+ public decimal IssuedQty { get; set; }
+
+ ///
+ /// 已收数量
+ ///
+ [Display(Name = "已收数量")]
+ public decimal ReceivedQty { get; set; }
+
+ ///
+ /// 明细状态
+ ///
+ [Display(Name = "明细状态")]
+ public EnumStatus Status { get; set; }
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs
new file mode 100644
index 000000000..cbe39ea9c
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public class ThirdLocationRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
+{
+ #region Base
+
+ ///
+ /// 生产线
+ ///
+ [Display(Name = "生产线")]
+ [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
+ public string ProdLine { 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 string Type { get; set; }
+
+
+ ///
+ /// 明细列表
+ ///
+ [Display(Name = "明细列表")]
+ public List Details { get; set; } = new List();
+ #endregion
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestImportInput.cs
new file mode 100644
index 000000000..e4d261306
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestImportInput.cs
@@ -0,0 +1,53 @@
+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;
+
+[Display(Name = "三方库叫料申请")]
+public class ThirdLocationRequestImportInput : SfsStoreImportInputBase
+{
+ ///
+ /// 叫料类型
+ ///
+ [Display(Name = "叫料类型")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ [ImporterHeader(Name = "叫料类型")]
+ [ExporterHeader(DisplayName = "叫料类型")]
+ [ValueMapping("人工拉动", EnumMaterialRequestType.Issue_Manual)]
+ public string Type { get; set; }
+
+ ///
+ /// 物品代码
+ ///
+ [Display(Name = "物品代码")]
+ [Required]
+ public string ItemCode { get; set; }
+
+ ///
+ /// 目标库位
+ ///
+ [Display(Name = "目标库位")]
+ [Required]
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 来源库区
+ ///
+ [Display(Name = "调出库区")]
+ [Required]
+ public string FromLocationArea { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "数量")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [Display(Name = "备注")]
+ public string Remark { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/ThirdLocationRequestPermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/ThirdLocationRequestPermissions.cs
new file mode 100644
index 000000000..f1ed68079
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/ThirdLocationRequestPermissions.cs
@@ -0,0 +1,27 @@
+using Volo.Abp.Authorization.Permissions;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Application.Contracts;
+
+public static class ThirdLocationRequestPermissions
+{
+
+ public const string Default = StorePermissions.GroupName + "." + nameof(ThirdLocationRequest);
+ public const string Create = Default + "." + StorePermissions.CreateStr;
+ public const string Update = Default + "." + StorePermissions.UpdateStr;
+ public const string Delete = Default + "." + StorePermissions.DeleteStr;
+
+ //自动叫料申请
+ public const string AutoThirdLocationRequest = StorePermissions.GroupName + "." + nameof(AutoThirdLocationRequest);
+
+ public static void AddThirdLocationRequestPermission(this PermissionGroupDefinition permissionGroup)
+ {
+ var thirdLocationRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ThirdLocationRequest)));
+ thirdLocationRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
+ thirdLocationRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
+ thirdLocationRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
+
+ permissionGroup.AddPermission(AutoThirdLocationRequest, StorePermissionDefinitionProvider.L(nameof(AutoThirdLocationRequest)));
+
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs
new file mode 100644
index 000000000..6a631835f
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.ObjectMapping;
+using Win_in.Sfs.Basedata.Domain.Shared;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+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}third-location-job")]
+public class ThirdLocationJobAppService
+ : SfsJobAppServiceBase,
+ IThirdLocationJobAppService
+{
+ private readonly IThirdLocationJobManager _thirdLocationJobManager;
+
+ public ThirdLocationJobAppService(
+ IThirdLocationJobRepository repository, IThirdLocationJobManager thirdLocationJobManager
+ ) : base(repository, thirdLocationJobManager)
+ {
+ _thirdLocationJobManager = thirdLocationJobManager;
+ }
+
+ ///
+ /// 根据物品和库位 检查是否存在发料任务
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Authorize]
+ [HttpGet("check-job-exist")]
+ public virtual async Task> CheckJobExistByItemCodeAndLocationCode(string itemCode,
+ string locationCode)
+ {
+ var entities = await _repository.GetListAsync(c =>
+ c.Details.Any(p =>
+ (p.ItemCode == itemCode && p.RecommendFromLocationCode == locationCode) ||
+ (p.ItemCode == itemCode && p.ToLocationCode == locationCode))
+ && (c.JobStatus == EnumJobStatus.Open || c.JobStatus == EnumJobStatus.Doing), true).ConfigureAwait(false);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return dtos;
+ }
+
+ [HttpPost("cancel-by-request/{assembleNumber}")]
+ public virtual async Task CancelByMaterialRequestAsync(string assembleNumber)
+ {
+ var entities = await _repository.GetListAsync(p => p.RequestNumber == assembleNumber).ConfigureAwait(false);
+ foreach (var entity in entities)
+ {
+ await _thirdLocationJobManager.CancelAsync(entity).ConfigureAwait(false);
+ }
+ }
+
+ [HttpPost("invalid")]
+ public override async Task CancelAsync(Guid id)
+ {
+ var thirdLocationJob = await _repository.GetAsync(id).ConfigureAwait(false);
+ if (thirdLocationJob == null)
+ {
+ throw new UserFriendlyException($"未找到ID为 {id} 的任务");
+ }
+
+ await _thirdLocationJobManager.CancelAsync(thirdLocationJob).ConfigureAwait(false);
+
+ }
+
+ ///
+ /// 根据叫料请求类型获取发料任务
+ ///
+ ///
+ ///
+ /// 叫料请求类型:
+ /// 人工拉动:Issue_Manual;
+ /// 线边拉动:Issue_WIP;
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("by-type/{requestType}")]
+ public virtual async Task> GetListByTypeAsync(SfsJobRequestInputBase requestInput,
+ string requestType, bool includeDetails = false, CancellationToken cancellationToken = default)
+ {
+ Expression> expression = p => p.RequestType == requestType;
+ if (requestInput.Condition.Filters?.Count > 0)
+ {
+ expression = expression.And(requestInput.Condition.Filters.ToLambda());
+ }
+
+ return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
+ requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
+
+ }
+
+ [HttpPost("by-request-number/{requestNumber}")]
+ public virtual async Task> GetByRequestNumberAsync(string requestNumber)
+ {
+ var entitys = await _repository.GetListAsync(p => p.RequestNumber == requestNumber).ConfigureAwait(false);
+ return ObjectMapper.Map, List>(entitys);
+ }
+
+ ///
+ /// 保存拆箱时涉及的明细修改
+ ///
+ ///
+ [HttpPost("save-detail-split-packing")]
+ public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input)
+ {
+ var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false);
+ ThirdLocationJobDetail detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode ); /*&& p.HandledQty == input.FromQty*/
+ if (detail == null)
+ {
+ //throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取ThirdLocationJobDetail表为空!");
+ throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取ThirdLocationJobDetail表为空!");
+ }
+ //插入目标箱
+ var newDetail = CommonHelper.CloneObj(detail);
+ newDetail.SetId(GuidGenerator.Create());
+ newDetail.RecommendPackingCode = input.ToPackingCode;
+ newDetail.RecommendQty = input.ToQty;
+ newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值
+ newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0;
+ //newDetail.CreationTime = CommonHelper.CurTime;
+ job.Details.Add(newDetail);
+ //修改源箱
+ detail.RecommendQty = input.FromQty - input.ToQty;
+ detail.HandledQty = detail.HandledQty > 0 ? input.FromQty - input.ToQty : 0;
+ var entity = await _repository.UpdateAsync(job).ConfigureAwait(false);
+ var ret = ObjectMapper.Map(entity);
+ return ret;
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAutoMapperProfile.cs
new file mode 100644
index 000000000..d35e38e61
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAutoMapperProfile.cs
@@ -0,0 +1,29 @@
+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 ThirdLocationJobAutoMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ ;
+
+ CreateMap()
+ ;
+
+ 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/MesNotes/MesNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs
index 86d8c6e5d..66fcf43a8 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs
@@ -17,9 +17,11 @@ namespace Win_in.Sfs.Wms.Store.Application;
using System.Collections.Generic;
using System.Linq;
using IdentityModel;
+using Omu.ValueInjecter;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
+using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
@@ -33,11 +35,14 @@ public class MesNoteAppService :
IMesNoteAppService
{
private readonly ILocationAppService _locationAppService;
- private readonly IItemBasicAppService _itemBasicAppService;
+ private readonly IBomAppService _bomAppService;
+ private readonly IItemBasicAppService _itemBasicAppService;
private readonly IBalanceAppService _balanceAppService;
public MesNoteAppService(
+ IBomAppService bomAppService,
IMesNoteRepository repository, ILocationAppService locationAppService, IItemBasicAppService itemBasicAppService,IBalanceAppService balanceAppService) : base(repository)
{
+ _bomAppService = bomAppService;
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_balanceAppService = balanceAppService;
@@ -51,12 +56,18 @@ public class MesNoteAppService :
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(MesNote), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
+ SfsInventoryRequestInputBase pm = new SfsInventoryRequestInputBase();
+ // pm.Condition.Filters.Add(new Filter() { Column="", Action= });
+ // _balanceAppService.GetBalancePagedListByFilterAsync();
foreach (var detail in entity.Details)
{
var fromLocation=await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
var toLocation =await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
-
+ if (fromLocation == null)
+ {
+ throw new UserFriendlyException($"库位为空");
+ }
detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number);
detail.FromLocationArea = fromLocation.AreaCode;
detail.FromLocationErpCode = fromLocation.ErpLocationCode;
@@ -71,24 +82,26 @@ public class MesNoteAppService :
detail.StdPackQty = itemBasicDto.StdPackQty;
#region 添加校验
- RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput();
- rInput.ItemCode = detail.ItemCode;
- rInput.Locations = new List() { detail.FromLocationCode };
- rInput.Qty = detail.Qty;
- rInput.Statuses = new List { EnumInventoryStatus.OK };
- var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false);
- var first = balanceLst.FirstOrDefault();
- if (first != null)
- {
- if (detail.Qty <= first.Qty)
- {
- throw new UserFriendlyException($"库存数量不足");
- }
- }
- else
- {
- throw new UserFriendlyException($"库存数量不足");
- }
+
+ //RecommendBalanceRequestInput rInput = new RecommendBalanceRequestInput();
+ //rInput.ItemCode = detail.ItemCode;
+ //rInput.Locations = new List() { detail.FromLocationCode };
+ //rInput.Qty = detail.Qty;
+ //rInput.Statuses = new List { EnumInventoryStatus.OK };
+ //var balanceLst = await _balanceAppService.GetRecommendBalancesByLocationsAsync(rInput).ConfigureAwait(false);
+ //var first = balanceLst.FirstOrDefault();
+ //if (first != null)
+ //{
+ // if (detail.Qty <= first.Qty)
+ // {
+ // throw new UserFriendlyException($"库存数量不足");
+ // }
+ //}
+ //else
+ //{
+ // throw new UserFriendlyException($"库存数量不足");
+ //}
+
#endregion
}
@@ -115,4 +128,8 @@ public class MesNoteAppService :
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
}
+
+
+
+
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs
index 3577dcc3c..5202e5882 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs
@@ -37,9 +37,7 @@ public class ProductionReturnNoteAppService :
public override async Task CreateAsync(ProductionReturnNoteEditInput input)
{
var entity = ObjectMapper.Map(input);
-
await _ProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false);
-
var dto = ObjectMapper.Map(entity);
return dto;
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAppService.cs
new file mode 100644
index 000000000..57fe10118
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAppService.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Domain.Entities;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Event;
+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}third-location-note")]
+public class ThirdLocationNoteAppService :
+ SfsStoreWithDetailsAppServiceBase,
+ IThirdLocationNoteAppService
+{
+ private readonly IThirdLocationNoteManager _thirdLocationNoteManager;
+
+ public ThirdLocationNoteAppService(
+ IThirdLocationNoteRepository repository,
+ IThirdLocationNoteManager thirdLocationNoteManager
+ ) : base(repository)
+ {
+ _thirdLocationNoteManager = thirdLocationNoteManager;
+ }
+
+ [HttpPost("")]
+ //[Authorize(ThirdLocationNotePermissions.Create)]
+ public override async Task CreateAsync(ThirdLocationNoteEditInput input)
+ {
+ var entity = ObjectMapper.Map(input);
+ await _thirdLocationNoteManager.CreateAsync(entity).ConfigureAwait(false);
+ var dto = ObjectMapper.Map(entity);
+ return dto;
+ }
+
+ ///
+ /// 确认对应的记录单
+ ///
+ ///
+ ///
+ [HttpPost("confirm/{id}")]
+ public virtual async Task ConfirmAsync(Guid id)
+ {
+ var thirdLocationNote= await _repository.GetAsync(id).ConfigureAwait(false);
+ thirdLocationNote.Confirmed = true;
+ thirdLocationNote=await _repository.UpdateAsync(thirdLocationNote).ConfigureAwait(false);
+ await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(thirdLocationNote), false).ConfigureAwait(false);
+ return ObjectMapper.Map(thirdLocationNote);
+ }
+
+ [HttpPost("confirm-by-number/{number}")]
+ public virtual async Task ConfirmAsync(string number)
+ {
+ var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
+ Check.NotNull(entity, nameof(ThirdLocationNote));
+ var result = await _thirdLocationNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
+ var dto = ObjectMapper.Map(result);
+ return dto;
+ }
+ ///
+ /// 根据叫料请求类型获取发料记录
+ ///
+ ///
+ ///
+ /// 叫料请求类型:
+ /// 人工拉动:Issue_Manual;
+ /// 线边拉动:Issue_WIP;
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("by-type/{requestType}")]
+ public virtual async Task> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
+ string requestType, bool includeDetails = false, CancellationToken cancellationToken = default)
+ {
+ Expression> expression = p => p.RequestType == requestType;
+ if (requestInput.Condition.Filters?.Count > 0)
+ {
+ expression = expression.And(requestInput.Condition.Filters.ToLambda());
+ }
+
+ return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
+ requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
+ }
+
+ [HttpGet("list/un-confirmed/{requestType}")]
+ public virtual async Task> GetListUnConfirmedByTypeAsync(string requestType)
+ {
+ var entities = await _repository.GetListAsync(c => !c.Confirmed && c.RequestType == requestType)
+ .ConfigureAwait(false);
+
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ return dtos;
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAutoMapperProfile.cs
new file mode 100644
index 000000000..ec4f83f69
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAutoMapperProfile.cs
@@ -0,0 +1,31 @@
+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 ThirdLocationNoteAutoMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .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/ProductionReturnRequests/ProductionReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs
index 617bc4e55..c8756eb35 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAppService.cs
@@ -32,6 +32,10 @@ public class ProductionReturnRequestAppService :
private readonly IPurchaseOrderAppService _purchaseOrderApp;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly ILocationAppService _locationAppService;
+ private readonly IBalanceAppService _balanceAppservice;
+
+
+
public ProductionReturnRequestAppService(
IProductionReturnRequestRepository repository,
@@ -39,7 +43,11 @@ public class ProductionReturnRequestAppService :
IItemStoreRelationAppService itemStoreRelationApp,
IPurchaseOrderAppService purchaseOrderApp,
IItemBasicAppService itemBasicAppService,
- ILocationAppService locationAppService)
+ ILocationAppService locationAppService,
+ IBalanceAppService _balanceAppservice
+
+
+ )
: base(repository, productionRequestReturnManager)
{
_productionReturnRequestManager = productionRequestReturnManager;
@@ -58,6 +66,18 @@ public class ProductionReturnRequestAppService :
//[Authorize(ProductionReturnRequestPermissions.Create)]
public override async Task CreateAsync(ProductionReturnRequestEditInput input)
{
+
+
+
+
+
+ //SfsInventoryRequestInputBase sfsRequestInput = new SfsInventoryRequestInputBase();
+ //sfsRequestInput.Condition
+
+
+
+
+
var entity = ObjectMapper.Map(input);
await _productionReturnRequestManager.CreateAsync(entity).ConfigureAwait(false);
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
new file mode 100644
index 000000000..14dee5cf7
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
@@ -0,0 +1,302 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main;
+using IdentityModel;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Domain.Entities;
+using Volo.Abp.Domain.Repositories;
+using Volo.Abp.ObjectMapping;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Event;
+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}third-location-request")]
+public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase,
+ IThirdLocationRequestAppService
+{
+ private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
+ private readonly IItemStoreRelationAppService _itemStoreRelationApp;
+ private readonly IAreaAppService _areaApp;
+ private readonly ILocationAppService _locationAppService;
+ private readonly IItemBasicAppService _itemBasicAppService;
+ private readonly IProductionLineAppService _productionLineAppService;
+ private readonly IInjectionJobAppService _issueJobAppService;
+ public ThirdLocationRequestAppService(
+ IThirdLocationRequestRepository repository,
+ IThirdLocationRequestManager thirdLocationRequestManager,
+ IPreparationPlanManager preparationPlanManager,
+ IItemStoreRelationAppService itemStoreRelationApp,
+ IAreaAppService areaApp,
+ ILocationAppService locationAppService,
+ IItemBasicAppService itemBasicAppService,
+ IProductionLineAppService productionLineAppService,
+ IInjectionJobAppService issueJobAppService)
+ : base(repository, thirdLocationRequestManager)
+ {
+ _thirdLocationRequestManager = thirdLocationRequestManager;
+ _itemStoreRelationApp = itemStoreRelationApp;
+ _areaApp = areaApp;
+ _locationAppService = locationAppService;
+ _itemBasicAppService = itemBasicAppService;
+ _productionLineAppService = productionLineAppService;
+ _issueJobAppService = issueJobAppService;
+ }
+
+
+ #region 东阳V2
+
+ public override async Task HandleAsync(Guid id)
+ {
+ var entity = await _repository.GetAsync(id).ConfigureAwait(false);
+ await LocalEventBus.PublishAsync(new SfsHandledEntityEventData(entity), false).ConfigureAwait(false);
+ return ObjectMapper.Map(entity);
+ }
+
+ [HttpPost("")]
+ //[Authorize(ThirdLocationRequestPermissions.Create)]
+ public override async Task CreateAsync(ThirdLocationRequestEditInput input)
+ {
+ foreach (var item in input.Details)
+ {
+ if (item.Qty <= 0)
+ {
+ throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于0");
+ }
+ }
+
+ foreach (var detailInput in input.Details) //赋值生产线
+ {
+ var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
+ CheckLocation(toLocationDto, detailInput.ToLocationCode);
+ var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
+ CheckItemBasic(itemBasicDto, detailInput.ItemCode);
+
+ detailInput.ProdLine = detailInput.ToLocationCode;
+ detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
+ }
+
+ input.AutoSubmit = true;
+ input.AutoAgree = true;
+ input.AutoHandle = true;
+ input.AutoCompleteJob = false;
+ input.DirectCreateNote = false;
+
+ var entity = ObjectMapper.Map(input);
+
+ var result = await _thirdLocationRequestManager.CreateAsync(entity).ConfigureAwait(false);
+
+ var dto = ObjectMapper.Map(result);
+
+ return dto;
+ }
+
+ //[Authorize(ThirdLocationRequestPermissions.Create)]
+ [HttpPost("create-and-handle")]
+ public async Task CreateAndHandleAsync(ThirdLocationRequestEditInput input)
+ {
+ var thirdLocationRequestDto = await CreateAsync(input).ConfigureAwait(false);
+
+ await HandleAsync(thirdLocationRequestDto.Id).ConfigureAwait(false);
+
+ return thirdLocationRequestDto;
+ }
+
+ #endregion
+
+ ///
+ /// 根据类型 获取叫料申请
+ ///
+ ///
+ ///
+ [HttpGet("list/by-type/{type}")]
+ public virtual async Task> GetListByTypeAsync(string type)
+ {
+ var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
+
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ return dtos;
+ }
+
+ #region 导入
+
+ ///
+ /// 用来重写 导入数据时可以加工数据
+ ///
+ ///
+ ///
+ protected override async Task> ImportProcessingEntityAsync(
+ Dictionary dictionary)
+ {
+ var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
+
+ foreach (var thirdLocationRequest in addList)
+ {
+ thirdLocationRequest.Worker = CurrentUser.GetUserName();
+ thirdLocationRequest.CreatorId = CurrentUser.Id;
+ if (thirdLocationRequest.Type == EnumTransSubType.Issue_Manual.GetDisplayName())
+ {
+ thirdLocationRequest.Type = EnumTransSubType.Issue_Manual.ToString();
+ }
+
+ foreach (var detail in thirdLocationRequest.Details)
+ {
+ var locationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
+ CheckLocation(locationDto, detail.ToLocationCode);
+
+ var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
+ CheckItemBasic(itemBasicDto, detail.ItemCode);
+
+ detail.ToLocationArea = locationDto.AreaCode;
+ detail.ToLocationErpCode = locationDto.ErpLocationCode;
+ detail.ToLocationGroup = locationDto.LocationGroupCode;
+ detail.ToWarehouseCode = locationDto.WarehouseCode;
+ detail.ItemDesc1 = itemBasicDto.Desc1;
+ detail.ItemDesc2 = itemBasicDto.Desc2;
+ detail.ItemName = itemBasicDto.Name;
+ detail.Uom = itemBasicDto.BasicUom;
+ }
+ }
+
+ return dictionary;
+ }
+
+ ///
+ /// 导入验证
+ ///
+ ///
+ ///
+ ///
+ protected override async Task ValidateImportModelAsync(ThirdLocationRequestImportInput model,
+ List validationRresult)
+ {
+ _ = new Dictionary();
+ _ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false);
+ _ = await CheckLocationAsync(model, validationRresult).ConfigureAwait(false);
+ await CheckAreaAsync(model, validationRresult).ConfigureAwait(false);
+ await CheckStoreRelationAsync(model, validationRresult).ConfigureAwait(false);
+ }
+
+ #region 校验
+
+ protected override async Task ValidateImportEntities(Dictionary dict)
+ {
+ foreach (var entity in dict.Keys)
+ {
+ var tranType = await TransactionTypeAclService
+ .GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);
+
+ Check.NotNull(tranType, "事务类型", "事务类型不存在");
+
+ entity.AutoCompleteJob = tranType.AutoCompleteJob;
+ entity.AutoSubmit = tranType.AutoSubmitRequest;
+ entity.AutoAgree = tranType.AutoAgreeRequest;
+ entity.AutoHandle = tranType.AutoHandleRequest;
+ entity.DirectCreateNote = tranType.DirectCreateNote;
+ }
+
+ return await base.ValidateImportEntities(dict).ConfigureAwait(false);
+ }
+
+ protected async Task CheckItemBasicAsync(ThirdLocationRequestImportInput importInput,
+ List validationRresult)
+ {
+ var item = await _itemBasicAppService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false);
+ if (item == null)
+ {
+ validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" }));
+ }
+ else if (item.StdPackQty == 0)
+ {
+ validationRresult.Add(
+ new ValidationResult($"物品代码{importInput.ItemCode}的物品信息中标准包装等于0或不存在", new[] { "标准包装" }));
+ }
+
+ return item;
+ }
+
+ protected async Task CheckLocationAsync(ThirdLocationRequestImportInput importInput,
+ List validationRresult)
+ {
+ var location = await _locationAppService.GetByCodeAsync(importInput.ToLocationCode).ConfigureAwait(false);
+ if (location == null)
+ {
+ validationRresult.Add(new ValidationResult($"目标库位{importInput.ToLocationCode}不存在", new[] { "目标库位" }));
+ }
+
+ return location;
+ }
+
+ protected async Task CheckAreaAsync(ThirdLocationRequestImportInput importInput,
+ List validationRresult)
+ {
+ var area = await _areaApp.GetByCodeAsync(importInput.FromLocationArea).ConfigureAwait(false);
+ if (area == null)
+ {
+ validationRresult.Add(new ValidationResult($"调出库区{importInput.FromLocationArea}不存在", new[] { "调出库区" }));
+ }
+ }
+
+ protected async Task CheckStoreRelationAsync(ThirdLocationRequestImportInput importInput,
+ List validationRresult)
+ {
+ var itemStoreRelation = await _itemStoreRelationApp
+ .GetFirstAsync(importInput.ItemCode, importInput.ToLocationCode).ConfigureAwait(false);
+ if (itemStoreRelation == null)
+ {
+ validationRresult.Add(new ValidationResult(
+ $"物品代码{importInput.ItemCode}与目标库位{importInput.ToLocationCode}不存在对应关", new[] { "物品库位对应关系" }));
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region 校验
+
+ private void CheckItemBasic(ItemBasicDTO ItemBasicDto, string itemCode)
+ {
+ if (ItemBasicDto == null)
+ {
+ throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
+ }
+ }
+
+ private void CheckLocation(LocationDTO LocationDto, string LocationCode)
+ {
+ if (LocationDto == null)
+ {
+ throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在");
+ }
+
+ if (LocationDto.Type != EnumLocationType.WIP)
+ {
+ throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
+ }
+ }
+
+
+ #endregion
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
new file mode 100644
index 000000000..856be3ddf
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
@@ -0,0 +1,72 @@
+using AutoMapper;
+using Volo.Abp.AutoMapper;
+using Win_in.Sfs.Shared.Domain.Shared;
+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 ThirdLocationRequestAutoMapperProfile()
+ {
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ .ReverseMap();
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.ToLocationArea)
+ .Ignore(x => x.ToLocationGroup)
+ .Ignore(x => x.ToWarehouseCode)
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .ForMember(x => x.Type, y => y.MapFrom(t => t.Type.ToString()))
+ .Ignore(x => x.ProdLine)
+ .Ignore(x => x.UseOnTheWayLocation)
+ .Ignore(x => x.Details)
+ .Ignore(x => x.Remark)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.RequestStatus)
+ .Ignore(x => x.ConcurrencyStamp)
+ .Ignore(x => x.ExtraProperties)
+ .Ignore(x => x.ActiveDate)
+ .Ignore(x => x.Remark);
+
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open))
+ .Ignore(x => x.ToLocationErpCode)
+ .Ignore(x => x.ToWarehouseCode)
+ .Ignore(x => x.ToLocationArea)
+ .Ignore(x => x.ToLocationGroup)
+ .Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2)
+ .Ignore(x => x.ProdLine)
+ .Ignore(x => x.WorkStation)
+ .Ignore(x => x.ExpiredTime)
+ .Ignore(x => x.IssuedQty)
+ .Ignore(x => x.ReceivedQty)
+ .Ignore(x => x.ToBeIssuedQty)
+ .Ignore(x => x.ToBeReceivedQty)
+ .Ignore(x => x.NotFinishQty)
+ .Ignore(x => x.StdPackQty)
+ .Ignore(x => x.Uom)
+ .Ignore(x => x.TenantId)
+ .Ignore(x => x.MasterID)
+ .Ignore(x => x.Number)
+ .Ignore(x => x.Id)
+ .Ignore(x => x.Remark);
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.RequestStatus)
+ .Ignore(x => x.ConcurrencyStamp).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 8c64426d3..65ba83c10 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
@@ -16,6 +16,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
MaterialRequestAutoMapperProfile();
InjectionRequestAutoMapperProfile();
AssembleRequestAutoMapperProfile();
+ ThirdLocationRequestAutoMapperProfile();
ProductionReturnRequestAutoMapperProfile();
ProductReceiptRequestAutoMapperProfile();
UnplannedIssueRequestAutoMapperProfile();
@@ -68,6 +69,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
IssueNoteAutoMapperProfile();
InjectionNoteAutoMapperProfile();
AssembleNoteAutoMapperProfile();
+ ThirdLocationNoteAutoMapperProfile();
ContainerNoteAutoMapperProfile();
ItemTransformNoteAutoMapperProfile();
JisDeliverNoteAutoMapperProfile();
@@ -91,7 +93,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
NoOkConvertOkNoteAutoMapperProfile();
InventoryInitialNoteAutoMapperProfile();
WipWarehouseAdjustNoteMapperProfile();
-
+ MesNoteAutoMapperProfile();
#endregion
#region Jobs
@@ -103,6 +105,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
IssueJobAutoMapperProfile();
InjectionJobAutoMapperProfile();
AssembleJobAutoMapperProfile();
+ ThirdLocationJobAutoMapperProfile();
ContainerJobAutoMapperProfile();
JisDeliverJobAutoMapperProfile();
ProductReceiveJobAutoMapperProfile();
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobManager.cs
new file mode 100644
index 000000000..6efac9ee7
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobManager.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface IThirdLocationJobManager : IJobManager
+{
+ Task GetAsync(Expression> expression);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobRepository.cs
new file mode 100644
index 000000000..5d1aecf6b
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/IThirdLocationJobRepository.cs
@@ -0,0 +1,6 @@
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface IThirdLocationJobRepository : ISfsJobRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJob.cs
new file mode 100644
index 000000000..705b787d2
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJob.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Threading.Tasks;
+using Win_in.Sfs.Shared.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 三方库库移任务
+///
+[Display(Name = "三方库库移任务")]
+public class ThirdLocationJob : SfsJobAggregateRootBase
+{
+ ///
+ /// 叫料请求类型
+ ///
+ [IgnoreUpdate]
+ public string RequestType { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [IgnoreUpdate]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 请求单号
+ ///
+ [IgnoreUpdate]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [IgnoreUpdate]
+ public string Workshop { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [Display(Name = "使用在途库")]
+ [IgnoreUpdate]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 任务明细
+ ///
+ [IgnoreUpdate]
+ public override List Details { get; set; } = new List();
+
+ ///
+ /// 设置任务明细的实际库位和实际数量
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public virtual async Task BuildDetail(Guid id, string handledLocationCode, string handledLocationErpCode,
+ string handledWarehouseCode, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate,
+ string handledContainerCode, string handledLot, string handledPackingCode)
+ {
+ var detail = GetDetail(id);
+ detail.HandledFromLocationCode = handledLocationCode;
+ detail.HandledFromLocationErpCode = handledLocationErpCode;
+ detail.HandledFromWarehouseCode = handledWarehouseCode;
+ detail.HandledQty = handledQty;
+ detail.HandledSupplierBatch = handledSupplierBatch;
+ detail.HandledArriveDate = handledArriveDate;
+ detail.HandledProduceDate = handledProduceDate;
+ detail.HandledExpireDate = handledExpireDate;
+ detail.HandledContainerCode = handledContainerCode;
+ detail.HandledLot = handledLot;
+ detail.HandledPackingCode = handledPackingCode;
+ await Task.CompletedTask.ConfigureAwait(false);
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs
new file mode 100644
index 000000000..91ffb30db
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs
@@ -0,0 +1,108 @@
+using System;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class ThirdLocationJobDetail : SfsJobRecommendFromDetailEntityBase, IHasToLocation
+{
+ ///
+ /// 请求库位
+ ///
+ public string RequestLocationCode { get; set; }
+
+ ///
+ /// 到库位
+ ///
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 到库区
+ ///
+ public string ToLocationArea { get; set; }
+
+ ///
+ /// 到库位组
+ ///
+ public string ToLocationGroup { get; set; }
+
+ ///
+ /// 到ERP库位
+ ///
+ public string ToLocationErpCode { get; set; }
+
+ ///
+ /// 到仓库
+ ///
+ public string ToWarehouseCode { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ public string WorkStation { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 工序
+ ///
+ public string Operation { get; set; }
+
+ ///
+ /// 配送方式
+ ///
+ public EnumDistributionType DistributionType { get; set; }
+
+ ///
+ /// 取整方式
+ ///
+ public EnumTruncType TruncType { get; set; }
+
+ ///
+ /// 取整后数量
+ ///
+ public decimal RoundedQty { get; set; }
+
+ ///
+ /// 计划拆分规则
+ ///
+ public EnumPlannedSplitRule PlannedSplitRule { get; set; }
+
+ ///
+ /// 计划开始时间
+ ///
+ public DateTime PlanBeginTime { get; set; }
+
+ ///
+ /// 每次配送数量
+ ///
+ public decimal DeliveryQty { get; set; }
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+
+ public void SetId(Guid id)
+ {
+ this.Id = id;
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobManager.cs
new file mode 100644
index 000000000..f9b8dc84a
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobManager.cs
@@ -0,0 +1,82 @@
+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 ThirdLocationJobManager : SfsJobManagerBase, IThirdLocationJobManager
+{
+
+ public ThirdLocationJobManager(
+ IThirdLocationJobRepository repository
+ ) : base(repository)
+ {
+ }
+
+ ///
+ /// 执行任务 发料任务
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override async Task CompleteAsync(ThirdLocationJob input, ICurrentUser user)
+ {
+ var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
+
+ foreach (var detail in input.Details)
+ {
+ //发料子任务 赋值实际转移
+ await entity.BuildDetail(detail.Id,
+ detail.HandledFromLocationCode,
+ detail.HandledFromLocationErpCode,
+ detail.HandledFromWarehouseCode,
+ detail.HandledQty,
+ detail.HandledSupplierBatch,
+ detail.HandledArriveDate,
+ detail.HandledProduceDate,
+ detail.HandledExpireDate,
+ detail.HandledContainerCode,
+ detail.HandledLot,
+ detail.HandledPackingCode).ConfigureAwait(false);
+ }
+
+ return await base.CompleteAsync(entity, user).ConfigureAwait(false);
+ }
+
+ public override void CheckDetails(ThirdLocationJob entity, AbpValidationResult result)
+ {
+ var details = entity.Details;
+ foreach (var detail in details)
+ {
+ if (detail.HandledFromLocationCode == null)
+ {
+ result.Errors.Add(new ValidationResult($"{detail.HandledFromLocationCode} 不能为空"));
+ }
+
+ }
+ }
+
+ public override async Task> GetWorkingListByPackingAsync(string packingCode)
+ {
+ return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendPackingCode == packingCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
+
+ }
+
+ public override async Task> GetWorkingListByContainerAsync(string containerCode)
+ {
+ return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendContainerCode == containerCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
+
+ }
+
+ public async Task GetAsync(Expression> expression)
+ {
+ return await Repository.FindAsync(expression).ConfigureAwait(false);
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteManager.cs
new file mode 100644
index 000000000..745ce7a8c
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteManager.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface IThirdLocationNoteManager : ISfsStoreManager
+{
+ Task ConfirmAsync(Guid id);
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteRepository.cs
new file mode 100644
index 000000000..d034e4139
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/IThirdLocationNoteRepository.cs
@@ -0,0 +1,6 @@
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface IThirdLocationNoteRepository : ISfsStoreRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNote.cs
new file mode 100644
index 000000000..6f7d0dedf
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNote.cs
@@ -0,0 +1,77 @@
+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 ThirdLocationNote : SfsStoreAggregateRootBase, IHasJobNumber, IHasRequestNumber
+{
+ ///
+ /// 任务ID
+ ///
+ [IgnoreUpdate]
+ public string JobNumber { get; set; }
+
+ ///
+ /// 车间
+ ///
+ [IgnoreUpdate]
+ public string Workshop { get; set; }
+
+ ///
+ /// 明细列表
+ ///
+ [IgnoreUpdate]
+ public override List Details { get; set; } = new List();
+
+ [IgnoreUpdate]
+ public string RequestNumber { get; set; }
+
+ ///
+ /// 叫料请求类型
+ ///
+ [IgnoreUpdate]
+ public string RequestType { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ [IgnoreUpdate]
+ public bool UseOnTheWayLocation { get; set; }
+
+ ///
+ /// 确认时间
+ ///
+ [Display(Name = "确认时间")]
+ [IgnoreUpdate]
+ public DateTime? ConfirmTime { get; set; }
+
+ ///
+ /// 已确认
+ ///
+ [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/ThirdLocationNotes/ThirdLocationNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNoteDetail.cs
new file mode 100644
index 000000000..c9b6a230e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNoteDetail.cs
@@ -0,0 +1,43 @@
+using System;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class ThirdLocationNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase
+{
+
+ ///
+ /// 发料时间
+ ///
+ public DateTime IssueTime { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ public string WorkStation { get; set; }
+
+ ///
+ /// 在途库库位
+ ///
+ public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNoteManager.cs
new file mode 100644
index 000000000..d71b82c3e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ThirdLocationNotes/ThirdLocationNoteManager.cs
@@ -0,0 +1,42 @@
+using System;
+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 ThirdLocationNoteManager : SfsStoreManagerBase, IThirdLocationNoteManager
+{
+
+ public ThirdLocationNoteManager(
+ IThirdLocationNoteRepository repository
+ ) : base(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(ThirdLocationNote entity)
+ {
+ try
+ {
+ await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(entity), false).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ Logger.LogDebug($"{nameof(ThirdLocationNote)} Confirmed Event:{ex.Message}", null);
+ Console.WriteLine(ex.Source);
+ throw;
+ }
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestManager.cs
new file mode 100644
index 000000000..d17413a2a
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestManager.cs
@@ -0,0 +1,16 @@
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+using Win_in.Sfs.Shared.Domain;
+
+public interface IThirdLocationRequestManager : ISfsStoreRequestManager,
+ IBulkImportService
+{
+
+ Task UpdateDetailsAsync(ThirdLocationRequest entity);
+
+ Task CompleteAsync(string number);
+
+ Task CreateBynNumberAsync(ThirdLocationRequest entity);
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestRepository.cs
new file mode 100644
index 000000000..9e9d4502e
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestRepository.cs
@@ -0,0 +1,9 @@
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public interface IThirdLocationRequestRepository : ISfsStoreRepositoryBase,
+ ISfsBulkRepositoryBase
+{
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequest.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequest.cs
new file mode 100644
index 000000000..8a2162664
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequest.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Win_in.Sfs.Shared.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 三方库移库申请
+///
+public class ThirdLocationRequest : SfsStoreRequestAggregateRootBase
+{
+ ///
+ /// 叫料类型
+ ///
+ [Display(Name = "叫料类型")]
+ [IgnoreUpdate]
+ public string Type { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ [IgnoreUpdate]
+ public string ProdLine { get; set; }
+
+ ///
+ /// 使用在途库
+ ///
+ 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/ThirdLocationRequests/ThirdLocationRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
new file mode 100644
index 000000000..e2f3f79ec
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
@@ -0,0 +1,105 @@
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+using Win_in.Sfs.Shared.Domain;
+using Win_in.Sfs.Shared.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+///
+/// 三方库申请明细
+///
+public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLocation
+{
+ ///
+ /// 到库位
+ ///
+ public string ToLocationCode { get; set; }
+
+ ///
+ /// 到库区
+ ///
+ public string ToLocationArea { get; set; }
+
+ ///
+ /// 到库位组
+ ///
+ public string ToLocationGroup { get; set; }
+
+ ///
+ /// 到ERP库位
+ ///
+ public string ToLocationErpCode { get; set; }
+
+ ///
+ /// 到仓库
+ ///
+ public string ToWarehouseCode { get; set; }
+
+ ///
+ /// 来源库区
+ ///
+ public string FromLocationArea { get; set; }
+
+ // ///
+ // /// 在途库库位
+ // ///
+ // public string OnTheWayLocationCode { get; set; }
+
+ ///
+ /// 生产线
+ ///
+ public string ProdLine { get; set; }
+
+ ///
+ /// 工作中心
+ ///
+ public string WorkStation { get; set; }
+
+ ///
+ /// 过期时间
+ ///
+ public DateTime ExpiredTime { get; set; }
+
+ ///
+ /// 已发数量
+ ///
+ public decimal IssuedQty { get; set; }
+
+ ///
+ /// 已收数量
+ ///
+ public decimal ReceivedQty { get; set; }
+
+ ///
+ /// 明细状态
+ ///
+ public EnumStatus Status { get; set; }
+
+ ///
+ /// 请求未发 还未发送的数量
+ ///
+ [NotMapped]
+ public decimal ToBeIssuedQty => Qty - IssuedQty;
+
+ ///
+ /// 已发未收
+ ///
+ [NotMapped]
+ public decimal ToBeReceivedQty => IssuedQty - ReceivedQty;
+
+ ///
+ /// 请求未收
+ ///
+ [NotMapped]
+ public decimal NotFinishQty => Qty - ReceivedQty;
+
+ ///
+ /// 位置码
+ ///
+ public string PositionCode { get; set; }
+
+ ///
+ /// 推荐类型
+ ///
+ public EnumRecommendType RecommendType { get; set; }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
new file mode 100644
index 000000000..c9d45a6dc
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
@@ -0,0 +1,147 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using DocumentFormat.OpenXml.Math;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.Event;
+using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings;
+
+namespace Win_in.Sfs.Wms.Store.Domain;
+
+public class ThirdLocationRequestManager
+ : SfsStoreRequestManagerBase
+ , IThirdLocationRequestManager
+{
+ private readonly IThirdLocationRequestRepository _repository;
+ private readonly IIssueJobRepository _issueJobRepository;
+
+ public ThirdLocationRequestManager(
+ IThirdLocationRequestRepository repository
+ , IIssueJobRepository issueJobRepository
+ ) : base(repository)
+ {
+ _repository = repository;
+ _issueJobRepository = issueJobRepository;
+ }
+
+
+ #region 东阳V2
+
+ #endregion
+
+
+ ///
+ /// 创建
+ ///
+ ///
+ ///
+ public virtual async Task CreateBynNumberAsync(ThirdLocationRequest entity)
+ {
+ var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(ThirdLocationRequest), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
+ entity.SetIdAndNumberWithDetails(GuidGenerator, number);
+ entity.Submit();
+ entity.Agree();
+ entity.RequestStatus = EnumRequestStatus.Partial;
+ await LocalEventBus.PublishAsync(new SfsHandledEntityEventData(entity), false)
+ .ConfigureAwait(false);
+ await _repository.InsertAsync(entity).ConfigureAwait(false);
+ return entity;
+ }
+
+ public virtual async Task UpdateDetailsAsync(ThirdLocationRequest newEntity)
+ {
+ var oldEntity = await Repository.FindAsync(newEntity.Id, true).ConfigureAwait(false);
+ if(oldEntity!=null)
+ {
+ foreach (var newDetail in newEntity.Details)
+ {
+ oldEntity.ReplaceDetail(newDetail.Id, newDetail);
+ }
+
+ foreach (var detail in oldEntity.Details)
+ {
+ SetMaterialRequestDetailStatus(detail);
+ }
+
+ await SetMaterialRequestStatusAsync(oldEntity).ConfigureAwait(false);
+
+ await Repository.UpdateAsync(oldEntity).ConfigureAwait(false);
+ }
+
+ }
+
+ private void SetMaterialRequestDetailStatus(ThirdLocationRequestDetail detail)
+ {
+ if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数
+ {
+ detail.Status = EnumStatus.Close;
+ }
+ else
+ {
+ detail.Status = EnumStatus.Open;
+ }
+ }
+
+ private async Task SetMaterialRequestStatusAsync(ThirdLocationRequest materialRequest)
+ {
+ if (materialRequest.Details.All(p => p.Status == EnumStatus.Close))
+ {
+ materialRequest.RequestStatus = EnumRequestStatus.Completed;
+ }
+ else
+ {
+ var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false);
+ if (issueJobs.Count > 0)
+ {
+ if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled))
+ {
+ if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty))
+ {
+ materialRequest.RequestStatus = EnumRequestStatus.Completed;
+ }
+ else
+ {
+ materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ }
+ }
+ else
+ {
+ materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ }
+ }
+ else
+ {
+ materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ }
+ }
+ }
+
+ public virtual async Task CompleteAsync(string number)
+ {
+ var entity = await GetByNumberAsync(number).ConfigureAwait(false);
+ if (entity != null && !entity.Details.Any(p => p.ToBeIssuedQty > 0))
+ {
+ await CompleteAsync(entity).ConfigureAwait(false);
+ }
+ }
+
+
+ #region 导入
+
+ ///
+ /// 执行导入
+ ///
+ public virtual async Task ImportDataAsync(List mergeEntities, List deleteEntities = null)
+ {
+ if (deleteEntities != null && deleteEntities.Count > 0)
+ {
+ await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
+ }
+
+ await CreateManyAsync(mergeEntities).ConfigureAwait(false);
+ }
+
+ #endregion
+
+}
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 9f178d167..ab42ce15c 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
@@ -23,6 +23,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet MaterialRequests { get; }
public DbSet InjectionRequests { get; }
public DbSet AssembleRequests { get; }
+ public DbSet ThirdLocationRequests { get; }
public DbSet ContainerRequests { get; }
public DbSet DeliverRequests { get; }
public DbSet InspectRequests { get; }
@@ -79,6 +80,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet IssueNotes { get; }
public DbSet InjectionNotes { get; }
public DbSet AssembleNotes { get; }
+ public DbSet ThirdLocationNotes { get; }
public DbSet ContainerNotes { get; }
public DbSet UnplannedReceiptNotes { get; }
public DbSet UnplannedIssueNotes { get; }
@@ -106,6 +108,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet IssueJobs { get; }
public DbSet InjectionJobs { get; }
public DbSet AssembleJobs { get; }
+ public DbSet ThirdLocationJobs { get; }
public DbSet ContainerJobs { get; }
public DbSet DeliverJobs { get; }
public DbSet JisDeliverJobs { get; }
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..492ecff82
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs
@@ -0,0 +1,69 @@
+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 ThirdLocationJobDbContextModelCreatingExtensions
+{
+ public static void ConfigureThirdLocationJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ThirdLocationJob), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsBase();
+ //Configure Job base properties
+ b.ConfigureJob();
+ //Properties
+ b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ProdLine).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(ThirdLocationJobDetail), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsBase();
+ //Configure Job base properties
+ b.ConfigureJobRecommendFromDetail();
+ //Properties
+ b.Property(q => q.ExpiredTime).IsRequired();
+ b.Property(q => q.ToLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationErpCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToWarehouseCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationArea).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationGroup).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.PlannedSplitRule).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).HasConversion();
+
+ //Relations
+ //None
+
+ //Indexes
+ //b.HasIndex(q => new { q.PackingCode }).IsUnique();
+ });
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobEfCoreRepository.cs
new file mode 100644
index 000000000..20d2fb313
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobEfCoreRepository.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 ThirdLocationJobEfCoreRepository : SfsJobEfCoreRepositoryBase, IThirdLocationJobRepository
+{
+ public ThirdLocationJobEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..5cfee77f2
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteDbContextModelCreatingExtensions.cs
@@ -0,0 +1,63 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
+
+public static class ThirdLocationNoteDbContextModelCreatingExtensions
+{
+ public static void ConfigureThirdLocationNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(options.TablePrefix + nameof(ThirdLocationNote), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsStoreBase();
+
+ //Properties
+ b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.NameLength);
+ b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
+
+ //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(options.TablePrefix + nameof(ThirdLocationNoteDetail), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsStoreBase();
+ //Configure Sfs store detail properties
+ b.ConfigureSfsStoreDetailBase();
+
+ //Properties
+ b.Property(q => q.IssueTime).IsRequired();
+ b.Property(q => q.ExpiredTime).IsRequired();
+ b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength);
+ b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.NameLength);
+ b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+
+ //Relations
+
+ //Indexes
+ b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode }).IsUnique();
+ b.HasIndex(q => new { q.FromPackingCode });
+ });
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteEfCoreRepository.cs
new file mode 100644
index 000000000..5dc7b0783
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ThirdLocationNotes/ThirdLocationNoteEfCoreRepository.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 ThirdLocationNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase, IThirdLocationNoteRepository
+{
+ public ThirdLocationNoteEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..8884bf84b
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
@@ -0,0 +1,65 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
+
+public static class ThirdLocationRequestDbContextModelCreatingExtensions
+{
+ public static void ConfigureThirdLocationRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(options.TablePrefix + nameof(ThirdLocationRequest), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsStoreBase();
+
+ //Properties
+ b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+
+ //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(options.TablePrefix + nameof(ThirdLocationRequestDetail), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsStoreBase();
+ //Configure Sfs store detail properties
+ b.ConfigureSfsStoreDetailBase();
+ //Properties
+ b.Property(q => q.ToLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationErpCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToWarehouseCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ToLocationGroup).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.ExpiredTime).IsRequired();
+ b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.IssuedQty).HasPrecision(18, 6);
+ b.Property(q => q.ReceivedQty).HasPrecision(18, 6);
+ b.Property(q => q.Status).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+ b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
+
+ //Relations
+
+ //Indexes
+ b.HasIndex(q => new { q.Number, q.ItemCode, q.ToLocationCode }).IsUnique();
+ b.HasIndex(q => new { q.ItemCode });
+ });
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestEfCoreRepository.cs
new file mode 100644
index 000000000..ab76a9fbc
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestEfCoreRepository.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 ThirdLocationRequestEfCoreRepository : SfsStoreEfCoreRepositoryBase, IThirdLocationRequestRepository
+{
+ public ThirdLocationRequestEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
index 714637c10..c2caf997b 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
@@ -23,6 +23,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext
public DbSet MaterialRequests { get; set; }
public DbSet InjectionRequests { get; set; }
public DbSet AssembleRequests { get; set; }
+ public DbSet ThirdLocationRequests { get; set; }
public DbSet ContainerRequests { get; set; }
public DbSet DeliverRequests { get; set; }
public DbSet InspectRequests { get; set; }
@@ -79,6 +80,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext
public DbSet IssueNotes { get; set; }
public DbSet InjectionNotes { get; set; }
public DbSet AssembleNotes { get; set; }
+ public DbSet ThirdLocationNotes { get; set; }
public DbSet ContainerNotes { get; set; }
public DbSet UnplannedReceiptNotes { get; set; }
public DbSet UnplannedIssueNotes { get; set; }
@@ -106,6 +108,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext
public DbSet IssueJobs { get; set; }
public DbSet InjectionJobs { get; set; }
public DbSet AssembleJobs { get; set; }
+ public DbSet ThirdLocationJobs { get; set; }
public DbSet ContainerJobs { get; set; }
public DbSet DeliverJobs { get; set; }
public DbSet JisDeliverJobs { get; set; }
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
index cd0750295..8e8b5fad8 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
@@ -49,6 +49,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureMaterialRequest(options);
builder.ConfigureInjectionRequest(options);
builder.ConfigureAssembleRequest(options);
+ builder.ConfigureThirdLocationRequest(options);
builder.ConfigureDeliverRequest(options);
builder.ConfigureContainerRequest(options);
builder.ConfigureInspectRequest(options);
@@ -86,6 +87,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureIssueNote(options);
builder.ConfigureInjectionNote(options);
builder.ConfigureAssembleNote(options);
+ builder.ConfigureThirdLocationNote(options);
builder.ConfigureContainerNote(options);
builder.ConfigureUnplannedReceiptNote(options);
builder.ConfigureUnplannedIssueNote(options);
@@ -103,6 +105,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureNoOkConvertOKNote(options);
builder.ConfigureInventoryInitialNote(options);
builder.ConfigureWipWarehouseAdjustNote(options);
+ builder.ConfigureMesNote(options);
#endregion
#region Jobs
@@ -113,6 +116,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureIssueJob(options);
builder.ConfigureInjectionJob(options);
builder.ConfigureAssembleJob(options);
+ builder.ConfigureThirdLocationJob(options);
builder.ConfigureContainerJob(options);
builder.ConfigureDeliverJob(options);
builder.ConfigureJisDeliverJob(options);
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
index 997949441..098faee97 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
@@ -60,6 +60,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
@@ -102,6 +103,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
@@ -121,6 +123,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
+
#endregion
#region Jobs
@@ -131,6 +135,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
@@ -198,6 +203,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
+ options.Entity(orderOptions =>
+ orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
@@ -249,14 +256,20 @@ public class StoreEntityFrameworkCoreModule : AbpModule
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
+ options.Entity(orderOptions =>
+ orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
+ options.Entity(orderOptions =>
+ orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity