| | |
| | | |
| | | #endregion |
| | | |
| | | #region 生产汇报单 报工平台产量汇报,报检申请 Layui调用* |
| | | |
| | | //生成生产汇报单 |
| | | [WebMethod] |
| | | public bool set_SaveICMOProductReportBill_Layui(Model.ClsSc_ICMOReportBillMain 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 (oSystemParameter.omodel.Sc_ICMOReportBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | | return false; |
| | | } |
| | | if (oSystemParameter.omodel.Sc_ICMOReportBill_ERPMode.ToUpper() == "CLOUD") //判断同步模式是金蝶CLOUD |
| | | { |
| | | if (set_SaveICMOProductReportBill_CLD_Layui(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) |
| | | { |
| | | //"保存成功!"; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //"保存失败!"; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | sErrMsg = "保存生产汇报单失败!" + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 生产汇报单CLOUD 报工平台产量汇报,报报检申请 Layui调用 |
| | | |
| | | //生成生产汇报单 |
| | | [WebMethod] |
| | | public bool set_SaveICMOProductReportBill_CLD_Layui(Model.ClsSc_ICMOReportBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | //if (sHSourceType == "3710") //源单:生产订单 |
| | | //{ |
| | | if (SaveICMOProductReportBill_ICMO_CLD_Layui(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg)) |
| | | { |
| | | //"保存成功!"; |
| | | sErrMsg = "保存成功!" + oMain.HBillNo + ";" + sErrMsg; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | //"保存失败!"; |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + sErrMsg; |
| | | return false; |
| | | } |
| | | //} |
| | | //else |
| | | //{ |
| | | // sErrMsg = "错误的源单类型"; |
| | | // return false; |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 生产汇报单 源单:生产订单 |
| | | /// </summary> |
| | | /// <param name="oMain"></param> |
| | | /// <param name="sErrMsg"></param> |
| | | /// <returns></returns> |
| | | public bool SaveICMOProductReportBill_ICMO_CLD_Layui(Model.ClsSc_ICMOReportBillMain 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; |
| | | |
| | | DataSet Ds; |
| | | DataSet Ds2; |
| | | // 判断生产订单状态 是否为 完工 或结案 |
| | | //Ds2 = oCn.RunProcReturn("exec h_p_Sc_LoadICMOReportStatusCheck " + oMain.HInterID.ToString(), "h_p_Sc_LoadICMOReportStatusCheck"); |
| | | //if (Ds2 == null || Ds2.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // sErrMsg = "判断生产订单状态失败!"; |
| | | // return false; |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(Ds2.Tables[0].Rows[0]["HBack"]) == 2) |
| | | // { |
| | | // sErrMsg = "生产订单状态已完工不允许上传!" + DBUtility.ClsPub.isStrNull(Ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | // return false; |
| | | // } |
| | | //} |
| | | //写入WMS生产汇报单 |
| | | oCn.BeginTran(); |
| | | |
| | | //插入子表 |
| | | oCn.RunProc("EXEC h_p_Sc_ICMOReportBillSub_Insert_WorkQty " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + sHSourceType + "'"); |
| | | //插入主表 |
| | | oCn.RunProc("Insert Into Sc_ICMOReportBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HEmpID,HGroupID,HDeptID,HPRDORGID" + |
| | | ") " + |
| | | " values('3711','3711'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "',convert(varchar(10),getdate(),120)" + |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" + |
| | | ", " + oMain.HEmpID.ToString() + "," + oMain.HGroupID.ToString() + "," + oMain.HDeptID.ToString() + "," + oMain.HPRDORGID.ToString() + |
| | | ") "); |
| | | //更新关联数量 |
| | | oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToICMOReport_Add " + oMain.HInterID.ToString()); |
| | | |
| | | if (oSystemParameterMain.Sc_ICMOReportBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | //审核单据 |
| | | oCn.RunProc("Update Sc_ICMOReportBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString()); |
| | | } |
| | | |
| | | //根据TMP表 返回 子表信息 |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetICMOReportBill_ICMO_CLD_WorkQty " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetICMOReportBill_ICMO_CLD_WorkQty"); |
| | | 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\":\"false\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," + |
| | | "\"Model\": { \"FBILLNO\":\"" + oMain.HBillNo + "\"," + |
| | | //"\"FID\":\"" + oMain.HInterID.ToString() + "\"," + |
| | | "\"FBillType\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\"}," + |
| | | //\"FDocumentStatus\":\"\", |
| | | "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," + |
| | | "\"FPRDORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPRDORGID"]) + "\"}," + |
| | | //\"FWorkshipIdH\":{\"FNumber\":\"\"}, |
| | | //\"FDescription\":\"\", |
| | | "\"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 = ""; |
| | | string sJson_EntryCustom = ""; |
| | | 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"]) + "\"}},"; |
| | | } |
| | | |
| | | //自定义字段处理 |
| | | if (oSystemParameterMain.WMS_CampanyName == "四维尔") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | | sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\"," + //单据状态 |
| | | "\"F_abcd_Datetime\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_abcd_Datetime"]) + "\","; //计划开工日期 |
| | | } |
| | | // |
| | | sJson_Entry = sJson_Entry + " {" + |
| | | //" \"FEntryID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HEntryID"]) + "," + |
| | | " \"FSRCENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + "," + |
| | | " \"FIsNew\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsNew"]) + "," + |
| | | " \"FMATERIALID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMATERIALID"]) + "\"}," + |
| | | " \"FPRODUCTTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPRODUCTTYPE"]) + "\"," + |
| | | " \"FREPORTTYPE\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREPORTTYPE"]) + "\"}," + |
| | | " \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}," + |
| | | " \"FWORKSHIPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID"]) + "\"}," + |
| | | //\"FShiftGroupId\":{\"FNumber\":\"\"}, |
| | | sJson_BatchNo + |
| | | //\"FDeptId\":{\"FNumber\":\"\"}, |
| | | sJson_StockPlace + |
| | | " \"FMTONO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMTONO"]) + "\"," + |
| | | " \"FCHECKPRODUCT\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCHECKPRODUCT"]) + "," + |
| | | " \"FISENTRUST\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISENTRUST"]) + "," + |
| | | " \"FSRCBILLTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\"," + |
| | | " \"FMOBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\"," + |
| | | " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," + |
| | | //\"FHumanQty\":\"0\", |
| | | " \"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," + |
| | | //\"FMachineQty\":\"0\", |
| | | //\"FMaterialUnitID\":{\"FNumber\":\"\"}, |
| | | //\"FStartTime\":\"1900-01-01\", |
| | | //\"FEndTime\":\"1900-01-01\", |
| | | //\"FTimeUnitId\":\"\", |
| | | " \"FMOENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "," + |
| | | //" \"FSTANDHOURUNITID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTANDHOURUNITID"]) + "\"," + |
| | | " \"FPROJECTNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPROJECTNO"]) + "\"," + |
| | | " \"FSTDMANHOUR\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTDMANHOUR"]) + "," + |
| | | " \"FHRPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FHRPREPARETIME"]) + "," + |
| | | //\"FHrWorkTime\":\"0\", |
| | | " \"FMACPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMACPREPARETIME"]) + "," + |
| | | //\"FMacWorkTime\":\"0\", |
| | | //\"FDescriptionE\":\"\", |
| | | " \"FSRCINTERID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "," + |
| | | " \"FSRCENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYSEQ"]) + "," + |
| | | " \"FMOID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "," + |
| | | " \"FMOENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + "," + |
| | | " \"FBASEUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITID"]) + "\"}," + |
| | | " \"FSTOCKINORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKINORGID"]) + "\"}," + |
| | | " \"FBOMID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBOMID"]) + "\"}," + |
| | | " \"FOWNERTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERTYPEID"]) + "\"," + |
| | | " \"FOWNERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERID"]) + "\"}," + |
| | | " \"FSTOCKID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}," + |
| | | " \"FCOSTRATE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "," + |
| | | " \"FSNUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUNITID"]) + "\"}," + |
| | | //\"FSNQty\":\"0\", |
| | | //\"FProduceDate\":\"1900-01-01\", |
| | | //\"FExpiryDate\":\"1900-01-01\", |
| | | " \"FISBACKFLUSH\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISBACKFLUSH"]) + "," + |
| | | " \"FMOMAINENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "," + |
| | | " \"FQAIP\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQAIP"]) + "\"," + |
| | | " \"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"]) + "," + |
| | | " \"FBASEQUAQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEQUAQTY"]) + "," + |
| | | " \"FQUAQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQUAQTY"]) + "," + |
| | | " \"FBASEFINISHQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEFINISHQTY"]) + "," + |
| | | " \"FFINISHQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FFINISHQTY"]) + "," + |
| | | sJson_EntryCustom + |
| | | |
| | | //\"FSerialSubEntity\":[{\"FDetailID\":\"0\", |
| | | //\"FQCMaterialId\":{\"FNUMBER\":\"\"}, |
| | | //\"FInspectResult\":\"\", |
| | | //\"FQcAuxPropId\":{\"FQCAUXPROPID__FF100002\":{\"FNumber\":\"\"}}, |
| | | //\"FQCQty\":\"0\", |
| | | //\"FSerialNo\":\"\", |
| | | //\"FSerialId\":{\"FNUMBER\":\"\"}, |
| | | //\"FQCStockInSelQty\":\"0\", |
| | | //\"FSerialNote\":\"\", |
| | | //\"FBaseQCQty\":\"0\", |
| | | //\"FBaseQCStockInSelQty\":\"0\"}] |
| | | |
| | | " \"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; |
| | | string HReturn2 = ""; |
| | | |
| | | 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_MORPT", sJson }); //调用保存方式 |
| | | |
| | | if (oSystemParameterMain.Sc_ICMOReportBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "PRD_MORPT", sJson2 }); //提交单据 |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "PRD_MORPT", sJson3 }); //审核单据 |
| | | |
| | | string sJson4 = "{\"Ids\":\"\",\"Numbers\":[\"" + oMain.HBillNo + "\"],\"EntryIds\":\"\",\"RuleId\":\"PRD_MORPT2INSTOCK\",\"TargetBillTypeId\":\"\",\"TargetOrgId\":\"0\",\"TargetFormId\":\"PRD_INSTOCK\",\"IsEnableDefaultRule\":\"false\",\"IsDraftWhenSaveFail\":\"true\",\"CustomParams\":{}}"; |
| | | var result4 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Push", |
| | | new object[] { "PRD_MORPT", sJson4 }); //下推生产入库单 |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | HReturn2 = result4.ToString(); |
| | | } |
| | | else |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | sErrMsg = "生成生产汇报单失败!" + HReturn + sJson; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (HReturn2.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | sErrMsg = "生成生产入库单失败!" + HReturn2; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = ""; |
| | | } |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "生成生产汇报单失败!登录失败!"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "生成生产汇报单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 调拨单(领料、销售、直接)CLOUD |
| | | |
| | | //调拨单(领料 |