The open source simple and complete warehouse management system is derived from our many years of experience in implementing erp projects. We stripped the original commercial system wms function and opened it up for free, hoping to help the majority of small and medium-sized enterprises. At present, the system supports cross-platform。
[feat]add return value of get Dispatchlist by dispatch_no api
JawerZengb783f5d5eaa0
diff --git a/backend/ModernWMS.WMS/Entities/ViewModels/Dispatchlist/DispatchlistViewModel.cs b/backend/ModernWMS.WMS/Entities/ViewModels/Dispatchlist/DispatchlistViewModel.csindex efac5d3..e82e10b 100644--- a/backend/ModernWMS.WMS/Entities/ViewModels/Dispatchlist/DispatchlistViewModel.cs+++ b/backend/ModernWMS.WMS/Entities/ViewModels/Dispatchlist/DispatchlistViewModel.cs@@ -14,104 +14,104 @@ namespace ModernWMS.WMS.Entities.ViewModelspublic class DispatchlistViewModel{- #region constructor- /// <summary>- /// constructor- /// </summary>- public DispatchlistViewModel()- {-- }- #endregion+ #region constructor+ /// <summary>+ /// constructor+ /// </summary>+ public DispatchlistViewModel()+ {++ }+ #endregion#region Property/// <summary>/// id/// </summary>[Display(Name = "id")]- public int id { get; set; } = 0;+ public int id { get; set; } = 0;/// <summary>/// dispatch_no/// </summary>[Display(Name = "dispatch_no")]- [MaxLength(32,ErrorMessage = "MaxLength")]- public string dispatch_no { get; set; } = string.Empty;+ [MaxLength(32, ErrorMessage = "MaxLength")]+ public string dispatch_no { get; set; } = string.Empty;/// <summary>/// dispatch_status/// </summary>[Display(Name = "dispatch_status")]- public byte dispatch_status { get; set; } = 0;+ public byte dispatch_status { get; set; } = 0;/// <summary>/// customer_id/// </summary>[Display(Name = "customer_id")]- public int customer_id { get; set; } = 0;+ public int customer_id { get; set; } = 0;/// <summary>/// customer_name/// </summary>[Display(Name = "customer_name")]- [MaxLength(256,ErrorMessage = "MaxLength")]- public string customer_name { get; set; } = string.Empty;+ [MaxLength(256, ErrorMessage = "MaxLength")]+ public string customer_name { get; set; } = string.Empty;/// <summary>/// sku_id/// </summary>[Display(Name = "sku_id")]- public int sku_id { get; set; } = 0;+ public int sku_id { get; set; } = 0;/// <summary>/// qty/// </summary>[Display(Name = "qty")]- public int qty { get; set; } = 0;+ public int qty { get; set; } = 0;/// <summary>/// weight/// </summary>[Display(Name = "weight")]- public decimal weight { get; set; } = 0;+ public decimal weight { get; set; } = 0;/// <summary>/// volume/// </summary>[Display(Name = "volume")]- public decimal volume { get; set; } = 0;+ public decimal volume { get; set; } = 0;/// <summary>/// creator/// </summary>[Display(Name = "creator")]- [MaxLength(64,ErrorMessage = "MaxLength")]- public string creator { get; set; } = string.Empty;+ [MaxLength(64, ErrorMessage = "MaxLength")]+ public string creator { get; set; } = string.Empty;/// <summary>/// create_time/// </summary>[Display(Name = "create_time")]- [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]- public DateTime create_time { get; set; } = UtilConvert.MinDate;+ [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]+ public DateTime create_time { get; set; } = UtilConvert.MinDate;/// <summary>/// damage_qty/// </summary>[Display(Name = "damage_qty")]- public int damage_qty { get; set; } = 0;+ public int damage_qty { get; set; } = 0;/// <summary>/// lock_qty/// </summary>[Display(Name = "lock_qty")]- public int lock_qty { get; set; } = 0;+ public int lock_qty { get; set; } = 0;/// <summary>/// picked_qty/// </summary>[Display(Name = "picked_qty")]- public int picked_qty { get; set; } = 0;+ public int picked_qty { get; set; } = 0;/// <summary>/// unpicked_qty@@ -123,13 +123,13 @@ namespace ModernWMS.WMS.Entities.ViewModels/// intrasit_qty/// </summary>[Display(Name = "intrasit_qty")]- public int intrasit_qty { get; set; } = 0;+ public int intrasit_qty { get; set; } = 0;/// <summary>/// package_qty/// </summary>[Display(Name = "package_qty")]- public int package_qty { get; set; } = 0;+ public int package_qty { get; set; } = 0;/// <summary>/// unpackage_qty@@ -141,7 +141,7 @@ namespace ModernWMS.WMS.Entities.ViewModels/// weighing_qty/// </summary>[Display(Name = "weighing_qty")]- public int weighing_qty { get; set; } = 0;+ public int weighing_qty { get; set; } = 0;/// <summary>/// weighing_qty@@ -153,87 +153,87 @@ namespace ModernWMS.WMS.Entities.ViewModels/// actual_qty/// </summary>[Display(Name = "actual_qty")]- public int actual_qty { get; set; } = 0;+ public int actual_qty { get; set; } = 0;/// <summary>/// sign_qty/// </summary>[Display(Name = "sign_qty")]- public int sign_qty { get; set; } = 0;+ public int sign_qty { get; set; } = 0;/// <summary>/// package_no/// </summary>[Display(Name = "package_no")]- [MaxLength(32,ErrorMessage = "MaxLength")]- public string package_no { get; set; } = string.Empty;+ [MaxLength(32, ErrorMessage = "MaxLength")]+ public string package_no { get; set; } = string.Empty;/// <summary>/// package_person/// </summary>[Display(Name = "package_person")]- [MaxLength(64,ErrorMessage = "MaxLength")]- public string package_person { get; set; } = string.Empty;+ [MaxLength(64, ErrorMessage = "MaxLength")]+ public string package_person { get; set; } = string.Empty;/// <summary>/// package_time/// </summary>[Display(Name = "package_time")]- [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]- public DateTime package_time { get; set; } = UtilConvert.MinDate;+ [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]+ public DateTime package_time { get; set; } = UtilConvert.MinDate;/// <summary>/// weighing_no/// </summary>[Display(Name = "weighing_no")]- [MaxLength(32,ErrorMessage = "MaxLength")]- public string weighing_no { get; set; } = string.Empty;+ [MaxLength(32, ErrorMessage = "MaxLength")]+ public string weighing_no { get; set; } = string.Empty;/// <summary>/// weighing_person/// </summary>[Display(Name = "weighing_person")]- [MaxLength(64,ErrorMessage = "MaxLength")]- public string weighing_person { get; set; } = string.Empty;+ [MaxLength(64, ErrorMessage = "MaxLength")]+ public string weighing_person { get; set; } = string.Empty;/// <summary>/// weighing_weight/// </summary>[Display(Name = "weighing_weight")]- public decimal weighing_weight { get; set; } = 0;+ public decimal weighing_weight { get; set; } = 0;/// <summary>/// waybill_no/// </summary>[Display(Name = "waybill_no")]- [MaxLength(64,ErrorMessage = "MaxLength")]- public string waybill_no { get; set; } = string.Empty;+ [MaxLength(64, ErrorMessage = "MaxLength")]+ public string waybill_no { get; set; } = string.Empty;/// <summary>/// carrier/// </summary>[Display(Name = "carrier")]- [MaxLength(256,ErrorMessage = "MaxLength")]- public string carrier { get; set; } = string.Empty;+ [MaxLength(256, ErrorMessage = "MaxLength")]+ public string carrier { get; set; } = string.Empty;/// <summary>/// freightfee/// </summary>[Display(Name = "freightfee")]- public decimal freightfee { get; set; } = 0;+ public decimal freightfee { get; set; } = 0;/// <summary>/// last_update_time/// </summary>[Display(Name = "last_update_time")]- [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]- public DateTime last_update_time { get; set; } = UtilConvert.MinDate;+ [DataType(DataType.DateTime, ErrorMessage = "DataType_DateTime")]+ public DateTime last_update_time { get; set; } = UtilConvert.MinDate;/// <summary>/// tenant_id/// </summary>[Display(Name = "tenant_id")]- public long tenant_id { get; set; } = 0;+ public long tenant_id { get; set; } = 0;/// <summary>@@ -275,6 +275,17 @@ namespace ModernWMS.WMS.Entities.ViewModels/// length_unit/// </summary>public byte length_unit { get; set; } = 0;++ /// <summary>+ /// sku_name+ /// </summary>+ public string sku_name { get; set; } = string.Empty;++ /// <summary>+ /// unit+ /// </summary>+ public string unit { get; set; } = string.Empty;+#endregion}diff --git a/backend/ModernWMS.WMS/Services/Dispatchlist/DispatchlistService.cs b/backend/ModernWMS.WMS/Services/Dispatchlist/DispatchlistService.csindex 2e6aca7..0a4682b 100644--- a/backend/ModernWMS.WMS/Services/Dispatchlist/DispatchlistService.cs+++ b/backend/ModernWMS.WMS/Services/Dispatchlist/DispatchlistService.cs@@ -195,7 +195,9 @@ namespace ModernWMS.WMS.Servicesspu_description = spu.spu_description,spu_name = spu.spu_name,bar_code = spu.bar_code,- unpicked_qty = d.qty - d.picked_qty+ unpicked_qty = d.qty - d.picked_qty,+ sku_name = sku.sku_name,+ unit = sku.unit}).ToListAsync();return datas;}@@ -358,8 +360,8 @@ namespace ModernWMS.WMS.Servicescustomer_id = dg.Key.customer_id,customer_name = dg.Key.customer_name,qty = dg.Sum(t => t.d.qty),- volume = dg.Sum(t =>t.spu.volume_unit==1? t.d.volume:(t.spu.volume_unit==0?t.d.volume/1000:t.d.volume*1000)),- weight = dg.Sum(t =>t.spu.weight_unit==0?t.d.weight/1000000:(t.spu.weight_unit==1? t.d.weight/1000:t.d.weight)),+ volume = dg.Sum(t => t.spu.volume_unit == 1 ? t.d.volume : (t.spu.volume_unit == 0 ? t.d.volume / 1000 : t.d.volume * 1000)),+ weight = dg.Sum(t => t.spu.weight_unit == 0 ? t.d.weight / 1000000 : (t.spu.weight_unit == 1 ? t.d.weight / 1000 : t.d.weight)),creator = dg.Key.creator,};query = query.Where(queries.AsExpression<PreDispatchlistViewModel>());@@ -568,7 +570,7 @@ namespace ModernWMS.WMS.Servicesjoin spu in spu_DBSet on sku.spu_id equals spu.idjoin owner in owner_DBSet.AsNoTracking() on sg.goods_owner_id equals owner.id into owner_leftfrom owner in owner_left.DefaultIfEmpty()- join gl in location_DBSet.Where(t=>t.warehouse_area_property != 5).AsNoTracking() on sg.goods_location_id equals gl.id into gl_left+ join gl in location_DBSet.Where(t => t.warehouse_area_property != 5).AsNoTracking() on sg.goods_location_id equals gl.id into gl_leftfrom gl in gl_left.DefaultIfEmpty()where dl.dispatch_no == dispatch_no && dl.tenant_id == currentUser.tenant_id && (dl.dispatch_status == 0 || dl.dispatch_status == 1)select new@@ -655,9 +657,9 @@ namespace ModernWMS.WMS.Servicespick.pick_qty = (r.qty <= (pick_qty + pick.qty_available)) ? (r.qty - pick_qty) : pick.qty_available;pick_qty += pick.pick_qty;}- r.pick_list = picklist.Where(t=>t.qty_available>0).ToList();+ r.pick_list = picklist.Where(t => t.qty_available > 0).ToList();}-+return res;}