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.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/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..5b154ffb1 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
@@ -51,12 +51,23 @@ public class MesNoteAppService :
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(MesNote), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
+
+
+
+
+
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,27 @@ 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
}
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 b59aa82f6..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
@@ -93,7 +93,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
NoOkConvertOkNoteAutoMapperProfile();
InventoryInitialNoteAutoMapperProfile();
WipWarehouseAdjustNoteMapperProfile();
-
+ MesNoteAutoMapperProfile();
#endregion
#region Jobs
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 112722839..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
@@ -105,6 +105,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureNoOkConvertOKNote(options);
builder.ConfigureInventoryInitialNote(options);
builder.ConfigureWipWarehouseAdjustNote(options);
+ builder.ConfigureMesNote(options);
#endregion
#region Jobs
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 9dadc3a40..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
@@ -123,6 +123,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
+
#endregion
#region Jobs
@@ -254,6 +256,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 =>
@@ -264,6 +268,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 =>
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/MesNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/MesNoteAutoMapperProfile.cs
new file mode 100644
index 000000000..e5d6f22db
--- /dev/null
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/MesNoteAutoMapperProfile.cs
@@ -0,0 +1,44 @@
+using AutoMapper;
+using Volo.Abp.AutoMapper;
+using Win_in.Sfs.Shared.Application;
+using Win_in.Sfs.Wms.Inventory.Application.Contracts;
+using Win_in.Sfs.Wms.Store.Domain;
+
+namespace Win_in.Sfs.Wms.Store.Event;
+
+public partial class StoreEventAutoMapperProfile : Profile
+{
+ private void MesNoteAutoMapperProfile()
+ {
+ CreateMap()
+ .Ignore(x => x.ExtraProperties)
+ .Ignore(x => x.DocNumber)
+ .Ignore(x => x.JobNumber)
+ .Ignore(x => x.Worker)
+ .Ignore(x => x.TransType)
+ .Ignore(x => x.TransSubType)
+ ;
+
+ CreateMap()
+ .MapNegativeQty()
+ .ForMember(x => x.PackingCode, y => y.MapFrom(d => d.FromPackingCode))
+ .ForMember(x => x.ContainerCode, y => y.MapFrom(d => d.FromContainerCode))
+ .ForMember(x => x.Lot, y => y.MapFrom(d => d.FromLot))
+ .ForMember(x => x.Status, y => y.MapFrom(d => d.FromStatus))
+ .ForMember(x => x.LocationCode, y => y.MapFrom(d => d.FromLocationCode))
+ .ForMember(x => x.LocationArea, y => y.MapFrom(d => d.FromLocationArea))
+ .ForMember(x => x.LocationGroup, y => y.MapFrom(d => d.FromLocationGroup))
+ .ForMember(x => x.LocationErpCode, y => y.MapFrom(d => d.FromLocationErpCode))
+ .ForMember(x => x.WarehouseCode, y => y.MapFrom(d => d.FromWarehouseCode))
+ .Ignore(x => x.ExtraProperties)
+ .Ignore(x => x.DocNumber)
+ .Ignore(x => x.JobNumber)
+ .Ignore(x => x.Worker)
+ .Ignore(x => x.ManageType)
+ .Ignore(x => x.TransType)
+ .Ignore(x => x.TransSubType)
+ .Ignore(x => x.TransInOut)
+ ;
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs
index 026aa2b9d..e1053cf3c 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs
@@ -110,6 +110,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CoatingIssueJobAutoMapperProfile();
CoatingIssueNoteAutoMapperProfile();
CoatingMaterialRequestAutoMapperProfile();
+ MesNoteAutoMapperProfile();
}
}