| | |
| | | //} |
| | | |
| | | //传什么,c就改成什么 |
| | | if (type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "F"))//C表示已审核状态 |
| | | if (type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "Y"))//Y表示已审核状态 |
| | | { |
| | | mesRohIn.BillNo = mesRohIn.BillNo + "F" + mesRohIn.EbelnK3id.ToString(); |
| | | mesRohIn.BillNo = mesRohIn.BillNo + "Y" + mesRohIn.EbelnK3id.ToString(); |
| | | } |
| | | |
| | | if (mesRohIn.Guid != null) |
| | |
| | | mesRohIn.PurchaseDate = DateTime.ParseExact(rohIn.FDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | //供应商转编码 |
| | | //供应商编码转ID |
| | | var mesRohInSupplier = Db.Queryable<MesSupplier>() |
| | | .Where(x => x.SuppNo == rohIn.FSupplierId) |
| | | .Select(x => x.Id.ToString()) |
| | |
| | | //mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId; |
| | | mesRohIn.PurchaseOrg = string.IsNullOrEmpty(rohIn.FPurchaseOrgId) ? "1" : rohIn.FPurchaseOrgId;//采购组织 |
| | | |
| | | //采购部门转编码 |
| | | //采购部门编码转ID |
| | | var mesRohInPurchaseDept = Db.Queryable<SysDepartment>() |
| | | .Where(x => x.Departmentcode == rohIn.FPurchaseDeptId) |
| | | .Select(x => x.Departmentid.ToString()) |
| | |
| | | SalesOrderId = s.F_UNW_Text_xsddh |
| | | }; |
| | | |
| | | //采购单位转编码 |
| | | //采购单位编码转ID |
| | | var entityPurchaseUnit = Db.Queryable<MesUnit>() |
| | | .Where(x => x.Fnumber == s.FUnitId) |
| | | .Select(x => x.Id.ToString()) |
| | |
| | | entity.PurchaseUnit = "0"; |
| | | } |
| | | |
| | | //计价单位转编码 |
| | | //计价单位编码转ID |
| | | var entityPricingUnit = Db.Queryable<MesUnit>() |
| | | .Where(x => x.Fnumber == s.FPriceUnitId) |
| | | .Select(x => x.Id.ToString()) |
| | |
| | | entity.PricingUnit = "0"; |
| | | } |
| | | |
| | | //物料编码转ID |
| | | var entityItemId = Db.Queryable<MesItems>() |
| | | .Where(x => x.ItemNo == s.FMaterialId) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityItemId)) |
| | | { |
| | | entity.ItemId = entityItemId; |
| | | } |
| | | else if (!string.IsNullOrWhiteSpace(s.FMaterialId)) |
| | | { |
| | | entity.ItemId = s.FMaterialId; |
| | | } |
| | | else |
| | | { |
| | | entity.ItemId = "0"; |
| | | } |
| | | |
| | | if (s.FFreezeDate != null) |
| | | if (!s.FFreezerId.IsNullOrEmpty()) |
| | | entity.FreezeTime = |