| | |
| | | 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>( |
| | | (a, b, c) => |
| | | new JoinQueryInfos(JoinType.Left, |
| | | a.DepotsCode == b.DepotCode, |
| | | JoinType.Left, a.SuppNo == c.SuppNo)) |
| | | a.DepotsId == b.DepotId, |
| | | JoinType.Left, a.SuppId == c.Id.ToString())) |
| | | .WhereIF(UtilityHelper.CheckGuid(parsedGuid), |
| | | (a, b, c) => a.Guid == parsedGuid) |
| | | .Select((a, b, c) => new MesInvItemIns |
| | |
| | | (g, c, d) => new JoinQueryInfos( |
| | | JoinType.Left, |
| | | g.ItemId == c.Id, JoinType.Inner, |
| | | d.Id == Convert.ToDecimal(c.ItemUnit) |
| | | d.Id.ToString() == c.Fpurchaseunitid |
| | | ) |
| | | ).WhereIF(UtilityHelper.CheckGuid(parsedGuid), |
| | | (g, c, d) => g.ItemInId == parsedGuid) |
| | |
| | | } |
| | | |
| | | 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, |
| | | d.Id == Convert.ToDecimal(c.ItemUnit), |
| | | JoinType.Inner, |
| | | a.Ebeln == g.WorkNo && a.WorkLine == g.EbelnLineNo |
| | | && g.CbillNo == a.CbillNo |
| | | g.ItemId == c.Id , JoinType.Inner, |
| | | d.Id.ToString() == c.Fpurchaseunitid, |
| | | 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, |
| | | FUintId = d.FUnitID, |
| | | FSRCENTRYID = d.FsrcEntryId, |
| | | F_MES_ENTRYID = d.FMesEntryid |
| | | }).ToList(); |
| | | |
| | | var fdate = DateTime.Now.ToString("yyyy-MM-dd"); |