| | |
| | | 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 |
| | | { |
| | |
| | | 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 |
| | |
| | | WorkNo = detail.WorkNo, |
| | | CbillNo = detail.CbillNo, |
| | | WorkLine = detail.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | Remark = itemBarcodeDetails.Memo, |
| | | EbelnK3id = detail.EbelnK3id, |
| | |
| | | EpFlag = true, |
| | | WorkType = 1, |
| | | ItemNo = detail.ItemNo, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | DepotCode = mesDepost.DepotCode, |
| | | DepotSectionCode = sectionCode, |
| | |
| | | EbelnLineNo = detail.EbelnLine, |
| | | CbillNo = detail.CbillNo, |
| | | WorkLine = detail.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | Remark = itemBarcodeDetails.Memo, |
| | | EbelnK3id = detail.EbelnK3id, |
| | |
| | | EpFlag = true, |
| | | WorkType = 1, |
| | | ItemNo = detail.ItemNo, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | DepotCode = mesDepost.DepotCode, |
| | | DepotSectionCode = sectionCode, |
| | |
| | | BillNo = cBillNo, |
| | | WorkNo = itemBarcodeDetails.WorkNo, |
| | | WorkLine = itemBarcodeDetails.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | EbelnK3id = itemBarcodeDetails.EbelnK3id, |
| | | LineK3id = itemBarcodeDetails.LineK3id, |
| | |
| | | EbelnLineNo = itemBarcodeDetails.WorkLine, |
| | | CbillNo = itemBarcodeDetails.BillNo, |
| | | WorkLine = itemBarcodeDetails.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | Remark = itemBarcodeDetails.Memo, |
| | | EbelnK3id = itemBarcodeDetails.EbelnK3id, |
| | |
| | | WorkType = 1, |
| | | ItemNo = itemBarcodeDetails.ItemNo, |
| | | LotNo = itemBarcodeDetails.LotNo, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | DepotCode = mesDepost.DepotCode, |
| | | DepotSectionCode = sectionCode, |
| | |
| | | BillNo = cBillNo, |
| | | WorkNo = itemBarcodeDetails.WorkNo, |
| | | WorkLine = itemBarcodeDetails.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | EbelnK3id = itemBarcodeDetails.EbelnK3id, |
| | | LineK3id = itemBarcodeDetails.LineK3id, |
| | |
| | | BoardStyle = itemBarcodeDetails.BoardStyle, |
| | | WorkNo = itemBarcodeDetails.WorkNo, |
| | | WorkLine = itemBarcodeDetails.WorkLine, |
| | | SuppId = itemBarcodeDetails.SuppId, |
| | | SuppNo = itemBarcodeDetails.SuppNo, |
| | | EbelnK3id = itemBarcodeDetails.EbelnK3id, |
| | | LineK3id = itemBarcodeDetails.LineK3id, |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | var ErpUrl = AppsettingsUtility.Settings.ProductionErpUrl; |
| | | |
| | | var newGuid = Guid.NewGuid(); |
| | | var message = new MessageCenter |
| | | { |
| | | Guid = newGuid, |
| | | //Pid = newGuid, |
| | | TableName = tableName, |
| | | Url = ErpUrl, |
| | | Status = 1, |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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(); |
| | | |
| | | |
| | |
| | | |
| | | 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, |
| | | FMesEntryid = d.FMesEntryid |
| | | }).ToList(); |
| | | |
| | | var fdate = DateTime.Now.ToString("yyyy-MM-dd"); |