| | |
| | | SrcBillentryseq = dto.FSrcBillEntrySeq, /// 源单分录行号 |
| | | SaleOrderNo = dto.FSaleOrderNo, /// 需求单据号 |
| | | SaleOrderEntryseq = dto.FSaleOrderEntrySeq, /// 需求单据行号 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | CustNumber = dto.CustNumber, /// 客户编号 |
| | | ErpSczz = Convert.ToInt32(dto.FPrdOrgId), /// 生产组织ID |
| | | ErpWtzz = Convert.ToInt32(dto.FEnTrustOrgId), /// 委托组织ID |
| | | Btbz = dto.Btbz, /// 委托组织ID |
| | |
| | | SynchronousDate = DateTime.Now, |
| | | DocumentStatus = dto.FDocumentStatus |
| | | }; |
| | | |
| | | //工作中心编码转ID,Caa021 = dto.FWorkShopID0 |
| | | var entityCaa021 = Db.Queryable<SysDepartment>() |
| | | .Where(x => x.Departmentcode == dto.FWorkShopID0) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityCaa021)) |
| | | { |
| | | entity.Caa021 = entityCaa021; |
| | | } |
| | | else |
| | | { |
| | | entity.Caa021 = "0"; |
| | | } |
| | | |
| | | //仓库编码转ID,DepotCode = dto.FStockId, |
| | | var entityDepotCode = Db.Queryable<MesDepots>() |
| | | .Where(x => x.DepotCode == dto.FStockId) |
| | | .Select(x => x.DepotId.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityDepotCode)) |
| | | { |
| | | entity.DepotCode = entityDepotCode; |
| | | } |
| | | else |
| | | { |
| | | entity.DepotCode = "0"; |
| | | } |
| | | |
| | | //产品(物料)编码转ID,Caa006 = dto.FMaterialId, /// |
| | | var entityCaa006 = Db.Queryable<MesItems>() |
| | | .Where(x => x.ItemNo == dto.FMaterialId) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityCaa006)) |
| | | { |
| | | entity.Caa006 = entityCaa006; |
| | | } |
| | | else |
| | | { |
| | | entity.Caa006 = "0"; |
| | | } |
| | | |
| | | //单位编码转ID,Caa009 = dto.FUnitId, |
| | | var entityCaa009 = Db.Queryable<MesUnit>() |
| | | .Where(x => x.Fnumber == dto.FUnitId) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityCaa009)) |
| | | { |
| | | entity.Caa009 = entityCaa009; |
| | | } |
| | | else |
| | | { |
| | | entity.Caa009 = "0"; |
| | | } |
| | | |
| | | //计划员编码转ID,PlanId = dto.FPlannerID, |
| | | var entityPlanId = Db.Queryable<MesStaff>() |
| | | .Where(x => x.StaffNo == dto.FPlannerID) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityPlanId)) |
| | | { |
| | | entity.PlanId = entityPlanId; |
| | | } |
| | | else |
| | | { |
| | | entity.PlanId = "0"; |
| | | } |
| | | |
| | | //结案人编码转ID,ForceCloserid = dto.FForceCloserId, |
| | | var entityForceCloserid = Db.Queryable<MesStaff>() |
| | | .Where(x => x.StaffNo == dto.FForceCloserId) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityForceCloserid)) |
| | | { |
| | | entity.ForceCloserid = entityForceCloserid; |
| | | } |
| | | else |
| | | { |
| | | entity.ForceCloserid = "0"; |
| | | } |
| | | |
| | | //客户编码转ID,CustNumber = dto.CustNumber, |
| | | var entityCustNumber = Db.Queryable<MesStaff>() |
| | | .Where(x => x.StaffNo == dto.CustNumber) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityCustNumber)) |
| | | { |
| | | entity.CustNumber = entityCustNumber; |
| | | } |
| | | else |
| | | { |
| | | entity.CustNumber = "0"; |
| | | } |
| | | |
| | | //根据单号+单别,获取对应的id |
| | | var singleId = Db.Queryable<Womcaa>() |
| | |
| | | // ParentItemName = dto.F_XIFG_Base_apv /// 父项物料名称 |
| | | }; |
| | | |
| | | //仓库编码转ID,DepotCode = dto.FStockID, |
| | | var entityDepotCode = Db.Queryable<MesDepots>() |
| | | .Where(x => x.DepotCode == dto.FStockID) |
| | | .Select(x => x.DepotId.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityDepotCode)) |
| | | { |
| | | womcab.DepotCode = entityDepotCode; |
| | | } |
| | | else |
| | | { |
| | | womcab.DepotCode = "0"; |
| | | } |
| | | |
| | | //单位编码转ID,Cab009 = dto.FUnitID, |
| | | var entityCab009 = Db.Queryable<MesUnit>() |
| | | .Where(x => x.Fnumber == dto.FUnitID) |
| | | .Select(x => x.Id.ToString()) |
| | | .First(); |
| | | if (!string.IsNullOrWhiteSpace(entityCab009)) |
| | | { |
| | | womcab.Cab009 = entityCab009; |
| | | } |
| | | else |
| | | { |
| | | womcab.Cab009 = "0"; |
| | | } |
| | | |
| | | //根据单号+单别+材料品号,获取对应的id |
| | | var singleId = Db.Queryable<Womcab>() |
| | | .Where(x => x.Cab001 == dto.FBillNo && x.Cab003 == dto.FMaterialID2 && x.Cab002 == Convert.ToInt32(dto.FBillNoType)) |