| | |
| | | |
| | | #endregion |
| | | |
| | | #region 生产补料单 * |
| | | |
| | | //生成生产补料单 |
| | | [WebMethod] |
| | | public bool set_SaveMateReplenishOutBill_New(Model.ClsKf_MateReplenishOutBillMain oMain, string sHSourceType, ref string sErrMsg) |
| | | { |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBill(ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | // |
| | | if (set_SaveMateReplenishOutBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) |
| | | { |
| | | //"保存成功!"; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //"保存失败!"; |
| | | return false; |
| | | } |
| | | |
| | | sErrMsg = "保存生产补料单失败!" + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 生产补料CLOUD *New |
| | | |
| | | [WebMethod] |
| | | public bool set_SaveMateReplenishOutBill_CLD_New(Model.ClsKf_MateReplenishOutBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | if (sHSourceType == "3720") //生产用料清单 |
| | | { |
| | | if (SaveMateReplenishOutBill_PPBom_CLD(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg)) |
| | | { |
| | | //"保存成功!"; |
| | | sErrMsg = "保存成功!" + oMain.HBillNo; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //"保存失败!"; |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + sErrMsg; |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";错误的源单类型"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 生产补料单 (源单:生产用料清单) |
| | | /// </summary> |
| | | /// <param name="oMain"></param> |
| | | /// <param name="sErrMsg"></param> |
| | | /// <returns></returns> |
| | | public bool SaveMateReplenishOutBill_PPBom_CLD(Model.ClsKf_MateReplenishOutBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | //判断会计期是否合理 |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | sErrMsg = s; |
| | | return false; |
| | | } |
| | | oMain.HYear = sYear; |
| | | oMain.HPeriod = sPeriod; |
| | | |
| | | oCn.BeginTran(); |
| | | //生成出入库单据 |
| | | //插入子表 |
| | | oCn.RunProc("EXEC h_p_Kf_MateReplenishOutBillSub_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + sHSourceType + "'"); |
| | | //插入主表 |
| | | oCn.RunProc("Insert Into Kf_ICStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + |
| | | ",HSTOCKORGID,HOWNERID" + |
| | | ") " + |
| | | " values('1254','1254'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "',convert(varchar(10),getdate(),120),'" + oMain.HMainSourceBillType + "'" + |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" + |
| | | ", " + oMain.HSupID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HSecManagerID.ToString() + |
| | | ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) + |
| | | ", " + oMain.HSTOCKORGID.ToString() + "," + oMain.HOWNERID.ToString() + |
| | | ") "); |
| | | //更新关联数量 |
| | | |
| | | if (oSystemParameterMain.Kf_MateReplenishOutBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | //审核单据 |
| | | oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString()); |
| | | } |
| | | |
| | | //根据TMP表 返回 信息 |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetMateReplenishOutBill_PPBom_CLD_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'," + oMain.HOWNERID.ToString(), "h_p_Kf_GetMateReplenishOutBill_PPBom_CLD_New"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "获取子表信息失败!"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," + |
| | | "\"IsEntryBatchFill\":\"True\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," + |
| | | "\"Model\": { \"FBILLNO\":\"" + oMain.HBillNo + "\"," + |
| | | //\"FID\":\"0\", |
| | | "\"FBillType\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\"}," + |
| | | "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," + |
| | | "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," + |
| | | //\"FStockId0\":{\"FNumber\":\"\"}, |
| | | "\"FPrdOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPrdOrgId"]) + "\"}," + |
| | | //\"FWorkShopId\":{\"FNumber\":\"\"}, |
| | | "\"FOwnerTypeId0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerTypeId0"]) + "\"," + |
| | | //\"FOwnerId0\":{\"FNumber\":\"\"}, |
| | | "\"FPickerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPickerId"]) + "\"}," + |
| | | "\"FSTOCKERID\":{\"FNAME\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSTOCKERID"]) + "\"}," + |
| | | //\"FDescription\":\"\", |
| | | "\"FCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FCurrId"]) + "\"}," + |
| | | "\"FIsCrossTrade\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsCrossTrade"]) + "\"," + |
| | | "\"FVmiBusiness\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FVmiBusiness"]) + "\"," + |
| | | //\"FScanBox\":\"\", |
| | | "\"FEntity\": [ "; |
| | | string sJson_Entry = ""; |
| | | for (int i = 0; i < Ds.Tables[1].Rows.Count; i++) |
| | | { |
| | | if (sJson_Entry != "") |
| | | { |
| | | sJson_Entry = sJson_Entry + " , "; |
| | | } |
| | | string sJson_BatchNo = ""; |
| | | string sJson_StockPlace = ""; |
| | | if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") //是否启用批次管理 |
| | | { |
| | | sJson_BatchNo = " \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"}, \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" , "; |
| | | } |
| | | else |
| | | { |
| | | sJson_BatchNo = ""; |
| | | } |
| | | |
| | | //仓位 |
| | | if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) == "") |
| | | { |
| | | sJson_StockPlace = ""; |
| | | } |
| | | else |
| | | { |
| | | sJson_StockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}},"; |
| | | } |
| | | |
| | | sJson_Entry = sJson_Entry + "{" + |
| | | //\"FEntryID\":\"0\", |
| | | "\"FParentMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FParentMaterialId"]) + "\"}," + |
| | | //\"FConsome\":\"\", |
| | | "\"FReserveType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReserveType"]) + "\"," + |
| | | "\"FBaseStockActualQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseStockActualQty"]) + "\"," + |
| | | "\"FMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMaterialId"]) + "\"}," + |
| | | "\"FUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUnitID"]) + "\"}," + |
| | | "\"FAppQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAppQty"]) + "\"," + |
| | | "\"FActualQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FActualQty"]) + "\"," + |
| | | "\"FEntryVmiBusiness\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntryVmiBusiness"]) + "\"," + |
| | | //\"FScrapQty\":\"0\", |
| | | //\"FOptQueue\":\"\", |
| | | //\"FOptPlanBillNo\":\"\", |
| | | //\"FOptPlanBillId\":\"0\", |
| | | "\"FStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockId"]) + "\"}," + |
| | | //\"FWorkCenterId\":{\"FNUMBER\":\"\"}, |
| | | sJson_StockPlace + |
| | | //\"FOptDetailId\":\"0\", |
| | | sJson_BatchNo + |
| | | "\"FProcessId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FProcessId"]) + "\"}," + |
| | | "\"FBomId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBomId"]) + "\"}," + |
| | | //\"FFeedReasonId\":{\"FNumber\":\"\"}, |
| | | //\"FEntrtyDescription\":\"\", |
| | | "\"FStockStatusId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockStatusId"]) + "\"}," + |
| | | //\"FProduceDate\":\"1900-01-01\", |
| | | "\"FMtoNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMtoNo"]) + "\"," + |
| | | "\"FProjectNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FProjectNo"]) + "\"," + |
| | | "\"FMoBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMoBillNo"]) + "\"," + |
| | | "\"FMoEntryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMoEntryId"]) + "\"," + |
| | | "\"FPPBomEntryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPPBomEntryId"]) + "\"," + |
| | | "\"FOperId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOperId"]) + "\"," + |
| | | "\"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," + |
| | | "\"FStockAppQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockAppQty"]) + "\"," + |
| | | "\"FStockActualQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockActualQty"]) + "\"," + |
| | | //\"FSecActualQty\":\"0\", |
| | | "\"FMoId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMoId"]) + "\"," + |
| | | "\"FMoEntrySeq\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMoEntrySeq"]) + "\"," + |
| | | "\"FBaseAppQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseAppQty"]) + "\"," + |
| | | //\"FStockScrapQty\":\"0\", |
| | | //\"FSecScrapQty\":\"0\", |
| | | //\"FBaseScrapQty\":\"0\", |
| | | "\"FPPBomBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPPBomBillNo"]) + "\"," + |
| | | "\"FBaseUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\"}," + |
| | | "\"FStockUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockUnitId"]) + "\"}," + |
| | | "\"FSecUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSecUnitId"]) + "\"}," + |
| | | "\"FEntryWorkShopId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntryWorkShopId"]) + "\"}," + |
| | | "\"FBaseActualQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseActualQty"]) + "\"," + |
| | | "\"FAuxPropId\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAuxPropId"]) + "\"}}," + |
| | | "\"FKeeperTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperTypeId"]) + "\"," + |
| | | "\"FKeeperId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperId"]) + "\"}," + |
| | | "\"FOwnerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerId"]) + "\"}," + |
| | | //\"FExpiryDate\":\"1900-01-01\", |
| | | "\"FEntrySrcInterId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntrySrcInterId"]) + "\"," + |
| | | "\"FEntrySrcBillType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntrySrcBillType"]) + "\"," + |
| | | "\"FEntrySrcEnteryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntrySrcEnteryId"]) + "\"," + |
| | | "\"FEntrySrcBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntrySrcBillNo"]) + "\"," + |
| | | //\"FPrice\":\"0\", |
| | | //\"FAmount\":\"0\", |
| | | "\"FParentOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FParentOwnerTypeId"]) + "\"," + |
| | | "\"FParentOwnerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FParentOwnerId"]) + "\"}," + |
| | | "\"FEntrySrcEntrySeq\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntrySrcEntrySeq"]) + "\"," + |
| | | //\"FSrcBizBillNo\":\"\", |
| | | //\"FSrcBizBillType\":{\"FNAME\":\"\"}, |
| | | //\"FSrcBizEntryId\":\"0\", |
| | | //\"FSrcBizInterId\":\"0\", |
| | | //\"FSrcBizEntrySeq\":\"0\", |
| | | // |
| | | "\"FSNUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUnitID"]) + "\"}," + |
| | | "\"FReqSrc\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReqSrc"]) + "\"," + |
| | | "\"FReqBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReqBillNo"]) + "\"," + |
| | | "\"FReqBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReqBillId"]) + "\"," + |
| | | "\"FReqEntrySeq\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReqEntrySeq"]) + "\"," + |
| | | "\"FReqEntryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FReqEntryId"]) + "\"," + |
| | | |
| | | //\"FSerialSubEntity\":[{ |
| | | //\"FDetailID\":\"0\", |
| | | //\"FSerialNo\":\"\", |
| | | //\"FSerialId\":{\"FNumber\":\"\"}, |
| | | //\"FSerialNote\":\"\"}] |
| | | |
| | | "\"FEntity_Link\": [ { " + |
| | | "\"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," + |
| | | "\"FEntity_Link_FFlowLineId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowLineId"]) + "\"," + |
| | | "\"FEntity_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," + |
| | | "\"FEntity_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSTableName"]) + "\"," + |
| | | "\"FEntity_Link_FSBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSBillId"]) + "\"," + |
| | | "\"FEntity_Link_FSId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSId"]) + "\"" + |
| | | " } ]," + |
| | | " \"FBFLowId\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLowId"]) + "\"}}"; |
| | | } |
| | | string sJson_End = " ] }}"; |
| | | string sJson = sJson_Main + sJson_Entry + sJson_End; |
| | | |
| | | //从配置文件获取 CLOUD网址、账套信息、登录用户、登录密码 |
| | | if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) |
| | | { |
| | | sErrMsg = Pub_Class.ClsPub.sExeReturnInfo; |
| | | return false; |
| | | } |
| | | |
| | | //获取CLOUD账号密码 |
| | | string sCLOUDUseName = Pub_Class.ClsPub.sCLOUDUseName; |
| | | string sCLOUDPsd = Pub_Class.ClsPub.sCLOUDPsd; |
| | | DataSet ds11 = get_SaveCLOUDUseNameandPsd(oMain.HInterID); |
| | | if (ds11 == null || ds11.Tables[0].Rows.Count == 0) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | sCLOUDUseName = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserName"]); |
| | | sCLOUDPsd = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserPsd"]); |
| | | } |
| | | |
| | | //生成补料单 |
| | | string HReturn; |
| | | ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl); |
| | | string dbId = Pub_Class.ClsPub.sCLOUDAcc; //AotuTest117 |
| | | bool bLogin = client.Login(dbId, sCLOUDUseName, sCLOUDPsd, 2052); |
| | | if (bLogin) |
| | | { |
| | | var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save", |
| | | new object[] { "PRD_FeedMtrl", sJson }); |
| | | |
| | | //生成单据后更新自定义字段 |
| | | oCn.RunProc("exec h_p_Sc_UpDateSelfFildMateReplenishOutBill '" + oMain.HBillNo + "','" + sHSourceType + "'"); |
| | | |
| | | if (oSystemParameterMain.Kf_MateReplenishOutBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "PRD_FeedMtrl", sJson2 }); |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "PRD_FeedMtrl", sJson3 }); |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | } |
| | | else |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | sErrMsg = "生成生产补料单失败!" + HReturn + sJson; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "生成生产补料单失败!登录失败!"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "生成生产补料单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 委外退料CLOUD * |
| | | |
| | | //生成外购入库单 |
| | |
| | | //生产汇报单 |
| | | sMulSourceFlag = 1; |
| | | } |
| | | else if (HBillType == "1254" && oSystemParameterMain.Kf_MateReplenishOutBill_MulSourceBill == "Y") |
| | | { |
| | | //生产补料单 |
| | | sMulSourceFlag = 1; |
| | | } |
| | | else if (HBillType == "1207" && oSystemParameterMain.Kf_MoveStockBill_MulSourceBill == "Y") |
| | | { |
| | | //直接调拨单 |
| | | sMulSourceFlag = 1; |
| | | } |
| | | //else if (HBillType == "1250" && oSystemParameterMain.Kf_MoveStockStepOutBill_MulSourceBill == "Y") |
| | | //{ |
| | | // //分步式调出单 |
| | | // sMulSourceFlag = 1; |
| | | //} |
| | | //else if (HBillType == "1251" && oSystemParameterMain.Kf_MoveStockStepInBill_MulSourceBill == "Y") |
| | | //{ |
| | | // //分步式调入单 |
| | | // sMulSourceFlag = 1; |
| | | //} |
| | | else if (HBillType == "1250" && oSystemParameterMain.Kf_MoveStockStepOutBill_MulSourceBill == "Y") |
| | | { |
| | | //分步式调出单 |
| | | sMulSourceFlag = 1; |
| | | } |
| | | else if (HBillType == "1251" && oSystemParameterMain.Kf_MoveStockStepInBill_MulSourceBill == "Y") |
| | | { |
| | | //分步式调入单 |
| | | sMulSourceFlag = 1; |
| | | } |
| | | else if (HBillType == "1245" && oSystemParameterMain.Kf_ProductInBackBill_MulSourceBill == "Y") |
| | | { |
| | | //生产退库单 |