| | |
| | | .IgnoreColumnsNull() |
| | | .ExecuteCommand() > 0; |
| | | |
| | | if (orUpdate && baOrUpdate) return true; |
| | | |
| | | if (orUpdate && baOrUpdate) |
| | | { |
| | | //定义输入参数 |
| | | var inputParam1 = new SugarParameter("P_WORK_NO", mesWomcaa.Caa001); |
| | | // 定义输出参数 |
| | | var outParam1 = new SugarParameter("c_Result", null, true); |
| | | var outParam2 = new SugarParameter("C_MSG", null, true); |
| | | // 使用 SqlSugar 执行存储过程 |
| | | Db.Ado.ExecuteCommand("BEGIN PRC_UPDATE_DAA(:P_WORK_NO,:c_Result,:C_MSG); END;", inputParam1, outParam1, outParam2); |
| | | // 获取输出参数的值 |
| | | int result = int.Parse((string)outParam1.Value); |
| | | string message = outParam2.Value == DBNull.Value ? string.Empty : (string)outParam2.Value; |
| | | if (result == 1) |
| | | { |
| | | //存储过程失败则事务进行回滚 |
| | | //db.Ado.RollbackTran(); |
| | | throw new Exception(message); |
| | | } |
| | | // 提交事务 |
| | | //db.Ado.CommitTran(); |
| | | return true; |
| | | } |
| | | |
| | | throw new NotImplementedException("更新失败"); |
| | | } |
| | | |
| | |
| | | { |
| | | var entity = new Womcaa |
| | | { |
| | | Erpid = Convert.ToInt32(dto.Id), |
| | | Erpid = Convert.ToInt64(dto.Id), |
| | | Caa001 = dto.FBillNo, |
| | | Caa021 = dto.FWorkShopID, |
| | | RoutingId = dto.FRoutingId, |
| | | WorkShopId = dto.FREMWorkShopId, |
| | | DepotCode = dto.FStockId, |
| | | CreateDate = dto.FDate, |
| | | Caa004 = dto.FBillType, |
| | |
| | | Caa013 = dto.FBomId, |
| | | |
| | | CreateType = dto.FCreateType, |
| | | Caa018 = !string.IsNullOrEmpty(dto.PLAN_ID) |
| | | ? Convert.ToInt32(dto.PLAN_ID) |
| | | : null, |
| | | Caa019 = Convert.ToInt32(dto.PLAN_SEQ), |
| | | Caa020 = dto.PLAN_NUM, |
| | | Caa020 = dto.FBillNo, |
| | | SrcBillType = dto.FSrcBillType, |
| | | SrcBillNo = dto.FSrcBillNo, |
| | | SrcBillentryseq = dto.FSrcBillEntrySeq, |
| | |
| | | CloseType = dto.FCloseType, |
| | | SrcSplitBillno = dto.FSrcSplitBillNo, |
| | | Caa016 = dto.FDescription, |
| | | //BTBZ = dto.BTBZ, |
| | | PrdOrg = dto.FPrdOrgId, |
| | | TrustOrg = dto.FEnTrustOrgId |
| | | //Typea = dto.TypeA |
| | | TrustOrg = dto.FEnTrustOrgId, |
| | | Bomtype = dto.FBOMType, |
| | | Bommaster = dto.FBOMMaster, |
| | | Bomaltrnate = dto.FBOMAlternate, |
| | | Bomeffedate = dto.FBOMEffeDate, |
| | | Routingalternate = dto.FRoutingAlternate, |
| | | Routingeffedate = dto.FRoutingEffeDate, |
| | | Mrpqty = dto.FMRPQty, |
| | | Actualstartdate = dto.FActualStartDate, |
| | | Actualcompletedate = dto.FActualCompleteDate, |
| | | Mosourcedoctype = dto.FMOSourceDocType, |
| | | Project = dto.FProject, |
| | | Ownerorg = dto.FOwnerOrg, |
| | | Createdby = dto.FCreatedBy, |
| | | Createdon = dto.FCreatedOn, |
| | | Totalstartqty = dto.FTotalStartQty, |
| | | Totalcompleteqty = dto.FTotalCompleteQty, |
| | | Totalrcvqty = dto.FTotalRcvQty, |
| | | Totalreworkingqty = dto.FTotalReworkingQty, |
| | | Reasonforrework = dto.FReasonForRework, |
| | | Isforcewholeset = dto.FIsForceWholeSet, |
| | | PREVMO = dto.FPrevMO, |
| | | Typea = dto.TypeA |
| | | }; |
| | | |
| | | |
| | | var single = base.GetSingle(it => it.Erpid == entity.Erpid); |
| | | if (single != null) entity.Id = single.Id; |
| | | |
| | | //Caa006 = dto.FMaterialId, |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(x => x.U9Id == dto.FMaterialId |
| | | && x.OrgId == dto.FPrdOrgId |
| | | && x.TableType == "MES_ITEMS").First(); |
| | | |
| | | var mesLinkU9_xm = Db.Queryable<MesLinkU9>() |
| | | .Where(x => x.U9Id == Convert.ToString(dto.FProject) |
| | | && x.OrgId == dto.FPrdOrgId |
| | | && x.TableType == "MES_PROJECT").First(); |
| | | |
| | | if (mesLinkU9 != null) entity.Caa006 = mesLinkU9.MesId; |
| | | if (mesLinkU9_xm != null) entity.Project = Convert.ToInt64(mesLinkU9_xm.MesId); |
| | | |
| | | return entity; |
| | | } |
| | |
| | | { |
| | | var womcab = new Womcab |
| | | { |
| | | Erpid = Convert.ToDecimal(dto.ID), |
| | | Erpid = !string.IsNullOrEmpty(dto.ID) |
| | | ? Convert.ToDecimal(dto.ID) |
| | | : throw new Exception("子表id不允许为空"), |
| | | Cab001 = dto.FBillNo, |
| | | Cab002 = dto.FSeq, |
| | | Cab003 = dto.FMaterialID, |
| | | Cab006 = Convert.ToDecimal(dto.FNeedQty), |
| | | //MustQty = Convert.ToDecimal(dto.FMustQty), |
| | | Cab007 = Convert.ToDecimal(dto.FPickedQty), |
| | | Cab006 = !string.IsNullOrEmpty(dto.FNeedQty) |
| | | ? Convert.ToDecimal(dto.FNeedQty) |
| | | : null, |
| | | MustQty = !string.IsNullOrEmpty(dto.FMustQty) |
| | | ? Convert.ToDecimal(dto.FMustQty) |
| | | : null, |
| | | Cab007 = !string.IsNullOrEmpty(dto.FPickedQty) |
| | | ? Convert.ToDecimal(dto.FPickedQty) |
| | | : null, |
| | | PositionNo = dto.FPositionNO, |
| | | SupplyOrganization = dto.FChildSupplyOrgId, |
| | | IssuingOrganization = dto.FSupplyOrg, |
| | | OwnerId = dto.FOwnerID, |
| | | Mtono = dto.FMTONO, |
| | | Lot = dto.FLot, |
| | | DepotCode = dto.FStockID, |
| | | IssueType = dto.FIssueType, |
| | | Cab009 = dto.FUnitID, |
| | | SupplyType = dto.FSupplyType, |
| | | Cab012 = Convert.ToDecimal(dto.FStdQty), |
| | | // Freplacegroup = Convert.ToInt32(dto.FReplaceGroup), |
| | | // UseRate = Convert.ToDecimal(dto.FUseRate), |
| | | // MaterialType = dto.FMaterialType, |
| | | Cab014 = Convert.ToInt32(dto.FIsKeyItem), |
| | | Numerator = Convert.ToDecimal(dto.FNumerator), |
| | | Denominator = Convert.ToDecimal(dto.FDenominator), |
| | | Pid = Convert.ToDecimal(dto.FID), |
| | | Eid = Convert.ToDecimal(dto.FID) |
| | | // SCRAPQTY = Convert.ToDecimal(dto.FFixScrapQty), |
| | | // SCRAPRATE = Convert.ToDecimal(dto.FScrapRate), |
| | | // Typeb = dto.TypeB, |
| | | // WR_F_XIFG_Base_qtr = dto.F_XIFG_Base_qtr, |
| | | // WR_F_XIFG_Base_83g = dto.F_XIFG_Base_83g |
| | | Cab012 = !string.IsNullOrEmpty(dto.FStdQty) |
| | | ? Convert.ToDecimal(dto.FStdQty) |
| | | : null, |
| | | FreplaceGroup = !string.IsNullOrEmpty(dto.FReplaceGroup) |
| | | ? Convert.ToInt64(dto.FReplaceGroup) |
| | | : null, |
| | | UseRate = !string.IsNullOrEmpty(dto.FUseRate) |
| | | ? Convert.ToDecimal(dto.FUseRate) |
| | | : null, |
| | | |
| | | Cab014 = !string.IsNullOrEmpty(dto.FIsKeyItem) |
| | | ? Convert.ToInt64(dto.FIsKeyItem) |
| | | : null, |
| | | Numerator = !string.IsNullOrEmpty(dto.FNumerator) |
| | | ? Convert.ToDecimal(dto.FNumerator) |
| | | : null, |
| | | Denominator = !string.IsNullOrEmpty(dto.FDenominator) |
| | | ? Convert.ToDecimal(dto.FDenominator) |
| | | : null, |
| | | Pid = !string.IsNullOrEmpty(dto.FID) |
| | | ? Convert.ToDecimal(dto.FID) |
| | | : throw new Exception("父id不允许为空"), |
| | | Eid = !string.IsNullOrEmpty(dto.FID) |
| | | ? Convert.ToDecimal(dto.FID) |
| | | : throw new Exception("父id不允许为空"), |
| | | Scrapqty = !string.IsNullOrEmpty(dto.FFixScrapQty) |
| | | ? Convert.ToDecimal(dto.FFixScrapQty) |
| | | : null, |
| | | Scraprate = !string.IsNullOrEmpty(dto.FScrapRate) |
| | | ? Convert.ToDecimal(dto.FScrapRate) |
| | | : null, |
| | | Project = dto.FProject, |
| | | Bomreqqty = dto.FBOMReqQty, |
| | | Materialtype = dto.FMaterialType, |
| | | IsOverIssue = dto.FIsOverIssue, |
| | | StandardMaterialscale = dto.FStandardMaterialScale, |
| | | Fixedmaterialnum = dto.FFixedMaterialNum, |
| | | IsSubstitute = dto.FIsSubstitute, |
| | | Substituteditem = dto.FSubstitutedItem, |
| | | Issueuom = dto.FIssueUOM, |
| | | Qpa = dto.FQPA, |
| | | Scraptype = dto.FScrapType, |
| | | Bfopportunity = dto.FBFOpportunity, |
| | | Supplywh = dto.FSupplyWh, |
| | | Mocompletesetcheck = dto.FMOCompleteSetCheck, |
| | | Mostartsetcheck = dto.FMOStartSetCheck, |
| | | Iscoupleissue = dto.FIsCoupleIssue, |
| | | FDescription = dto.FDescription, |
| | | TypeB = dto.TypeB |
| | | |
| | | }; |
| | | |
| | | var entity = Db.Queryable<Womcab>() |
| | | .Where(s => s.Erpid == womcab.Erpid).Single(); |
| | | if (entity != null) womcab.Id = entity.Id; |
| | | |
| | | //Cab003 = dto.FMaterialID |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(x => x.U9Id == dto.FMaterialID |
| | | && x.OrgId == "1002011210000095" |
| | | && x.TableType == "MES_ITEMS").First(); |
| | | |
| | | var mesLinkU9_xm = Db.Queryable<MesLinkU9>() |
| | | .Where(x => x.U9Id == Convert.ToString(dto.FProject) |
| | | && x.OrgId == "1002011210000095" |
| | | && x.TableType == "MES_PROJECT").First(); |
| | | |
| | | if (mesLinkU9 != null) womcab.Cab003 = mesLinkU9.MesId; |
| | | if (mesLinkU9_xm != null) womcab.Project = mesLinkU9_xm.MesId; |
| | | |
| | | womcabList.Add(womcab); |
| | | } |
| | | |