/// <summary> /// 发送转库单信息给NC /// </summary> /// <param name="xmlFileName">xml完整路径</param> /// <param name="dh">转库单号</param> /// <param name="dhid">转库单ID</param> /// <returns></returns> public string SendXml_GP4I(string xmlFileName, string dh, string dhid, string C_SLABWH_LOC_CODE, string C_SLABWH_AREA_CODE) { try { string urlname = "GP4I" + dh + ".XML";//XML名称 string url = xmlFileName + "\\NCXML"; if (!Directory.Exists(url)) { Directory.CreateDirectory(url); } DataTable dt = dal_TSC_SLAB_MAIN.Get_ZK_List_Trans(dh, dhid).Tables[0]; DataRow dr = null; if (dt.Rows.Count > 0) { dr = dt.Rows[0]; } if (dr == null) { return("调拨失败"); } Mod_TB_MATRL_MAIN mod_TB_MATRL_MAIN = dal_TB_MATRL_MAIN.GetModel(dr["C_MAT_CODE"].ToString()); Mod_TPB_SLABWH yck = dal_TPB_SLABWH.GetModel_Interface_Trans(dr["C_STOCK_CODE"].ToString()); //源仓库 Mod_TPB_SLABWH mbck = dal_TPB_SLABWH.GetModel_Interface_Trans(dr["C_STOCK_CODE_TO"].ToString()); //目标仓库 string djrq = DateTime.Now.ToString("yyyy-MM-dd"); Mod_TS_USER mod_TS_USER = dal_TS_USER.GetModel(RV.UI.UserInfo.userID); //获取操作人 string bmid = dal_TS_DEPT.GetDept(mod_TS_USER.C_ACCOUNT); if (bmid == "") { return("操作人部门未维护!"); } Mod_TS_DEPT mod_TS_DEPT = dal_TS_DEPT.GetModel(bmid);//获取部门 Mod_TQB_CHECKSTATE mod_TQB_CHECKSTATE = dal_TQB_CHECKSTATE.GetModelByName(dr["ZLDJ"].ToString(), "1001"); //Mod_TB_STD_CONFIG mod_TB_STD_CONFIG = dal_TB_STD_CONFIG.GetModel_Interface_Trans(dr["C_STD_CODE"].ToString(), dr["C_STL_GRD"].ToString()); Mod_TSC_SLAB_MAIN modSms = new Mod_TSC_SLAB_MAIN(); if (dr["C_BATCH_NO"].ToString() != "") { modSms = dal_TSC_SLAB_MAIN.GetModel_Batch(dr["C_STD_CODE"].ToString(), dr["C_STL_GRD"].ToString(), dr["C_BATCH_NO"].ToString()); } else { modSms = dal_TSC_SLAB_MAIN.GetModel(dr["C_STD_CODE"].ToString(), dr["C_STL_GRD"].ToString(), dr["C_STOVE"].ToString()); } //Mod_TSC_SLAB_MAIN modSms = dal_TSC_SLAB_MAIN.GetModel(dr["C_STD_CODE"].ToString(), dr["C_STL_GRD"].ToString(), dr["C_STOVE"].ToString()); if (mod_TB_MATRL_MAIN == null) { return("调拨失败"); } if (yck == null) { return("调拨失败"); } if (mbck == null) { return("调拨失败"); } if (mod_TS_USER == null) { return("调拨失败"); } if (mod_TQB_CHECKSTATE == null) { return("调拨失败,没有找到对应的质量等级"); } if (modSms == null) { return("调拨失败,没有找到对应的自由项"); } string C_SLABWH_LOC_NC_ID = ""; string C_SLABWH_LOC_NC_CODE = ""; string C_SLABWH_LOC_NC_NAME = ""; //if (yck.C_SLABWH_CODE == "132" || yck.C_SLABWH_CODE == "593") if (yck.C_SLABWH_CODE == "132") { DataTable dtLOC = dal_TPB_SLABWH.GetList_NC_Loc(C_SLABWH_LOC_CODE, yck.C_SLABWH_CODE, C_SLABWH_AREA_CODE).Tables[0]; if (dtLOC.Rows.Count > 0) { C_SLABWH_LOC_NC_ID = dtLOC.Rows[0]["LOC_ID"].ToString(); C_SLABWH_LOC_NC_CODE = dtLOC.Rows[0]["C_SLABWH_LOC_CODE"].ToString(); C_SLABWH_LOC_NC_NAME = dtLOC.Rows[0]["C_SLABWH_LOC_NAME"].ToString(); } } XmlDocument xmlDoc = new XmlDocument(); //创建类型声明节点 XmlNode node = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", "no"); xmlDoc.AppendChild(node); //创建根节点 XmlElement root = xmlDoc.CreateElement("ufinterface"); #region//给节点属性赋值 root.SetAttribute("billtype", "4K"); root.SetAttribute("filename", urlname); root.SetAttribute("isexchange", "Y"); root.SetAttribute("operation", "req"); root.SetAttribute("proc", "add"); root.SetAttribute("receiver", "101"); root.SetAttribute("replace", "y"); root.SetAttribute("roottag", "bill"); root.SetAttribute("sender", "1107"); #endregion xmlDoc.AppendChild(root); //创建子根节点 XmlElement bill = xmlDoc.CreateElement("bill"); #region//节点属性 bill.SetAttribute("id", "GP" + dhid); #endregion root.AppendChild(bill); XmlNode head = xmlDoc.CreateNode(XmlNodeType.Element, "bill_head", null); #region //表头_order_head CreateNode(xmlDoc, head, "ctjname", ""); CreateNode(xmlDoc, head, "bz", ""); CreateNode(xmlDoc, head, "cbilltypecode", "4K"); //库存单据类型编码 CreateNode(xmlDoc, head, "cinbsrid", ""); CreateNode(xmlDoc, head, "cinbsrname", ""); CreateNode(xmlDoc, head, "cindeptid", mod_TS_DEPT.C_ID); //入库部门ID CreateNode(xmlDoc, head, "cindeptname", mod_TS_DEPT.C_NAME); CreateNode(xmlDoc, head, "cinwarehouseid", mbck.C_ID); //入库仓库ID CreateNode(xmlDoc, head, "cinwarehousename", mbck.C_SLABWH_NAME); //仓库名称 CreateNode(xmlDoc, head, "isLocatorMgtIn", "0"); CreateNode(xmlDoc, head, "isWasteWhIn", "0"); CreateNode(xmlDoc, head, "whreservedptyin", ""); CreateNode(xmlDoc, head, "islocatormgtin", "0"); CreateNode(xmlDoc, head, "iswastewhin", "0"); CreateNode(xmlDoc, head, "whreservedptyin", ""); CreateNode(xmlDoc, head, "coutbsor", ""); CreateNode(xmlDoc, head, "coutbsorname", ""); CreateNode(xmlDoc, head, "coutdeptid", mod_TS_DEPT.C_ID); //出库部门ID CreateNode(xmlDoc, head, "coutdeptname", mod_TS_DEPT.C_NAME); //出库部门名称 CreateNode(xmlDoc, head, "coutwarehouseid", yck.C_ID); //出库仓库ID CreateNode(xmlDoc, head, "coutwarehousename", yck.C_SLABWH_NAME); //仓库名称 CreateNode(xmlDoc, head, "isLocatorMgtOut", "0"); CreateNode(xmlDoc, head, "isWasteWhOut", "0"); CreateNode(xmlDoc, head, "whReservedPtyOut", ""); CreateNode(xmlDoc, head, "islocatormgtout", "0"); CreateNode(xmlDoc, head, "iswastewhout", "0"); CreateNode(xmlDoc, head, "whreservedptyout", ""); CreateNode(xmlDoc, head, "cshlddiliverdate", djrq); //单据日期 CreateNode(xmlDoc, head, "ctj", ""); CreateNode(xmlDoc, head, "dbilldate", djrq); //单据日期 CreateNode(xmlDoc, head, "nfixdisassemblymny", ""); //组装拆卸费用 CreateNode(xmlDoc, head, "pdfs", ""); CreateNode(xmlDoc, head, "pk_corp", "1001"); //公司ID CreateNode(xmlDoc, head, "vbillcode", dh); //单据号 CreateNode(xmlDoc, head, "vnote", ""); //备注 CreateNode(xmlDoc, head, "vshldarrivedate", djrq); //应到货日期 CreateNode(xmlDoc, head, "vuserdef1", ""); CreateNode(xmlDoc, head, "vuserdef2", ""); CreateNode(xmlDoc, head, "vuserdef3", ""); CreateNode(xmlDoc, head, "vuserdef4", ""); CreateNode(xmlDoc, head, "vuserdef5", ""); CreateNode(xmlDoc, head, "vuserdef6", ""); CreateNode(xmlDoc, head, "vuserdef7", ""); CreateNode(xmlDoc, head, "vuserdef8", ""); CreateNode(xmlDoc, head, "vuserdef9", ""); CreateNode(xmlDoc, head, "vuserdef10", ""); CreateNode(xmlDoc, head, "vuserdef11", ""); CreateNode(xmlDoc, head, "vuserdef12", ""); CreateNode(xmlDoc, head, "vuserdef13", ""); CreateNode(xmlDoc, head, "vuserdef14", ""); CreateNode(xmlDoc, head, "vuserdef15", ""); CreateNode(xmlDoc, head, "vuserdef16", ""); CreateNode(xmlDoc, head, "vuserdef17", ""); CreateNode(xmlDoc, head, "vuserdef18", ""); CreateNode(xmlDoc, head, "vuserdef19", ""); CreateNode(xmlDoc, head, "vuserdef20", ""); CreateNode(xmlDoc, head, "vuserdef11h", ""); CreateNode(xmlDoc, head, "vuserdef12h", ""); CreateNode(xmlDoc, head, "vuserdef13h", ""); CreateNode(xmlDoc, head, "vuserdef14h", ""); CreateNode(xmlDoc, head, "vuserdef15h", ""); CreateNode(xmlDoc, head, "vuserdef16h", ""); CreateNode(xmlDoc, head, "vuserdef17h", ""); CreateNode(xmlDoc, head, "vuserdef18h", ""); CreateNode(xmlDoc, head, "vuserdef19h", ""); CreateNode(xmlDoc, head, "vuserdef20h", ""); CreateNode(xmlDoc, head, "pk_defdoc1", ""); CreateNode(xmlDoc, head, "pk_defdoc2", ""); CreateNode(xmlDoc, head, "pk_defdoc3", ""); CreateNode(xmlDoc, head, "pk_defdoc4", ""); CreateNode(xmlDoc, head, "pk_defdoc5", ""); CreateNode(xmlDoc, head, "pk_defdoc6", ""); CreateNode(xmlDoc, head, "pk_defdoc7", ""); CreateNode(xmlDoc, head, "pk_defdoc8", ""); CreateNode(xmlDoc, head, "pk_defdoc9", ""); CreateNode(xmlDoc, head, "pk_defdoc10", ""); CreateNode(xmlDoc, head, "pk_defdoc1h", ""); CreateNode(xmlDoc, head, "pk_defdoc2h", ""); CreateNode(xmlDoc, head, "pk_defdoc3h", ""); CreateNode(xmlDoc, head, "pk_defdoc4h", ""); CreateNode(xmlDoc, head, "pk_defdoc5h", ""); CreateNode(xmlDoc, head, "pk_defdoc6h", ""); CreateNode(xmlDoc, head, "pk_defdoc7h", ""); CreateNode(xmlDoc, head, "pk_defdoc8h", ""); CreateNode(xmlDoc, head, "pk_defdoc9h", ""); CreateNode(xmlDoc, head, "pk_defdoc10h", ""); CreateNode(xmlDoc, head, "pk_defdoc11", ""); CreateNode(xmlDoc, head, "pk_defdoc12", ""); CreateNode(xmlDoc, head, "pk_defdoc13", ""); CreateNode(xmlDoc, head, "pk_defdoc14", ""); CreateNode(xmlDoc, head, "pk_defdoc15", ""); CreateNode(xmlDoc, head, "pk_defdoc16", ""); CreateNode(xmlDoc, head, "pk_defdoc17", ""); CreateNode(xmlDoc, head, "pk_defdoc18", ""); CreateNode(xmlDoc, head, "pk_defdoc19", ""); CreateNode(xmlDoc, head, "pk_defdoc20", ""); CreateNode(xmlDoc, head, "pk_defdoc11h", ""); CreateNode(xmlDoc, head, "pk_defdoc12h", ""); CreateNode(xmlDoc, head, "pk_defdoc13h", ""); CreateNode(xmlDoc, head, "pk_defdoc14h", ""); CreateNode(xmlDoc, head, "pk_defdoc15h", ""); CreateNode(xmlDoc, head, "pk_defdoc16h", ""); CreateNode(xmlDoc, head, "pk_defdoc17h", ""); CreateNode(xmlDoc, head, "pk_defdoc18h", ""); CreateNode(xmlDoc, head, "pk_defdoc19h", ""); CreateNode(xmlDoc, head, "pk_defdoc20h", ""); CreateNode(xmlDoc, head, "vuserdef1h", ""); CreateNode(xmlDoc, head, "vuserdef2h", ""); CreateNode(xmlDoc, head, "vuserdef3h", ""); CreateNode(xmlDoc, head, "vuserdef4h", ""); CreateNode(xmlDoc, head, "vuserdef5h", ""); CreateNode(xmlDoc, head, "vuserdef6h", ""); CreateNode(xmlDoc, head, "vuserdef7h", ""); CreateNode(xmlDoc, head, "vuserdef8h", ""); CreateNode(xmlDoc, head, "vuserdef9h", ""); CreateNode(xmlDoc, head, "vuserdef10h", ""); CreateNode(xmlDoc, head, "cauditorid", ""); CreateNode(xmlDoc, head, "cauditorname", ""); CreateNode(xmlDoc, head, "coperatorid", mod_TS_USER.C_ID); //制单人 CreateNode(xmlDoc, head, "coperatorname", mod_TS_USER.C_NAME); //制单人名称 CreateNode(xmlDoc, head, "vadjuster", ""); CreateNode(xmlDoc, head, "vadjustername", ""); CreateNode(xmlDoc, head, "coperatoridnow", ""); CreateNode(xmlDoc, head, "ctjname", ""); CreateNode(xmlDoc, head, "pk_calbody_in", "1001NC10000000000669"); CreateNode(xmlDoc, head, "pk_calbody_out", "1001NC10000000000669"); CreateNode(xmlDoc, head, "vcalbody_inname", "邢钢库存组织"); CreateNode(xmlDoc, head, "vcalbody_outname", "邢钢库存组织"); CreateNode(xmlDoc, head, "ts", DateTime.Now.ToString()); CreateNode(xmlDoc, head, "timestamp", ""); //? CreateNode(xmlDoc, head, "headts", DateTime.Now.ToString()); CreateNode(xmlDoc, head, "isforeignstor_in", "N"); CreateNode(xmlDoc, head, "isgathersettle_in", "N"); CreateNode(xmlDoc, head, "isforeignstor_out", "N"); CreateNode(xmlDoc, head, "isgathersettle_out", "N"); CreateNode(xmlDoc, head, "icheckmode", ""); CreateNode(xmlDoc, head, "fassistantflag", "N"); //是否计算期间业务量 CreateNode(xmlDoc, head, "fbillflag", ""); CreateNode(xmlDoc, head, "vostatus", ""); CreateNode(xmlDoc, head, "iprintcount", ""); CreateNode(xmlDoc, head, "clastmodiid", mod_TS_USER.C_ID); //最后修改人 CreateNode(xmlDoc, head, "clastmodiname", mod_TS_USER.C_NAME); //最后修改人名称 CreateNode(xmlDoc, head, "tlastmoditime", DateTime.Now.ToString()); //最后修改时间 CreateNode(xmlDoc, head, "cnxtbilltypecode", "4I"); CreateNode(xmlDoc, head, "cspecialhid", ""); #endregion bill.AppendChild(head); XmlElement body = xmlDoc.CreateElement("bill_body"); bill.AppendChild(body); XmlNode item = xmlDoc.CreateNode(XmlNodeType.Element, "item", null); #region //表体_item CreateNode(xmlDoc, item, "csourcetypename", ""); CreateNode(xmlDoc, item, "cinvbasid", mod_TB_MATRL_MAIN.C_PK_INVBASDOC); //来源单据号 CreateNode(xmlDoc, item, "pk_invbasdoc", mod_TB_MATRL_MAIN.C_PK_INVBASDOC); CreateNode(xmlDoc, item, "fixedflag", "N"); CreateNode(xmlDoc, item, "bgssl", ""); CreateNode(xmlDoc, item, "castunitid", mod_TB_MATRL_MAIN.C_FJLDW); //辅计量单位ID CreateNode(xmlDoc, item, "castunitname", mod_TB_MATRL_MAIN.C_FJLDWMC); CreateNode(xmlDoc, item, "cinventorycode", mod_TB_MATRL_MAIN.C_MAT_CODE); CreateNode(xmlDoc, item, "cinventoryid", mod_TB_MATRL_MAIN.C_PK_INVMANDOC); //存货ID CreateNode(xmlDoc, item, "cinvmanid", mod_TB_MATRL_MAIN.C_PK_INVBASDOC); CreateNode(xmlDoc, item, "isLotMgt", "1"); CreateNode(xmlDoc, item, "isSerialMgt", "0"); CreateNode(xmlDoc, item, "isValidateMgt", "0"); CreateNode(xmlDoc, item, "isAstUOMmgt", "1"); CreateNode(xmlDoc, item, "isFreeItemMgt", "1"); CreateNode(xmlDoc, item, "isSet", "0"); CreateNode(xmlDoc, item, "standStoreUOM", ""); CreateNode(xmlDoc, item, "defaultAstUOM", mod_TB_MATRL_MAIN.C_FJLDW); CreateNode(xmlDoc, item, "isSellProxy", "0"); CreateNode(xmlDoc, item, "qualityDay", ""); CreateNode(xmlDoc, item, "invReservedPty", ""); CreateNode(xmlDoc, item, "isSolidConvRate", "0"); CreateNode(xmlDoc, item, "islotmgt", "1"); CreateNode(xmlDoc, item, "isserialmgt", "0"); CreateNode(xmlDoc, item, "isvalidatemgt", "0"); CreateNode(xmlDoc, item, "isastuommgt", "1"); CreateNode(xmlDoc, item, "isfreeitemmgt", "1"); CreateNode(xmlDoc, item, "isset", "0"); CreateNode(xmlDoc, item, "standstoreuom", ""); CreateNode(xmlDoc, item, "defaultastuom", mod_TB_MATRL_MAIN.C_FJLDW); CreateNode(xmlDoc, item, "issellproxy", "0"); CreateNode(xmlDoc, item, "qualityday", ""); CreateNode(xmlDoc, item, "invreservedpty", ""); CreateNode(xmlDoc, item, "issolidconvrate", "0"); CreateNode(xmlDoc, item, "csourcebillbid", ""); CreateNode(xmlDoc, item, "csourcebillhid", ""); CreateNode(xmlDoc, item, "csourcetype", ""); CreateNode(xmlDoc, item, "cspaceid", C_SLABWH_LOC_NC_ID); CreateNode(xmlDoc, item, "cspacecode", C_SLABWH_LOC_NC_CODE); CreateNode(xmlDoc, item, "cspacename", C_SLABWH_LOC_NC_NAME); CreateNode(xmlDoc, item, "cspecialhid", ""); //??? CreateNode(xmlDoc, item, "cwarehouseid", ""); CreateNode(xmlDoc, item, "cwarehousename", ""); CreateNode(xmlDoc, item, "isLocatorMgt", ""); CreateNode(xmlDoc, item, "isWasteWh", ""); CreateNode(xmlDoc, item, "whreservedpty", ""); CreateNode(xmlDoc, item, "islocatormgt", ""); CreateNode(xmlDoc, item, "iswastewh", ""); CreateNode(xmlDoc, item, "whreservedpty", ""); CreateNode(xmlDoc, item, "cyfsl", ""); CreateNode(xmlDoc, item, "cysl", ""); CreateNode(xmlDoc, item, "desl", ""); CreateNode(xmlDoc, item, "dshldtransnum", dr["wgt"].ToString()); //应转数量 CreateNode(xmlDoc, item, "dvalidate", ""); CreateNode(xmlDoc, item, "fbillrowflag", ""); CreateNode(xmlDoc, item, "hlzl", ""); CreateNode(xmlDoc, item, "hsl", Math.Round(Convert.ToDouble(dr["wgt"]) / Convert.ToDouble(dr["qua"]), 6).ToString()); //换算率 CreateNode(xmlDoc, item, "invname", mod_TB_MATRL_MAIN.C_MAT_NAME); //物料名称 CreateNode(xmlDoc, item, "invspec", dr["C_SPEC"].ToString()); //规格 CreateNode(xmlDoc, item, "invtype", dr["C_STL_GRD"].ToString()); //钢种 CreateNode(xmlDoc, item, "je", ""); CreateNode(xmlDoc, item, "jhdj", ""); CreateNode(xmlDoc, item, "jhje", ""); CreateNode(xmlDoc, item, "jhpdzq", ""); CreateNode(xmlDoc, item, "measdocname", mod_TB_MATRL_MAIN.C_ZJLDWMC); //计量单位名称 CreateNode(xmlDoc, item, "naccountastnum", ""); CreateNode(xmlDoc, item, "naccountnum", ""); CreateNode(xmlDoc, item, "nadjustastnum", ""); CreateNode(xmlDoc, item, "nadjustnum", ""); CreateNode(xmlDoc, item, "ncheckastnum", ""); CreateNode(xmlDoc, item, "nchecknum", ""); CreateNode(xmlDoc, item, "nprice", ""); CreateNode(xmlDoc, item, "nmny", ""); CreateNode(xmlDoc, item, "nplannedmny", ""); //计划金额 CreateNode(xmlDoc, item, "nplannedprice", ""); //计划单价 CreateNode(xmlDoc, item, "nshldtransastnum", dr["qua"].ToString()); //应转数量 CreateNode(xmlDoc, item, "pk_measdoc", mod_TB_MATRL_MAIN.C_PK_MEASDOC); //主计量单位 CreateNode(xmlDoc, item, "scrq", djrq); //生产日期 CreateNode(xmlDoc, item, "sjpdzq", ""); string vbatchcode = ""; if (dr["C_BATCH_NO"].ToString() != "") { vbatchcode = dr["C_BATCH_NO"].ToString(); } else { vbatchcode = dr["C_STOVE"].ToString(); } CreateNode(xmlDoc, item, "vbatchcode", vbatchcode); //炉号 CreateNode(xmlDoc, item, "vfree0", ""); //? CreateNode(xmlDoc, item, "vfree1", modSms.C_ZYX1); //自由项1 CreateNode(xmlDoc, item, "vfree2", modSms.C_ZYX2); //自由项2 CreateNode(xmlDoc, item, "vfree3", ""); //包装要求 CreateNode(xmlDoc, item, "vfree4", ""); CreateNode(xmlDoc, item, "vfree5", ""); CreateNode(xmlDoc, item, "vfree6", ""); CreateNode(xmlDoc, item, "vfree7", ""); CreateNode(xmlDoc, item, "vfree8", ""); CreateNode(xmlDoc, item, "vfree9", ""); CreateNode(xmlDoc, item, "vfree10", ""); CreateNode(xmlDoc, item, "vfreename1", ""); //? CreateNode(xmlDoc, item, "vfreename2", ""); //? CreateNode(xmlDoc, item, "vfreename3", ""); //? CreateNode(xmlDoc, item, "vfreename4", ""); CreateNode(xmlDoc, item, "vfreename5", ""); CreateNode(xmlDoc, item, "vfreename6", ""); CreateNode(xmlDoc, item, "vfreename7", ""); CreateNode(xmlDoc, item, "vfreename8", ""); CreateNode(xmlDoc, item, "vfreename9", ""); CreateNode(xmlDoc, item, "vfreename10", ""); CreateNode(xmlDoc, item, "vsourcebillcode", ""); CreateNode(xmlDoc, item, "vuserdef1", ""); CreateNode(xmlDoc, item, "vuserdef2", ""); CreateNode(xmlDoc, item, "vuserdef3", ""); CreateNode(xmlDoc, item, "vuserdef4", ""); CreateNode(xmlDoc, item, "vuserdef5", ""); CreateNode(xmlDoc, item, "vuserdef6", ""); CreateNode(xmlDoc, item, "vuserdef7", ""); CreateNode(xmlDoc, item, "vuserdef8", ""); CreateNode(xmlDoc, item, "vuserdef9", ""); CreateNode(xmlDoc, item, "vuserdef10", dhid); //自定义项 CreateNode(xmlDoc, item, "vuserdef11", ""); CreateNode(xmlDoc, item, "vuserdef12", ""); CreateNode(xmlDoc, item, "vuserdef13", ""); CreateNode(xmlDoc, item, "vuserdef14", ""); CreateNode(xmlDoc, item, "vuserdef15", ""); CreateNode(xmlDoc, item, "vuserdef16", ""); CreateNode(xmlDoc, item, "vuserdef17", ""); CreateNode(xmlDoc, item, "vuserdef18", ""); CreateNode(xmlDoc, item, "vuserdef19", ""); CreateNode(xmlDoc, item, "vuserdef20", ""); CreateNode(xmlDoc, item, "pk_defdoc1", ""); CreateNode(xmlDoc, item, "pk_defdoc2", ""); CreateNode(xmlDoc, item, "pk_defdoc3", ""); CreateNode(xmlDoc, item, "pk_defdoc4", ""); CreateNode(xmlDoc, item, "pk_defdoc5", ""); CreateNode(xmlDoc, item, "pk_defdoc6", ""); CreateNode(xmlDoc, item, "pk_defdoc7", ""); CreateNode(xmlDoc, item, "pk_defdoc8", ""); CreateNode(xmlDoc, item, "pk_defdoc9", ""); CreateNode(xmlDoc, item, "pk_defdoc10", ""); CreateNode(xmlDoc, item, "pk_defdoc11", ""); CreateNode(xmlDoc, item, "pk_defdoc12", ""); CreateNode(xmlDoc, item, "pk_defdoc13", ""); CreateNode(xmlDoc, item, "pk_defdoc14", ""); CreateNode(xmlDoc, item, "pk_defdoc15", ""); CreateNode(xmlDoc, item, "pk_defdoc16", ""); CreateNode(xmlDoc, item, "pk_defdoc17", ""); CreateNode(xmlDoc, item, "pk_defdoc18", ""); CreateNode(xmlDoc, item, "pk_defdoc19", ""); CreateNode(xmlDoc, item, "pk_defdoc20", ""); CreateNode(xmlDoc, item, "yy", ""); CreateNode(xmlDoc, item, "ztsl", ""); CreateNode(xmlDoc, item, "bkxcl", ""); CreateNode(xmlDoc, item, "chzl", ""); CreateNode(xmlDoc, item, "neconomicnum", ""); CreateNode(xmlDoc, item, "nmaxstocknum", ""); CreateNode(xmlDoc, item, "nminstocknum", dr["qua"].ToString()); //? CreateNode(xmlDoc, item, "norderpointnum", dr["wgt"].ToString()); //? CreateNode(xmlDoc, item, "xczl", ""); CreateNode(xmlDoc, item, "nsafestocknum", ""); CreateNode(xmlDoc, item, "fbillflag", ""); CreateNode(xmlDoc, item, "vfreeid1", ""); //? CreateNode(xmlDoc, item, "vfreeid2", ""); //? CreateNode(xmlDoc, item, "vfreeid3", ""); //? CreateNode(xmlDoc, item, "vfreeid4", ""); CreateNode(xmlDoc, item, "vfreeid5", ""); CreateNode(xmlDoc, item, "vfreeid6", ""); CreateNode(xmlDoc, item, "vfreeid7", ""); CreateNode(xmlDoc, item, "vfreeid8", ""); CreateNode(xmlDoc, item, "vfreeid9", ""); CreateNode(xmlDoc, item, "vfreeid10", ""); CreateNode(xmlDoc, item, "discountflag", "N"); CreateNode(xmlDoc, item, "laborflag", "N"); CreateNode(xmlDoc, item, "childsnum", ""); CreateNode(xmlDoc, item, "invsetparttype", ""); CreateNode(xmlDoc, item, "partpercent", ""); CreateNode(xmlDoc, item, "vnote", ""); CreateNode(xmlDoc, item, "vbodynote", ""); CreateNode(xmlDoc, item, "ccorrespondtypename", ""); CreateNode(xmlDoc, item, "cfirstbillbid", ""); CreateNode(xmlDoc, item, "cfirstbillhid", ""); CreateNode(xmlDoc, item, "cfirsttypename", ""); CreateNode(xmlDoc, item, "cfirsttype", ""); CreateNode(xmlDoc, item, "csourcetypename", ""); CreateNode(xmlDoc, item, "pk_calbody", ""); CreateNode(xmlDoc, item, "vcalbodyname", ""); CreateNode(xmlDoc, item, "ts", DateTime.Now.ToString()); //? CreateNode(xmlDoc, item, "timestamp", ""); //? CreateNode(xmlDoc, item, "bodyts", DateTime.Now.ToString()); //? CreateNode(xmlDoc, item, "crowno", "1"); //行号??? CreateNode(xmlDoc, item, "nperiodastnum", ""); //期间业务辅数量 CreateNode(xmlDoc, item, "nperiodnum", ""); //期间业务数量 CreateNode(xmlDoc, item, "isforeignstor", "N"); CreateNode(xmlDoc, item, "isgathersettle", "N"); CreateNode(xmlDoc, item, "csortrowno", ""); CreateNode(xmlDoc, item, "cvendorid", ""); CreateNode(xmlDoc, item, "cvendorname", ""); CreateNode(xmlDoc, item, "pk_cubasdoc", ""); CreateNode(xmlDoc, item, "pk_corp", "1001"); //公司ID CreateNode(xmlDoc, item, "tbatchtime", ""); //组坯时间 CreateNode(xmlDoc, item, "dproducedate", ""); CreateNode(xmlDoc, item, "dvalidate", ""); CreateNode(xmlDoc, item, "vvendbatchcode", ""); CreateNode(xmlDoc, item, "qualitymanflag", ""); CreateNode(xmlDoc, item, "qualitydaynum", ""); CreateNode(xmlDoc, item, "cqualitylevelid", mod_TQB_CHECKSTATE.C_ID); //质量等级主键 CreateNode(xmlDoc, item, "vnote", ""); CreateNode(xmlDoc, item, "tchecktime", ""); //打牌时间 CreateNode(xmlDoc, item, "vdef1", ""); CreateNode(xmlDoc, item, "vdef2", ""); CreateNode(xmlDoc, item, "vdef3", ""); CreateNode(xmlDoc, item, "vdef4", ""); CreateNode(xmlDoc, item, "vdef5", ""); CreateNode(xmlDoc, item, "vdef6", ""); CreateNode(xmlDoc, item, "vdef7", ""); CreateNode(xmlDoc, item, "vdef8", ""); CreateNode(xmlDoc, item, "vdef9", ""); CreateNode(xmlDoc, item, "vdef10", ""); CreateNode(xmlDoc, item, "vdef11", ""); CreateNode(xmlDoc, item, "vdef12", ""); CreateNode(xmlDoc, item, "vdef13", ""); CreateNode(xmlDoc, item, "vdef14", ""); CreateNode(xmlDoc, item, "vdef15", ""); CreateNode(xmlDoc, item, "vdef16", ""); CreateNode(xmlDoc, item, "vdef17", ""); CreateNode(xmlDoc, item, "vdef18", ""); CreateNode(xmlDoc, item, "vdef19", ""); CreateNode(xmlDoc, item, "vdef20", ""); CreateNode(xmlDoc, item, "naccountgrsnum", ""); CreateNode(xmlDoc, item, "ncheckgrsnum", ""); CreateNode(xmlDoc, item, "nadjustgrsnum", ""); CreateNode(xmlDoc, item, "nshldtransgrsnum", ""); CreateNode(xmlDoc, item, "cspecialbid", ""); //? CreateNode(xmlDoc, item, "vbatchcode_temp", ""); //? CreateNode(xmlDoc, item, "cqualitylevelname", mod_TQB_CHECKSTATE.C_CHECKSTATE_NAME); //? CreateNode(xmlDoc, item, "vdef1", ""); //? CreateNode(xmlDoc, item, "vdef2", ""); //? CreateNode(xmlDoc, item, "vdef3", ""); //? #endregion body.AppendChild(item); xmlDoc.Save(url + "\\" + urlname); List <string> parem = SendNC.SendXML(url + "\\" + urlname); //parem.Add(dayplcode); //parem.Add(empID); //parem.Add("发运单"); //日志 //AddLog(parem); if (parem[0] == "1") { return("1"); } else { return(parem[1].ToString()); } } catch (Exception ex) { return(ex.Message); } }
/// <summary> /// 钢坯改判 /// </summary> /// <param name="row">选中的数据</param> /// <param name="strGrd">钢种</param> /// <param name="strStdCode">执行标准</param> /// <param name="strMatCode">物料编码</param> /// <param name="strMatName">物料描述</param> /// <param name="strZrdwID">责任单位代码</param> /// <param name="strZrdwName">责任代为描述</param> /// <param name="strPDDJ">判定等级</param> /// <param name="strRemark">备注</param> /// <param name="strUrl">地址</param> /// <param name="strZYX1">自由项1</param> /// <param name="strZYX2">自由项2</param> /// <param name="strGPYY">改判原因</param> /// <param name="strLen">定尺</param> /// <returns></returns> public string GP_Slab(string strs, string strGrd, string strStdCode, string strMatCode, string strMatName, string strZrdwID, string strZrdwName, string strPDDJ, string strRemark, string strUrl, string strZYX1, string strZYX2, string strGPYY, string strLen) { string result = "1"; try { Dal_TSC_SLAB_MAIN dal_slab = new Dal_TSC_SLAB_MAIN(); Dal_TQC_SLAB_COMMUTE dal_commute = new Dal_TQC_SLAB_COMMUTE(); Dal_Interface_NC_SLAB_KC4N dal_interface = new Dal_Interface_NC_SLAB_KC4N(); Dal_TPB_LGGYK dalTpbLggyk = new Dal_TPB_LGGYK(); Dal_TMO_ORDER dalTmoOrder = new Dal_TMO_ORDER(); Dal_TQD_DESIGN dalDesign = new Dal_TQD_DESIGN(); Dal_TB_STD_CONFIG dalTbStdConfig = new Dal_TB_STD_CONFIG(); TransactionHelper.BeginTransaction(); string strUserID = RV.UI.UserInfo.userID; DateTime time = RV.UI.ServerTime.timeNow(); string stove = ""; string max_C_MASTER_ID = ""; string max_C_GP_BEFORE_ID = ""; string max_C_GP_AFTER_ID = ""; string slabCode = ""; string strLGJH = ""; string strDesignNo = dalDesign.Get_Design_No(strStdCode, strGrd); if (string.IsNullOrEmpty(strDesignNo)) { return("改判失败,没有找到对应的执行标准信息!"); } string[] strs_Slab_ID = strs.Substring(0, strs.Length - 1).Split(','); //Mod_TSC_SLAB_MAIN modSlabMain = dal_slab.GetModel(strs_Slab_ID[0]); //Mod_TPB_LGGYK modLggyk = dalTpbLggyk.GetModel_Trans(modSlabMain.C_LGJH); //if (modLggyk == null) //{ // TransactionHelper.RollBack(); // return "改判失败,获取炼钢记号时错误!"; //} //DataTable dtLGJH = dalTpbLggyk.Get_LGJH(modLggyk.C_BOF_TYPE, modLggyk.C_LF_TYPE, modLggyk.C_RH_TYPE, modLggyk.C_CASTER_TYPE, strStdCode, strGrd).Tables[0]; //if (dtLGJH.Rows.Count > 1) //{ // TransactionHelper.RollBack(); // return "标准:" + strStdCode + ";钢种:" + strGrd + "找到多个炼钢记号,请核查!"; //} //else if (dtLGJH.Rows.Count == 0) //{ // TransactionHelper.RollBack(); // return "标准:" + strStdCode + ";钢种:" + strGrd + "没有找到炼钢记号!"; //} //strLGJH = dtLGJH.Rows[0]["C_STEEL_SIGN"].ToString(); DataTable dt = dal_commute.GetList_max().Tables[0]; max_C_MASTER_ID = dt.Rows[0]["C_MASTER_ID"].ToString(); max_C_GP_BEFORE_ID = dt.Rows[0]["C_GP_BEFORE_ID"].ToString(); max_C_GP_AFTER_ID = dt.Rows[0]["C_GP_AFTER_ID"].ToString(); if (string.IsNullOrEmpty(max_C_MASTER_ID)) { max_C_MASTER_ID = "GPsj" + RV.UI.ServerTime.timeNow().ToString("yyMMdd00001"); } else { max_C_MASTER_ID = "GPsj" + (Convert.ToInt64(max_C_MASTER_ID) + 1).ToString(); } if (string.IsNullOrEmpty(max_C_GP_BEFORE_ID)) { max_C_GP_BEFORE_ID = "GPpq" + RV.UI.ServerTime.timeNow().ToString("yyMMdd00001"); } else { max_C_GP_BEFORE_ID = "GPpq" + (Convert.ToInt64(max_C_GP_BEFORE_ID) + 1).ToString(); } if (string.IsNullOrEmpty(max_C_GP_AFTER_ID)) { max_C_GP_AFTER_ID = "GPph" + RV.UI.ServerTime.timeNow().ToString("yyMMdd00001"); } else { max_C_GP_AFTER_ID = "GPph" + (Convert.ToInt64(max_C_GP_AFTER_ID) + 1).ToString(); } Bll_TB_MATRL_MAIN bll_matrl = new Bll_TB_MATRL_MAIN(); for (int i = 0; i < strs_Slab_ID.Length; i++) { Mod_TSC_SLAB_MAIN mod_slab = dal_slab.GetModel(strs_Slab_ID[i]); stove = mod_slab.C_STOVE; if (mod_slab != null) { Mod_TB_MATRL_MAIN mod_matrl = bll_matrl.GetModel(strMatCode); stove = mod_slab.C_STOVE; slabCode = mod_slab.C_SLABWH_CODE; Mod_TQC_SLAB_COMMUTE mod = new Mod_TQC_SLAB_COMMUTE(); mod.C_STA_ID = mod_slab.C_STA_DESC; mod.C_STOVE = mod_slab.C_STOVE; mod.C_BATCH_NO = mod_slab.C_BATCH_NO; mod.N_WGT = mod_slab.N_WGT; mod.N_LEN = mod_slab.N_LEN; mod.C_STL_GRD_BEFORE = mod_slab.C_STL_GRD; mod.C_STD_CODE_BEFORE = mod_slab.C_STD_CODE; mod.C_SPEC_BEFORE = mod_slab.C_SPEC; mod.C_MAT_CODE_BEFORE = mod_slab.C_MAT_CODE; mod.C_MAT_DESC_BEFORE = mod_slab.C_MAT_NAME; mod.C_ZYX1_BEFORE = mod_slab.C_ZYX1; mod.C_ZYX2_BEFORE = mod_slab.C_ZYX2; mod.C_JUDGE_LEV_BP_BEFORE = mod_slab.C_MAT_TYPE; mod.D_COMMUTE_DATE = RV.UI.ServerTime.timeNow(); mod.C_STL_GRD_AFTER = strGrd; mod.C_STD_CODE_AFTER = strStdCode; mod.C_SPEC_AFTER = mod_matrl.C_SLAB_SIZE; mod.C_MAT_CODE_AFTER = strMatCode; mod.C_MAT_DESC_AFTER = strMatName; mod.C_REASON_DEPMT_ID = strZrdwID; mod.C_REASON_DEPMT_DESC = strZrdwName; mod.C_EMP_ID = RV.UI.UserInfo.UserID; mod.C_REMARK = strRemark; mod.C_MASTER_ID = max_C_MASTER_ID; mod.C_GP_BEFORE_ID = max_C_GP_BEFORE_ID; mod.C_GP_AFTER_ID = max_C_GP_AFTER_ID; mod.C_ZYX1_AFTER = strZYX1; mod.C_ZYX2_AFTER = strZYX2; mod.C_JUDGE_LEV_BP_AFTER = strPDDJ; mod.C_COMMUTE_REASON = strGPYY; if (dal_commute.Add_Trans(mod)) { if (!dal_slab.Update_Trans(mod_slab.C_ID, mod_slab.C_BATCH_NO, strGrd, strStdCode, strMatCode, strMatName, mod_matrl.C_SLAB_SIZE, max_C_MASTER_ID, max_C_GP_BEFORE_ID, max_C_GP_AFTER_ID, strLGJH, strPDDJ, strZYX1, strZYX2, strGPYY, strLen, strDesignNo)) { TransactionHelper.RollBack(); return("改判失败,请检查修改后的内容!"); } } else { TransactionHelper.RollBack(); return("改判失败,添加改判记录时错误!"); } } } string interface_nc = dal_interface.SendXml_GP(strUrl, max_C_MASTER_ID, max_C_GP_BEFORE_ID, max_C_GP_AFTER_ID, slabCode); if (interface_nc != "1") { TransactionHelper.RollBack(); return(interface_nc); } TransactionHelper.Commit(); } catch (Exception ex) { TransactionHelper.RollBack(); return(ex.Message); } return(result); }
/// <summary> /// 钢坯改判 /// </summary> /// <param name="row">选中的数据</param> /// <param name="strGrd">钢种</param> /// <param name="strStdCode">执行标准</param> /// <param name="strMatCode">物料编码</param> /// <param name="strMatName">物料描述</param> /// <param name="strZrdwID">责任单位代码</param> /// <param name="strZrdwName">责任代为描述</param> /// <param name="strPDDJ">判定等级</param> /// <param name="strZYX1">自由项1</param> /// <param name="strZYX2">自由项2</param> /// <param name="strGPYY">改判原因</param> /// <param name="strLen">定尺</param> /// <param name="strISSH">是否审核</param> /// <returns></returns> public string TPGP_Slab(string strs, string strGrd, string strStdCode, string strMatCode, string strMatName, string strZrdwID, string strZrdwName, string strPDDJ, string strZYX1, string strZYX2, string strGPYY, string strLen, decimal strISSH) { string result = "1"; try { Dal_TQC_TP_SLAB_COMMUTE dalTP = new Dal_TQC_TP_SLAB_COMMUTE(); Dal_TSC_SLAB_MAIN dal_slab = new Dal_TSC_SLAB_MAIN(); Dal_TQD_DESIGN dalDesign = new Dal_TQD_DESIGN(); TransactionHelper.BeginTransaction(); string strUserID = RV.UI.UserInfo.userID; DateTime time = RV.UI.ServerTime.timeNow(); string stove = ""; string strDesignNo = dalDesign.Get_Design_No(strStdCode, strGrd); if (string.IsNullOrEmpty(strDesignNo)) { return("改判失败,没有找到对应的执行标准信息!"); } string[] strs_Slab_ID = strs.Substring(0, strs.Length - 1).Split(','); Bll_TB_MATRL_MAIN bll_matrl = new Bll_TB_MATRL_MAIN(); for (int i = 0; i < strs_Slab_ID.Length; i++) { Mod_TSC_SLAB_MAIN mod_slab = dal_slab.GetModel(strs_Slab_ID[i]); stove = mod_slab.C_STOVE; if (mod_slab != null) { Mod_TB_MATRL_MAIN mod_matrl = bll_matrl.GetModel(strMatCode); stove = mod_slab.C_STOVE; Mod_TQC_TP_SLAB_COMMUTE mod = new Mod_TQC_TP_SLAB_COMMUTE(); mod.C_STA_ID = mod_slab.C_STA_DESC; mod.C_SLAB_MAIN_ID = strs_Slab_ID[i]; mod.C_STOVE = mod_slab.C_STOVE; mod.C_BATCH_NO = mod_slab.C_BATCH_NO; mod.N_WGT = mod_slab.N_WGT; mod.N_LEN_BEFORE = mod_slab.N_LEN; mod.C_STL_GRD_BEFORE = mod_slab.C_STL_GRD; mod.C_STD_CODE_BEFORE = mod_slab.C_STD_CODE; mod.C_SPEC_BEFORE = mod_slab.C_SPEC; mod.C_MAT_CODE_BEFORE = mod_slab.C_MAT_CODE; mod.C_MAT_DESC_BEFORE = mod_slab.C_MAT_NAME; mod.C_ZYX1_BEFORE = mod_slab.C_ZYX1; mod.C_ZYX2_BEFORE = mod_slab.C_ZYX2; mod.C_JUDGE_LEV_BP_BEFORE = mod_slab.C_MAT_TYPE; mod.C_STL_GRD_AFTER = strGrd; mod.C_STD_CODE_AFTER = strStdCode; mod.C_SPEC_AFTER = mod_matrl.C_SLAB_SIZE; mod.N_LEN_AFTER = Convert.ToDecimal(strLen); mod.C_MAT_CODE_AFTER = strMatCode; mod.C_MAT_DESC_AFTER = strMatName; mod.C_REASON_DEPMT_ID = strZrdwID; mod.C_REASON_DEPMT_DESC = strZrdwName; mod.C_EMP_ID = RV.UI.UserInfo.UserName; mod.C_ZYX1_AFTER = strZYX1; mod.C_ZYX2_AFTER = strZYX2; mod.C_JUDGE_LEV_BP_AFTER = strPDDJ; mod.C_COMMUTE_SQ = strGPYY; mod.N_IS_SH = strISSH; mod.C_REMARK2 = mod_slab.C_MOVE_TYPE; mod.C_REMARK3 = mod_slab.C_SLABWH_CODE; if (dalTP.Add_Trans(mod)) { if (!dal_slab.UpdateTP_Trans(mod_slab.C_ID, mod_slab.C_BATCH_NO)) { TransactionHelper.RollBack(); return("改判失败,修改钢坯实绩状态时错误!"); } } else { TransactionHelper.RollBack(); return("改判失败,添加改判记录时错误!"); } } } TransactionHelper.Commit(); } catch (Exception ex) { TransactionHelper.RollBack(); return(ex.Message); } return(result); }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TSC_SLAB_MAIN GetModel(string C_ID) { return(dal.GetModel(C_ID)); }