dengyu 1 year ago
parent 553c4256fe
commit 1c19d8fd78

@ -499,6 +499,21 @@ namespace VOL.WMS.Services
item.GOODSNAME = head.GOODSNAME;
}
}
//处理项号
if (InPlanGoodsList.Exists(x => x.XH == null || x.XH == "") && InPlanGoodsList.Exists(x => x.XH != null && x.XH != ""))
{
var XH = InPlanGoodsList.FirstOrDefault(x => x.XH != null && x.XH != "").XH;
foreach (var item in InPlanGoodsList)
{
if (string.IsNullOrWhiteSpace(item.XH))
{
item.XH = XH;
}
}
}
#region 处理提单号
//判断主表 明细表 提单号
if (string.IsNullOrEmpty(head.MBLNO) && InPlanGoodsList.All(x => string.IsNullOrEmpty(x.MBLNO)))
@ -752,6 +767,30 @@ namespace VOL.WMS.Services
item.GOODSNAME = head.GOODSNAME;
}
}
var XH = "";
var SaveDetailIdList = InPlanGoodsList.Select(x => x.GID).ToList();
var CurrDetail = OP_WMS_IN_PLAN_GOODSRepository.Instance.FindAsIQueryable(x => x.WMSPLANID == head.WMSPLANID && !SaveDetailIdList.Contains(x.GID)).ToList();
if (InPlanGoodsList.Exists(x => x.XH == null || x.XH == "") && InPlanGoodsList.Exists(x => x.XH != null && x.XH != ""))
{
XH = InPlanGoodsList.FirstOrDefault(x => x.XH != null && x.XH != "").XH;
}
if (!InPlanGoodsList.Exists(x => x.XH != null && x.XH != "") && CurrDetail.Exists(x=> x.XH != null && x.XH != ""))
{
XH = CurrDetail.FirstOrDefault(x => x.XH != null && x.XH != "").XH;
}
if (XH != "") {
foreach (var item in InPlanGoodsList)
{
if (string.IsNullOrWhiteSpace(item.XH))
{
item.XH = XH;
}
}
}
#region 处理提单号
//判断主表 明细表 提单号
if (string.IsNullOrEmpty(head.MBLNO) && InPlanGoodsList.All(x => string.IsNullOrEmpty(x.MBLNO)))

@ -765,7 +765,7 @@ namespace VOL.WMS.Services
repository.AddRange(dealedbodylist2[0]);
repository.UpdateRange(dealedbodylist2[1], x => new { x });
repository.SaveChangesAsync();
repository.SaveChanges();
OP_WMS_TRUCKINFOService.Instance.DealSaveDetailList(dealedbodylist2[0]);
OP_WMS_TRUCKINFOService.Instance.DealSaveDetailList(dealedbodylist2[1]);
@ -878,20 +878,67 @@ namespace VOL.WMS.Services
if (List != null && List.Count > 0)
{
if (!AddDetailList.Exists(x => x.TRUCKNO != null && x.TRUCKNO != ""))
var trucknoList = new List<string>();
var currtrucknoList = List.Select(s => s.TRUCKNO).Distinct().ToList();
trucknoList.AddRange(currtrucknoList);
var truck_0 = trucknoList[0];
foreach (var item in AddDetailList)
{
foreach (var item in AddDetailList)
if (!trucknoList.Exists(x => x == item.TRUCKNO && item.TRUCKNO != null && item.TRUCKNO != ""))
{
item.TRUCKNO = List[0].TRUCKNO;
trucknoList.Add(item.TRUCKNO);
}
if (item.TRUCKNO == null || item.TRUCKNO == "")
{
item.TRUCKNO = truck_0;
}
}
if (!UpdDetailList.Exists(x => x.TRUCKNO != null && x.TRUCKNO != ""))
foreach (var item in UpdDetailList)
{
if (!trucknoList.Exists(x => x == item.TRUCKNO && item.TRUCKNO != null && item.TRUCKNO != ""))
{
trucknoList.Add(item.TRUCKNO);
}
if (item.TRUCKNO == null || item.TRUCKNO == "")
{
item.TRUCKNO = truck_0;
}
}
if (trucknoList != null && trucknoList.Count > 0)
{
foreach (var truckno in trucknoList)
{
if (currtrucknoList.Exists(x => x == truckno)) {
continue;
}
var newrec = new OP_WMS_TRUCK();
newrec.TRUCKNO = truckno;
newrec.WMSPLANID = head.WMSPLANID;
OP_WMS_TRUCKRepository.Instance.Add(newrec, true);
}
foreach (var item in AddDetailList)
{
if (item.TRUCKNO == null || item.TRUCKNO == "")
{
item.TRUCKNO = trucknoList[0];
}
}
foreach (var item in UpdDetailList)
{
item.TRUCKNO = List[0].TRUCKNO;
if (item.TRUCKNO == null || item.TRUCKNO == "")
{
item.TRUCKNO = trucknoList[0];
}
}
}
}

Loading…
Cancel
Save