wm:修改出库单
This commit is contained in:
@@ -62,7 +62,11 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
var response = _WmGoodsNowProductionService.QueryshortPatch(parm);
|
var response = _WmGoodsNowProductionService.QueryshortPatch(parm);
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 移动端 短批次号查询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpGet("patchsearchdetail")]
|
[HttpGet("patchsearchdetail")]
|
||||||
public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
|
public IActionResult Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -82,12 +82,22 @@ namespace ZR.Model.MES.wms.Dto
|
|||||||
/// 需求数量
|
/// 需求数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RequireOutNum { get; set; }
|
public int RequireOutNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 需求箱数
|
||||||
|
/// </summary>
|
||||||
|
public int Require_pack_num { get; set; }
|
||||||
|
|
||||||
//现有箱数
|
|
||||||
|
//库存零件数
|
||||||
|
public int ItemNum { get; set; }
|
||||||
|
|
||||||
|
//库存箱数
|
||||||
public int PackageNum { get; set; }
|
public int PackageNum { get; set; }
|
||||||
|
|
||||||
//现有零件数
|
|
||||||
public int ItemNum { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,5 +87,14 @@ namespace ZR.Model.MES.wms
|
|||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||||
public DateTime? UpdatedTime { get; set; }
|
public DateTime? UpdatedTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 这一批次下的 库存箱子数
|
||||||
|
/// </summary>
|
||||||
|
public int Inventory_pack_num { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 这一批次下的 库存零件数
|
||||||
|
/// </summary>
|
||||||
|
public int Inventory_num { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace ZR.Service.mes.wms
|
|||||||
|
|
||||||
//todo 合并
|
//todo 合并
|
||||||
|
|
||||||
return WmGoods_nodeDto_list_parent.OrderBy(it => it.PackageCodeClient_son).ToList();
|
return WmGoods_nodeDto_list_parent.OrderByDescending(it => it.PackageCodeClient_son).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -161,7 +161,9 @@ namespace ZR.Service.mes.wms
|
|||||||
.AndIF(!string.IsNullOrEmpty(parm.PackageCodeClient), it => it.PackageCodeClient.Contains(parm.PackageCodeClient));
|
.AndIF(!string.IsNullOrEmpty(parm.PackageCodeClient), it => it.PackageCodeClient.Contains(parm.PackageCodeClient));
|
||||||
|
|
||||||
var response = Queryable()
|
var response = Queryable()
|
||||||
.Where(predicate.ToExpression()).ToList();
|
.Where(predicate.ToExpression())
|
||||||
|
.OrderBy(it=>it.PackageCodeClient)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
return response.Adapt<List<WmGoodsNowProductionDto>>();
|
return response.Adapt<List<WmGoodsNowProductionDto>>();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using System.Collections;
|
|||||||
using Infrastructure.Model;
|
using Infrastructure.Model;
|
||||||
using ZR.Service;
|
using ZR.Service;
|
||||||
using ZR.Service.Utils;
|
using ZR.Service.Utils;
|
||||||
|
using Aliyun.OSS;
|
||||||
|
|
||||||
namespace ZR.Service.mes.wms
|
namespace ZR.Service.mes.wms
|
||||||
{
|
{
|
||||||
@@ -268,15 +269,34 @@ namespace ZR.Service.mes.wms
|
|||||||
{
|
{
|
||||||
foreach (var stock in stockList)
|
foreach (var stock in stockList)
|
||||||
{
|
{
|
||||||
//现有箱数
|
//库存箱数
|
||||||
stock.PackageNum = Context.Queryable<WmGoodsNowProduction>()
|
stock.PackageNum = Context.Queryable<WmGoodsNowProduction>()
|
||||||
.Where(it => it.Partnumber == stock.Partnumber).Count();
|
.Where(it => it.Partnumber == stock.Partnumber).Count();
|
||||||
|
|
||||||
//现有零件数
|
//库存零件数
|
||||||
int? num = Context.Queryable<WmGoodsNowProduction>()
|
int? num = Context.Queryable<WmGoodsNowProduction>()
|
||||||
.Where(it => it.Partnumber == stock.Partnumber)
|
.Where(it => it.Partnumber == stock.Partnumber)
|
||||||
.Sum(it => it.GoodsNumAction);
|
.Sum(it => it.GoodsNumAction);
|
||||||
stock.ItemNum = num ?? 0;
|
stock.ItemNum = num ?? 0;
|
||||||
|
|
||||||
|
// 需求箱数
|
||||||
|
List<WmGoodsNowProduction> list= Context.Queryable<WmGoodsNowProduction>()
|
||||||
|
.Where(it => it.Partnumber == stock.Partnumber).OrderByDescending(it=>it.PackageCodeClient).ToList();
|
||||||
|
|
||||||
|
int sum = 0;
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
sum = sum + item.GoodsNumLogic??0;
|
||||||
|
if(sum>= stock.RequireOutNum)
|
||||||
|
{
|
||||||
|
stock.Require_pack_num=list.IndexOf(item)+1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,21 +379,7 @@ namespace ZR.Service.mes.wms
|
|||||||
Patchtime = g.Max(p => p.Patchtime),
|
Patchtime = g.Max(p => p.Patchtime),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
/*if (wmOutOrderPlans.Count > 0)
|
|
||||||
{
|
|
||||||
var item = wmOutOrderPlans.GroupBy(it => it.Patchcode_short).Select(g => new
|
|
||||||
{
|
|
||||||
FkOutOrderId = g.Max(p => p.FkOutOrderId),
|
|
||||||
Patchcode = g.Max(p => p.Patchcode),
|
|
||||||
Patchcode_short = g.Max(p => p.Patchcode_short),
|
|
||||||
WarehouseCode = g.Max(p => p.WarehouseCode),
|
|
||||||
PackageNum = g.Count(),
|
|
||||||
RequireNum = g.Max(p => p.RequireNum),
|
|
||||||
Patchtime = g.Max(p => p.Patchtime),
|
|
||||||
});
|
|
||||||
wmOutOrderPlans.Clear();
|
|
||||||
wmOutOrderPlans.Add(item.Adapt<WmOutOrderPlan>());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -383,7 +389,16 @@ namespace ZR.Service.mes.wms
|
|||||||
{
|
{
|
||||||
witem.Id = count;
|
witem.Id = count;
|
||||||
witem.Outorder = count;
|
witem.Outorder = count;
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
witem.Inventory_pack_num = Context.Queryable<WmGoodsNowProduction>()
|
||||||
|
.Where(it=>it.PackageCodeClient== witem.Patchcode)
|
||||||
|
.Count();
|
||||||
|
witem.Inventory_num = Context.Queryable<WmGoodsNowProduction>()
|
||||||
|
.Where(it => it.PackageCodeClient == witem.Patchcode)
|
||||||
|
.Sum(it=>it.GoodsNumLogic)??0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user