/// <summary> /// 初始化增量数据 /// </summary> private bool InitiationIncrementXml() { var result = false; try { if (File.Exists(xmlPath)) { xmlDBManager = new XmlDBManager { FileName = xmlPath }; #if EnableLock xmlDBManager.Password = XmlPassword.Instance.Password; #endif xmlDBManager.Initialize(); if (HasIncrement(xmlDBManager)) { //合并增量数据源 (DBManager.Instance as XmlDBManager).MergeIncrement(xmlDBManager); var duplicateRecord = (DBManager.Instance as XmlDBManager).MergeIncrement(xmlDBManager); Duplicate(xmlDBManager, duplicateRecord); result = true; } } }catch (Exception exception) { LogManager.Instance.Error(exception); } return(result); }
/// <summary> /// 加载点线面设备 /// </summary> /// <param name="symbol"></param> /// <param name="xmlDBManager"> </param> private void LoadIncrementSymbol(DBSymbolEntry symbol, XmlDBManager xmlDBManager) { try { if (!string.IsNullOrEmpty(symbol.SymbolPtTable)) { var type = TypeCache.Instance.GetTypeFromCache(typeof(DBEntity), symbol.SymbolPtTable.Trim()); if (xmlDBManager.Has(type)) { //获取坐标数据 var pts = xmlDBManager.GetEntities(type).Cast <ElectronSymbol>(); //颜色转换 var color = CADColor.FromColor(Color.FromArgb(int.Parse(symbol.OtherProperty.SymbolColor))); //加载图形 AddElectronSymbol(symbol.OtherProperty.LayerName.Trim(), pts, color, symbol.OtherProperty.LineType, symbol.OtherProperty.LineWidth); } } } catch (Exception ex) { if (!ex.Message.Contains("给定关键字不在字典中")) { LogManager.Instance.Error("加载设备错误!" + ex); } } }
/// <summary> /// 合并其他状态数据 /// </summary> /// <param name="xmlDBManager"></param> private void MergerElseStateSymbol(XmlDBManager xmlDBManager) { updateStateGEOMETRY = new Dictionary <ObjectId, ElectronSymbol>(); notPointFidList = new List <long>(); pointFidList = new List <long>(); var tables = xmlDBManager.GetInerementTables(); foreach (var table in tables) { //查询修改过的数据 var entities = table.Entities.Where(o => o.EntityState != EntityState.Insert && o.EntityState != EntityState.None); foreach (var entity in entities) { //过滤新增状态的连接关系(Add_Add_Add) var entityState = entity.EntityState.ToString().Split('_'); if (entityState[0] == "Add") { continue; } //DBManager.Instance.Update(entity); UpdateGraph(entity); } } //更新点设备图形 UpdatePointGraph(); }
/// <summary> /// 加载标注 /// </summary> /// <param name="xmlDBManager"> </param> /// <param name="layerLableName">层名称</param> /// <param name="className">类型名称</param> /// <param name="index"></param> private void LoadSymbolLabel(XmlDBManager xmlDBManager, string layerLableName, string className, int index) { try { var type = TypeCache.Instance.GetTypeFromCache(typeof(DBEntity), className); if (xmlDBManager.Has(type)) { var lb = xmlDBManager.GetEntities(type).Cast <ElectronSymbol>().ToList(); //大于0,则有多个标注 if (index > 0) { lb.ForEach(o => o.FinderFuncNumber = o.G3E_FNO * 10 + index); } else { lb.ForEach(o => o.FinderFuncNumber = o.G3E_FNO); } var lbs = GetLabel_lb_sdogeom(xmlDBManager, className); DCadApi.addLabelLayer(layerLableName, lb, lbs, CADColor.FromRgb(255, 255, 255), xmlDBManager); } } catch (Exception ex) { LogManager.Instance.Error(ex); } }
/// <summary> /// 加载设备 /// </summary> /// <param name="xmlDBManager">数据源</param> /// <param name="isParcent">是否计算百分比 </param> public static void LoadAllSymbol(XmlDBManager xmlDBManager, bool isParcent) { var index = 0; var sum = SimpleDBSymbolsConfig.Instance.DBSymbol.Count; //台架和开关柜无符号 var specialSymbol = new[] { 198, 199 }; basePoint = new List <Point3d>(); PublicMethod.Instance.dicObjIds = new Dictionary <ObjectId, DBEntity>(); DBEntityCopy.Instance.dgList = new HashSet <long>(); foreach (var symbol in SimpleDBSymbolsConfig.Instance.DBSymbol) { if (isParcent) { //计算百分比 GetParcentHandler(index, sum); } if (symbol.G3E_FNO == 250) { continue; } if (specialSymbol.Contains(symbol.G3E_FNO)) { DBEntityFinder.Instance.GetSpecialSymbolData(symbol.G3E_FNO); continue; } //加载设备 LoadSymbol(symbol, xmlDBManager); ////加载标注 LoadSymbolLable(symbol, xmlDBManager); index++; } //加载杂项标注 //LoadZxbzSymbol(xmlDBManager); }
/// <summary> /// 获取自定义模版数据源 /// </summary> /// <param name="xmlDB"></param> /// <param name="objIds"></param> /// <param name="basePoint"></param> /// <returns></returns> private static XmlDBManager GetCustomsSymbolXmlDB(XmlDBManager xmlDB, IEnumerable <ObjectId> objIds, Point3d basePoint) { return((from objectId in objIds where DBEntityFinder.Instance.HasG3EIDS(objectId) select copyCustomsSymbolData.FirstOrDefault(o => o.Key == objectId) into cso where cso.Value != null select cso).Aggregate(xmlDB, (current, cso) => AddXmlDB(cso.Value, current, basePoint))); }
///// <summary> ///// 保存复制的标注数据 ///// </summary> ///// <param name="dbEntity"></param> ///// <param name="xmlDB"> </param> //private static XmlDBManager SaveCopylabelData(DBEntity dbEntity, XmlDBManager xmlDB) //{ // if (dbEntity != null) // { // xmlDB.Insert(dbEntity); // } // return xmlDB; //} #endregion #region 读取数据 /// <summary> /// 加载xml 添加自定义符号 /// </summary> /// <param name="path">自定义符号路径</param> /// <param name="customSymbolName">自定义符号名称</param> public static void LoadSymbolSetXMl(string path, string customSymbolName) { try { Clear(); if (!DBCustomFinder.Instance.ContainsKey(customSymbolName)) { xmlDBManager = CreateDBXml(path); if (xmlDBManager.Count() == 0) { PublicMethod.Instance.AlertDialog(string.Format("{0}该模版已损坏!", customSymbolName)); DBCustomFinder.Instance.Remove(customSymbolName); return; } DBCustomFinder.Instance.Add(customSymbolName, xmlDBManager); } else { xmlDBManager = DBCustomFinder.Instance[customSymbolName]; } CABLEManager.LoadAllSymbol(xmlDBManager, false); InsertCustomSymbol(CABLEManager.basePoint[0], PublicMethod.Instance.dicObjIds); //处理拓扑关系 DBEntityCopy.Instance.UpdateConnectionData(); } catch (System.Exception exception) { LogManager.Instance.Error(exception); } finally { PublicMethod.Instance.dicObjIds.Clear(); } }
private static void Duplicate(XmlDBManager xmlDbManager, IEnumerable <DBEntity> duplicateRecord) { foreach (var dbEntity in duplicateRecord) { xmlDbManager.Delete(dbEntity); } }
/// <summary> /// 创建xml /// </summary> /// <param name="filePath">xml保存路径</param> private static XmlDBManager CreateDBXml(string filePath) { var xmldb = new XmlDBManager { FileName = filePath }; xmldb.Initialize(); return(xmldb); }
/// <summary> /// 加载点线面设备标注 /// </summary> /// <param name="dbSymbolEntry"></param> /// <param name="xmlDBManager"> </param> public static void LoadSymbolLable(DBSymbolEntry dbSymbolEntry, XmlDBManager xmlDBManager) { var i = 0; foreach (var label in dbSymbolEntry.Label) { LoadSymbolLabel(xmlDBManager, label.Name, label.LabelPtTable, i); i++; } }
private static void Process() { do { Log("-----------------------------"); Log(" GV = GraphViz"); Log(" CX = Convert .csv to .xml"); Log(" TH = Convert .txt to .html"); Log(" XT = XML table"); Log("-----------------------------"); List <string> commands = new List <string>() { "GV", "CX", "TH", "XT" }; string command = cw.Ask(new QAManager(commands, "GV", "Select a tool")); switch (command.ToUpper()) { case "C": { return; } case "GV": { GraphViz(); break; } case "CX": { csvToXml = new CsvToXml(ow, configXml); csvToXml.Start(); break; } case "TH": { txtToHtml = new TxtToHtml(ow, configXml); txtToHtml.Start(); break; } case "XT": { xDbM = new XmlDBManager(ow, configXml); xDbM.LoadDFD(); xDbM.SaveDFD(); break; } } Log(OK); xm.Save(); } while (true); }
/// <summary> /// 加载数据源 /// </summary> /// <param name="filePath"></param> private void Initialization(string filePath) { var xmldb = new XmlDBManager { FileName = filePath }; #if EnableLock xmldb.Password = XmlPassword.Instance.Password; #endif DBManager.Set(xmldb); xmldb.InitializeAsync(OnDataLoadCompleted); }
/// <summary> /// 判断是否是增量Xml文件 /// </summary> /// <param name="xmlDBManager"></param> /// <returns></returns> private bool HasIncrement(XmlDBManager xmlDBManager) { try { var cadVersion = xmlDBManager.GetEntity <CadVersion>(o => o.G3E_FID == 1); if (cadVersion == null) { return(false); } return(true); } catch { return(false); } }
/// <summary> /// 加载点线面设备标注 /// </summary> /// <param name="dbSymbolEntry"></param> /// <param name="xmlDBManager"> </param> public void LoadIncrementLalbel(DBSymbolEntry dbSymbolEntry, XmlDBManager xmlDBManager) { try { for (var i = 0; i < dbSymbolEntry.Label.Count; i++) { LoadSymbolLabel(xmlDBManager, dbSymbolEntry.Label[i].Name, dbSymbolEntry.Label[i].LabelPtTable, i); } } catch (Exception exception) { LogManager.Instance.Error(string.Format("加载增量标注错误!{0}", exception)); } }
/// <summary> /// 保存复制数据 /// </summary> /// <param name="cso"> </param> /// <param name="xmlDB"> </param> /// <param name="basePoint"> </param> private static XmlDBManager AddXmlDB(CopySymbolObject cso, XmlDBManager xmlDB, Point3d basePoint) { if (cso.pointDBEntity != null) { var newObject_pt = cso.pointDBEntity; newObject_pt.BasePoint = ConvertGeometry.Instance.GetMultipoint(basePoint.X, basePoint.Y, 0); xmlDB.Insert(newObject_pt); } if (cso.hsDBEntity != null) { foreach (var nData in cso.hsDBEntity) { xmlDB.Insert(nData.dbEntity); } } return(xmlDB); }
private IEnumerable <ElectronBase> GetLabel_lb_sdogeom(XmlDBManager xmlDBManager, string className) { try { var lbClassName = className.Replace("_sdogeom", ""); var type = TypeCache.Instance.GetTypeFromCache(typeof(DBEntity), lbClassName); if (xmlDBManager.Has(type)) { return(xmlDBManager.GetEntities(type).Cast <ElectronBase>()); } } catch (Exception ex) { LogManager.Instance.Error(ex); } return(new List <ElectronBase>()); }
private static void AddZxbzSymbol(XmlDBManager xmlDBManager, ElectronTransferModel.V9_4.Gg_gl_zxbz_n zxbzn) { var zxbzGeom = DBEntityFinder.Instance.GetZxbzGeomByG3e_fid(xmlDBManager, zxbzn.G3E_FID); if (zxbzGeom != null) { //获取坐标 var point = new Point3d((zxbzGeom.G3E_GEOMETRY as Multipoint).Points[0].X, (zxbzGeom.G3E_GEOMETRY as Multipoint).Points[0].Y, 0); //获取角度 var rotateAngle = Math.Atan2((zxbzGeom.G3E_GEOMETRY as Multipoint).Points[1].Y, (zxbzGeom.G3E_GEOMETRY as Multipoint).Points[1].X); //杂项标注图层 var layerID = DCadApi.addLayer("杂项标注"); //标注大小 var lbHeight = 0.35 / MapConfig.Instance.earthscale; //标注颜色 var color = CADColor.FromRgb(0, 0, 0); if (!string.IsNullOrEmpty(zxbzn.MIF_TEXT)) { Entity tEntity; var lb = DBEntityFinder.Instance.GetLabel_LB(zxbzGeom); var alignment = DBEntityFinder.Instance.GetG3eAlignment(lb); if (zxbzn.MIF_TEXT.Contains("\n")) { tEntity = SymbolLabel.Mtext(zxbzn.MIF_TEXT, point, rotateAngle, lbHeight, layerID); } else { tEntity = SymbolLabel.AddText(zxbzn.MIF_TEXT, point, rotateAngle, lbHeight, layerID, color, alignment); } DCadApi.AddPinchPoint(tEntity); DCadApi.AddLabelPinchPoint(tEntity); //添加到当前模型中 var objectId = PublicMethod.Instance.ToModelSpace(tEntity); zxbzGeom.IsErased = false; zxbzGeom.EntityType = EntityType.ZxLabel; PublicMethod.Instance.AddDBSymbolFinder(objectId, zxbzGeom); } } }
/// <summary> /// 初始化地图数据 /// </summary> private void InitiaDTData() { var dtFilePath = Path.Combine(directoryName, "DT_WZBZ.xml"); if (File.Exists(dtFilePath)) { var xmldtdb = new XmlDBManager { FileName = dtFilePath }; #if EnableLock xmldtdb.Password = XmlPassword.Instance.Password; #endif DTDBManager.Set(xmldtdb); xmldtdb.InitializeAsync(DtEventHandle); } else { LogManager.Instance.Error("缺失地图数据!"); } }
/// <summary> /// 初始化CD表 /// </summary> private void InitiaCDData() { var cdFilePath = Path.Combine(directoryName, "CdConfig.xml"); if (File.Exists(cdFilePath)) { var xmlcddb = new XmlDBManager { FileName = cdFilePath }; #if EnableLock xmlcddb.Password = XmlPassword.Instance.Password; #endif xmlcddb.Initialize(); CDDBManager.Set(xmlcddb); } else { LogManager.Instance.Error("缺失GIS样式数据"); } }
/// <summary> /// 加载点线面设备 /// </summary> /// <param name="dbSymbolEntry"></param> /// <param name="xmlDbManager"> </param> private static void LoadSymbol(DBSymbolEntry dbSymbolEntry, XmlDBManager xmlDbManager) { try { if (!string.IsNullOrEmpty(dbSymbolEntry.SymbolPtTable)) { var type = TypeCache.Instance.GetTypeFromCache(typeof(DBEntity), dbSymbolEntry.SymbolPtTable.Trim()); if (xmlDbManager.Has(type)) { //获取坐标数据 var pts = xmlDbManager.GetEntities(type).Cast <ElectronSymbol>(); //颜色转换 var color = Color.FromColor(System.Drawing.Color.FromArgb(int.Parse(dbSymbolEntry.OtherProperty.SymbolColor))); //加载图形 AddElectronSymbol(dbSymbolEntry.OtherProperty.LayerName.Trim(), pts, color, dbSymbolEntry.OtherProperty.LineType, dbSymbolEntry.OtherProperty.LineWidth, xmlDbManager); } } } catch (Exception) { } }
/// <summary> /// 多次导入导数据的方法 /// </summary> /// <param name="oracledb"></param> /// <param name="xmldb"></param> /// <param name="GC_ID"></param> /// <param name="smzq"></param> /// <param name="appenshiptime"></param> /// <param name="qj"></param> public void TwoImport(OracleDBManager oracledb, XmlDBManager xmldb, string GC_ID, string smzq, DateTime appenshiptime, string qj) { try { ElectronTransferServicePro.uploadPro(oracledb, xmldb, smzq, GC_ID, appenshiptime, qj); CYZLog.writeLog("End 增量的增删改"); UploadEventHandler.CONTAIN_N(oracledb, xmldb, GC_ID, smzq, appenshiptime, qj); CYZLog.writeLog("End 更新包含关系表"); UploadEventHandler.CONNECTIVITY_N(oracledb, xmldb, GC_ID, smzq, appenshiptime, qj); CYZLog.writeLog("End 更新连接关系表"); UploadEventHandler.UploadDetailreference_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, qj); CYZLog.writeLog("End 更新祥图关系表"); UploadEventHandler.UploadGg_jx_jlb_pt(oracledb, xmldb, GC_ID, smzq, appenshiptime, qj); CYZLog.writeLog("End 更新计量表与变压器和计量柜对照表"); UploadEventHandler.UploadGg_jx_shbd_pt(oracledb, xmldb, GC_ID, smzq, appenshiptime, qj); CYZLog.writeLog("End 更新户表与集抄对照表"); } catch (Exception ex) { CYZLog.writeLog(ex.ToString(), ""); } }
/// <summary> /// 加载杂项标注 /// </summary> public static void LoadZxbzSymbol(XmlDBManager xmlDBManager) { long g3e_fid = 0; try { var notRelationZxbz = DBEntityFinder.Instance.GetNotRelationZxbzN(xmlDBManager); foreach (var zxbzn in notRelationZxbz) { if (zxbzn.EntityState != EntityState.Delete) { g3e_fid = zxbzn.G3E_FID; AddZxbzSymbol(xmlDBManager, zxbzn); } } } catch (Exception ex) { if (!ex.Message.Contains("不存在")) { LogManager.Instance.Error("加载杂项标注错误!g3e_fid:" + g3e_fid + ex); } } }
/// <summary> /// 加载增量数据 /// </summary> /// <param name="xmlDBManager"></param> private void ErgodicIncrementXml(XmlDBManager xmlDBManager) { var index = 0.0; //过滤无符号数据 var filter = new[] { 198, 199, 250 }; var sum = SimpleDBSymbolsConfig.Instance.DBSymbol.Count; foreach (var symbol in SimpleDBSymbolsConfig.Instance.DBSymbol) { //计算百分比 ToolTipText(index, sum); if (filter.Contains(symbol.G3E_FNO)) { continue; } //加载增量设备 LoadIncrementSymbol(symbol, xmlDBManager); //加载增量设备标注 LoadIncrementLalbel(symbol, xmlDBManager); index++; } //加载增量设备杂项标注 //CABLEManager.LoadZxbzSymbol(xmlDBManager); }
/// <summary> /// 在cad指定图层上添加多个标注 /// </summary> /// <param name="_layerName">图层名称</param> /// <param name="_esymb">多个标注对象</param> /// <param name="lbs"> </param> /// <param name="color"> </param> /// <param name="xmlDbManager"> </param> /// <returns></returns> public static void addLabelLayer(string _layerName, IEnumerable <ElectronSymbol> _esymb, IEnumerable <ElectronBase> lbs, CADColor color, XmlDBManager xmlDbManager) { try { var objId = DCadApi.addLayer(_layerName, CADColor.FromRgb(255, 255, 255)); if (objId != ObjectId.Null) { foreach (var _ee in _esymb) { if (_ee.EntityState == EntityState.Insert) { //var g3e_cno = _ee.GetValue<int>("G3E_CNO"); var lb = DCadApi.GetLabel_LB(lbs, _ee.G3E_FID); DCadApi.addLabelLayer(objId, _ee, lb, color, xmlDbManager); } } } } catch (Exception exx) { LogManager.Instance.Error(exx); } }
/// <summary> /// 获取设备样式 /// </summary> /// <param name="es"></param> /// <param name="lineWidth"></param> /// <param name="color"></param> /// <param name="xmlDbManager"> </param> /// <returns></returns> public static SymbolEventArgs GetSymbolExecution(ElectronSymbol es, double lineWidth, CADColor color, XmlDBManager xmlDbManager) { var symboleargs = new SymbolEventArgs { color = color, lineWidth = lineWidth, electronSymbol = es, DBManager = xmlDbManager }; ExecutionManager.Instance.GetFactory(typeof(SymbolExecutionFactory)).GetExecution(es.G3E_FNO).Execute(es, symboleargs); return(symboleargs); }
/// <summary> /// 获取设备样式 /// </summary> /// <param name="es"></param> /// <param name="color"></param> /// <param name="xmlDbManager"> </param> /// <returns></returns> public static SymbolEventArgs GetSymbolExecution(ElectronSymbol es, CADColor color, XmlDBManager xmlDbManager) { var value = new SymbolEventArgs { color = color, electronSymbol = es, DBManager = xmlDbManager }; //匹配符号 ExecutionManager.Instance.GetFactory(typeof(SymbolExecutionFactory)).GetExecution(es.G3E_FNO).Execute(es, value); return(value); }
/// <summary> /// 获取源符号的块定义名称 /// </summary> /// <param name="objectId"></param> /// <param name="g3eObject"></param> /// <param name="xmlDbManager"> </param> /// <returns></returns> public static SymbolEventArgs GetSymbolExecution(ObjectId objectId, G3EObject g3eObject, XmlDBManager xmlDbManager) { SymbolEventArgs value = null; try { var pt = DBSymbolFinder.Instance[objectId]; value = new SymbolEventArgs { DBManager = xmlDbManager, electronSymbol = pt }; //匹配符号 ExecutionManager.Instance.GetFactory(typeof(SymbolExecutionFactory)).GetExecution(g3eObject.G3E_FNO). Execute(pt, value); } catch (Exception ex) { LogManager.Instance.Error("获取符号样式失败!\n" + ex); } //获取块定义名称 return(value); }
/// <summary> /// 插入标注 /// </summary> /// <param name="_esymb"></param> /// <param name="position"></param> /// <param name="rotateAngle"></param> /// <param name="layerId"></param> /// <param name="alignment"></param> /// <param name="xmlDbManager"></param> public static void InsertLabel(ElectronSymbol _esymb, Point3d position, double rotateAngle, ObjectId layerId, int alignment, XmlDBManager xmlDbManager) { if (_esymb.EntityState != EntityState.Delete) { _esymb.EntityType = EntityType.Label; var value = new LabelEventArgs { xmlDB = xmlDbManager, color = CADColor.FromRgb(0, 0, 0) }; value = GetLabelTextStyle(_esymb, value); if (string.IsNullOrEmpty(value.lbText)) { value.lbText = ""; } //打开图层再添加标注 PublicMethod.Instance.SetLayerDisplay(layerId, false); //标注高度 var lbHeight = value.lbHeight / MapConfig.Instance.earthscale; if (value.lbText.Contains("\n")) { var mText = Mtext(value.lbText, position, rotateAngle, lbHeight, layerId); AddEntity(mText, _esymb); } else { var mText = AddText(value.lbText, position, rotateAngle, lbHeight, layerId, value.color, alignment); AddEntity(mText, _esymb); } } }
public string UpLoadAppend(string AppendFile, string GC_ID) { string ss = "TRUE"; int SjBVerion = 0; string smzq = ""; bool bbreval = false; string UserName = ""; string PassWord = ""; string QjPz = ""; CDBManger cdm = null; try { DateTime appenshiptime = DateTime.Now; CYZLog.writeLog("UpLoadAppend(" + AppendFile + "," + GC_ID + ")"); string gistick = ""; smzq = Smzq(GC_ID, ref gistick); if (smzq == "") { return("工单不存在。"); } bbreval = false; var xmldb = new XmlDBManager(); xmldb.FileName = Application["dataappendpath"] + GC_ID + "\\" + AppendFile.Substring(AppendFile.LastIndexOf("/") + 1, AppendFile.Length - AppendFile.LastIndexOf("/") - 1); xmldb.Initialize(); if (xmldb.Count() <= 0) { CYZLog.writeLog("数据格式不正确"); return("数据格式不正确请重新导出"); } int ZlVerion = -1; var CadV = xmldb.GetEntity <CadVersion>(o => o.G3E_FID == 1); //这个版本号是从增量文件得到的 ZlVerion = CadV.Version; //对比tickship里面的版本号 cdm = new CDBManger(); GetUserNamePwd(GC_ID, ref UserName, ref PassWord, ref QjPz); if (string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(PassWord) || string.IsNullOrEmpty(QjPz)) { CYZLog.writeLog("账号或密码不存在"); return("账号或密码不存在"); } var oracledb = new OracleDBManager { UserName = UserName, Password = PassWord }; //var oracledb = new OracleDBManager(); string str = "select VERSION from cadgis.appendship t where t.gcticket_id='" + GC_ID + "'"; DataTable tab = cdm.ExecuteTable(str); if (tab != null && tab.Rows.Count > 0) { SjBVerion = int.Parse(tab.Rows[0][0].ToString()); if (ZlVerion == 1 || SjBVerion == 1)//数据库的版本等于1是说明这个数据从来没有到过直接按原来的导入即使是导过一次版本都等于1也是要撤销重新导入的 { if (!TickHelper.qxtick1(GC_ID, UserName, PassWord, QjPz)) { return("FALSE"); } OnceImport(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); } else { if (ZlVerion <= SjBVerion) { if (!TickHelper.qxtick1(GC_ID, UserName, PassWord, QjPz)) { return("FALSE"); } //发现增量文件版本低与tickship里面的版本号,就撤销工单. OnceImport(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); } else//如果要导入的版本高于数据库的版本执行下面的导入 { TwoImport(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); } } } else { if (!TickHelper.qxtick1(GC_ID, UserName, PassWord, QjPz)) { return("FALSE"); } OnceImport(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); } if (cdm != null) { cdm.close(); } //增量的增删改 //更新公共属性表里面的从属关系 UploadEventHandler.COMMON_N(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新公共属性表里面的从属关系"); UploadEventHandler.GG_PD_GNWZMC_N(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新功能位置表"); //更新计量表坐标的 UploadEventHandler.UploadGg_jx_jlb_pt_sdogeom(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新计量表坐标的"); //更新户表坐标的 UploadEventHandler.UploadGg_jx_shbd_pt_sdogeom(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新户表坐标的"); // UploadEventHandler.UploadGg_gl_zxbz_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新杂项标注"); UploadEventHandler.UpLoadGg_gz_tj_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新杂项标注"); UploadEventHandler.UpLoadGg_pd_cbx_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新集抄所属变压器"); UploadEventHandler.UpGg_pd_dykg_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新低压开关所属变压器"); UploadEventHandler.UpGg_jc_pwy_n(oracledb, xmldb, GC_ID, smzq, appenshiptime, QjPz); CYZLog.writeLog("End 更新配网仪所属变压器"); //修改所有新增修改删除数据的版本 cdm = new CDBManger(); string strSql = "update cadgis.ticketship set version=" + ZlVerion + " where gcticket_id='" + GC_ID + "'"; string strSql2 = "update cadgis.appendship set version=" + ZlVerion + " where gcticket_id='" + GC_ID + "'"; string StrSql3 = "update cadgis.appendfidship set version=" + ZlVerion + " where gcticket_id='" + GC_ID + "'"; cdm.ExecuteNonQuery(strSql); cdm.ExecuteNonQuery(strSql2); cdm.ExecuteNonQuery(StrSql3); TickHelper.SxSj(smzq, QjPz, UserName, PassWord); string tzdz = Application["dataappendpath"] + GC_ID; string filename = null; GetAllDbFiles(tzdz, ref filename); //上传生产的增量 TZInterface.UpLoadTZData(gistick.ToString(), System.Web.HttpUtility.UrlEncode(Application["dataftppath"].ToString().Replace("export", "import") + GC_ID + "/" + filename, Encoding.UTF8).Replace("%", "<M>") ); } catch (Exception ex) { bbreval = false; ss = ex.ToString(); CYZLog.writeLog(ex.ToString()); } finally { if (cdm != null) { cdm.close(); } } CYZLog.writeLog("End UpLoadAppend"); return(ss); }
/// <summary> /// 绘制标注 /// </summary> /// <param name="layerId"></param> /// <param name="_esymb"></param> /// <param name="esymlb"> </param> /// <param name="xmlDbManager"> </param> public static void DrawLabelSymbol(ObjectId layerId, ElectronSymbol _esymb, DBEntity esymlb, XmlDBManager xmlDbManager) { try { var point = new Point3d((_esymb.G3E_GEOMETRY as Multipoint).Points[0].X, (_esymb.G3E_GEOMETRY as Multipoint).Points[0].Y, 0); var rotateAngle = Math.Atan2((_esymb.G3E_GEOMETRY as Multipoint).Points[1].Y, (_esymb.G3E_GEOMETRY as Multipoint).Points[1].X); var alignment = DBEntityFinder.Instance.GetG3eAlignment(esymlb); InsertLabel(_esymb, point, rotateAngle, layerId, alignment, xmlDbManager); } catch (Exception exx) { LogManager.Instance.Error(string.Format("添加标注错误:{0}\nG3E_FID:{1}", exx, _esymb.G3E_FID)); } }