From 0747dfae91918348658f9388c0d2df8b11efa32d Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期二, 19 十一月 2024 15:25:46 +0800 Subject: [PATCH] 1 --- service/Warehouse/MesInvItemInCDetailsManager.cs | 104 ++++++++++++++++++++++++++++----------------------- 1 files changed, 57 insertions(+), 47 deletions(-) diff --git a/service/Warehouse/MesInvItemInCDetailsManager.cs b/service/Warehouse/MesInvItemInCDetailsManager.cs index 6f65aea..01ccc2e 100644 --- a/service/Warehouse/MesInvItemInCDetailsManager.cs +++ b/service/Warehouse/MesInvItemInCDetailsManager.cs @@ -149,8 +149,7 @@ cBillNo = BillNo.GetBillNo("IN(鍏ュ簱鍗�)"); var suppNo = db.Queryable<MesSupplier>() - .Where(s => s.Id.ToString() == inventory.SuppId) - .Select(s => s.SuppNo).First(); + .Where(s => s.Id.ToString() == inventory.SuppId).First(); db.Insertable(new MesInvItemIns { @@ -158,14 +157,18 @@ BillNo = cBillNo, BillTypeId = billTypeId, InsDate = DateTime.Now, + DepotsId = mesDepost.DepotId, DepotsCode = mesDepost.DepotCode, TransctionNo = transactionNo, - SuppNo = suppNo, + SuppId = suppNo.Id.ToString(), + SuppNo = suppNo.SuppNo, CreateBy = user, CreateDate = DateTime.Now, LastupdateBy = user, LastupdateDate = DateTime.Now, - UrgentFlag = itemBarcodeDetails.UrgentFlag.Value ? 1 : 0, + UrgentFlag = itemBarcodeDetails.UrgentFlag.Value + ? (byte)1 + : (byte)0, CbillNo = itemBarcodeDetails.BillNo, Fstatus = 0, Status = 0 @@ -236,6 +239,7 @@ WorkNo = detail.WorkNo, CbillNo = detail.CbillNo, WorkLine = detail.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, Remark = itemBarcodeDetails.Memo, EbelnK3id = detail.EbelnK3id, @@ -267,6 +271,7 @@ EpFlag = true, WorkType = 1, ItemNo = detail.ItemNo, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, DepotCode = mesDepost.DepotCode, DepotSectionCode = sectionCode, @@ -327,6 +332,7 @@ EbelnLineNo = detail.EbelnLine, CbillNo = detail.CbillNo, WorkLine = detail.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, Remark = itemBarcodeDetails.Memo, EbelnK3id = detail.EbelnK3id, @@ -358,6 +364,7 @@ EpFlag = true, WorkType = 1, ItemNo = detail.ItemNo, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, DepotCode = mesDepost.DepotCode, DepotSectionCode = sectionCode, @@ -407,6 +414,7 @@ BillNo = cBillNo, WorkNo = itemBarcodeDetails.WorkNo, WorkLine = itemBarcodeDetails.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, EbelnK3id = itemBarcodeDetails.EbelnK3id, LineK3id = itemBarcodeDetails.LineK3id, @@ -444,6 +452,7 @@ EbelnLineNo = itemBarcodeDetails.WorkLine, CbillNo = itemBarcodeDetails.BillNo, WorkLine = itemBarcodeDetails.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, Remark = itemBarcodeDetails.Memo, EbelnK3id = itemBarcodeDetails.EbelnK3id, @@ -478,6 +487,7 @@ WorkType = 1, ItemNo = itemBarcodeDetails.ItemNo, LotNo = itemBarcodeDetails.LotNo, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, DepotCode = mesDepost.DepotCode, DepotSectionCode = sectionCode, @@ -530,6 +540,7 @@ BillNo = cBillNo, WorkNo = itemBarcodeDetails.WorkNo, WorkLine = itemBarcodeDetails.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, EbelnK3id = itemBarcodeDetails.EbelnK3id, LineK3id = itemBarcodeDetails.LineK3id, @@ -554,6 +565,7 @@ BoardStyle = itemBarcodeDetails.BoardStyle, WorkNo = itemBarcodeDetails.WorkNo, WorkLine = itemBarcodeDetails.WorkLine, + SuppId = itemBarcodeDetails.SuppId, SuppNo = itemBarcodeDetails.SuppNo, EbelnK3id = itemBarcodeDetails.EbelnK3id, LineK3id = itemBarcodeDetails.LineK3id, @@ -746,14 +758,12 @@ WarehouseQuery query) { var parsedGuid = Guid.Empty; - if (string.IsNullOrEmpty(query.id)) + if (!string.IsNullOrEmpty(query.id)) { - return ([], 0); + bool isValid = Guid.TryParse(query.id, out parsedGuid); + if (!isValid) + throw new ApplicationException("GUID杞崲閿欒"); } - - bool isValid = Guid.TryParse(query.id, out parsedGuid); - if (!isValid) - throw new ApplicationException("GUID杞崲閿欒"); var totalCount = 0; var result = Db.Queryable<MesInvItemIns, MesDepots, MesSupplier>( @@ -796,21 +806,21 @@ throw new ApplicationException("GUID杞崲閿欒"); var result = Db.Queryable<MesInvItemInCDetails, MesItems, MesUnit>( - (g, c,d) => new JoinQueryInfos( - JoinType.Left,g.ItemId == c.Id, - JoinType.Inner,d.Id == Convert.ToDecimal(g.Unit) - ) - ).WhereIF(UtilityHelper.CheckGuid(parsedGuid), - (g, c,d) => g.ItemInId == parsedGuid) - .Select((g, c,d)=> new MesInvItemInCItems - { - Guid = g.Guid, - WorkNo = g.WorkNo, - ItemNo = c.ItemNo, - ItemSname = g.ItemSname, - Quantity = g.Quantity, - Unit = d.Fname, - }) + (g, c, d) => new JoinQueryInfos( + JoinType.Left, g.ItemId == c.Id, + JoinType.Inner, d.Id == Convert.ToDecimal(g.Unit) + ) + ).WhereIF(UtilityHelper.CheckGuid(parsedGuid), + (g, c, d) => g.ItemInId == parsedGuid) + .Select((g, c, d) => new MesInvItemInCItems + { + Guid = g.Guid, + WorkNo = g.WorkNo, + ItemNo = c.ItemNo, + ItemSname = g.ItemSname, + Quantity = g.Quantity, + Unit = d.Fname, + }) .ToList(); return result; @@ -874,8 +884,12 @@ } var ErpUrl = AppsettingsUtility.Settings.ProductionErpUrl; + + var newGuid = Guid.NewGuid(); var message = new MessageCenter { + Guid = newGuid, + //Pid = newGuid, TableName = tableName, Url = ErpUrl, Status = 1, @@ -899,11 +913,10 @@ var message = MesToErpParam(query); var executeReturnIdentity = - Db.Insertable(message).ExecuteReturnIdentity(); + Db.Insertable(message).ExecuteCommand(); if (executeReturnIdentity > 0) { - //message.Guid = executeReturnIdentity; - message.Pid = executeReturnIdentity; + message.Pid = message.Guid; return message; } @@ -947,24 +960,20 @@ MesInvItemArnDetail>( (g, c, d, a) => new JoinQueryInfos( JoinType.Left, - g.ItemNo == c.ItemNo && g.Company == c.Company && - g.Factory == c.Factory, JoinType.Inner, + g.ItemId == c.Id , JoinType.Inner, d.Id == Convert.ToDecimal(c.ItemUnit), - JoinType.Inner, - a.Ebeln == g.WorkNo && a.WorkLine == g.EbelnLineNo - && g.CbillNo == a.CbillNo + JoinType.Inner, a.Ebeln == g.WorkNo && g.CbillNo == a.CbillNo ) ).Where((g, c, d, a) => g.BillNo == billNo).Select<Material>( (g, c, d, a) => new Material { - // FstockId = g.DepotCode, - // FuintId = d.Fnumber, - // FsrcEntryId = a.Id, - // FmesEntryId = g.Id, - // FmaterialId = a.ItemNo, - // DepotSectionCode = g.DepotSectionCode, - // WorkNo = g.WorkNo, - // Frealqty = g.Quantity + FMaterialId = c.ItemNo, + FRealQty = g.Quantity.ToString(), + FStockId = g.DepotCode, + FLot = a.CbillNo, + FUnitID = d.Fnumber, + FsrcEntryId = a.Guid.ToString(), + FMesEntryid = g.Guid.ToString() }).ToList(); @@ -974,12 +983,13 @@ var jsonEntries = materials.Select(d => new { - // FMaterialId = d.FmaterialId, - // FUintId = d.FuintId, - // FRealQty = d.Frealqty, - // FStockId = d.FstockId, - // FSRCENTRYID = d.FsrcEntryId.ToString(), - // F_MES_ENTRYID = d.FmesEntryId.ToString() + FMaterialId = d.FMaterialId, + FRealQty = d.FRealQty, + FStockId = d.FStockId, + FLot = d.FLot, + FUnitID = d.FUnitID, + FSRCENTRYID = d.FsrcEntryId, + F_MES_ENTRYID = d.FMesEntryid }).ToList(); var fdate = DateTime.Now.ToString("yyyy-MM-dd"); -- Gitblit v1.9.3