public IList <MyAction> ExportZu_TuDiQuanShuLaiYuanZhengMingActions(IList <XZDM> xzdms, string bootDir) { IList <MyAction> actions = new List <MyAction>(); string saveDir; foreach (XZDM xzdm in xzdms) { JTSYQ jtsyq = xzdm.JTSYQ; if (jtsyq != null) { Action action = new Action(() => { if (Utils.IsStrNull(xzdm.Zu)) { saveDir = bootDir + xzdm.Cun + "//村集体"; } else { saveDir = bootDir + xzdm.Cun + "//" + xzdm.Zu; } JTSYQDao.ExportZu_TuDiQuanShuLaiYuanZhengMing(jtsyq, saveDir); }); MyAction myAction = new MyAction(action, xzdm.CunZu + "土地权属来源证明"); actions.Add(myAction); } } return(actions); }
public void ExportJZDTable(JTSYQ GroupJTSYQ, string dir) { JTSYQCustom.OrderByJZDH(GroupJTSYQ); List <JZD> jzds = new List <JZD>(); double pingFangArea = 0; foreach (JTSYQ jtsyq in GroupJTSYQ.GroupJTSYQ) { pingFangArea += Decimal.ToSingle(decimal.Round(new decimal(jtsyq.Shape_Area), 2)); IList <JZD> temp = jtsyq.JZDS; if (temp == null) { return; } jzds.AddRange(temp); } double area = GroupJTSYQ.Area; GroupJTSYQ.Area = Math.Round(pingFangArea, 2); ISheet sheet = JZDCustom.CreateJZDSheet(jzds); sheet.Workbook.SetSheetName(0, GroupJTSYQ.BM); Dictionary <string, XMLObject> xmlobjectDic = XMLRead.XmlToObjects(JTSYQCustom.JZDXMLRelfect, false); ExcelWrite.ReplaceTextByXMLObject(sheet, GroupJTSYQ, xmlobjectDic); Dictionary <string, XMLObject> xmlobjectDic2 = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); ExcelWrite.ReplaceTextByXMLObject(sheet, GroupJTSYQ.XZDM, xmlobjectDic2); ExcelWrite.Save(sheet.Workbook, dir + "\\06界址点成果表" + GroupJTSYQ.XZDM.Zu + ".xls"); GroupJTSYQ.Area = area; }
private bool DifferentDks(IList <JTSYQ> JTSYQs, IList <JTSYQ> beforeJTSYQs) { int i = 0; IL_03: bool result; while (i < JTSYQs.Count) { JTSYQ JTSYQ = JTSYQs[i]; string zdnum = JTSYQ.BM; foreach (JTSYQ current in beforeJTSYQs) { bool flag = zdnum.Equals(current.BM); if (flag) { i++; goto IL_03; } } result = true; return(result); } result = false; return(result); }
private ShiftSizOkCommand(JTSYQ jtsyq, IList <IFeature> features, PreviewKeyDownEventArgs siziE) { string basic = "四至确定"; switch (siziE.KeyData) { case Keys.Up: base.m_caption = basic + ":北"; break; case Keys.Right: base.m_caption = basic + ":东"; break; case Keys.Down: base.m_caption = basic + ":南"; break; case Keys.Left: base.m_caption = basic + ":西"; break; } this.features = features; this.siziE = siziE; }
public void ExportZu_ZhiJieRenShenFengZhengMing(JTSYQ jtsyq, string saveDir) { //得到四至涉及单位 /*string str = "510185047009JA00008".Replace("510185",""); * var v = str.Insert(3, "-"); * var v1 = v.Insert(7, "-"); * var v2 = v1.Insert(10, "-");*/ List <XZDM> xzdms = new List <XZDM>(); foreach (JTSYQ tem in jtsyq.GroupJTSYQ) { xzdms.AddRange(JTSYQCustom.GetSZInXZDM(tem)); } //得到行政代码表 foreach (XZDM xzdm in xzdms) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.ZhiJieRenZhengMing); WordWrite.ReplaceText(doc, ClazzDic, xzdm); //查看是村不是组 if (Utils.IsStrNull(xzdm.CunZu)) { WordWrite.SaveToFile(doc, saveDir + "/04指界人身份证明及指界委托书" + xzdm.Cun + ".doc"); } else { WordWrite.SaveToFile(doc, saveDir + "/04指界人身份证明及指界委托书/" + xzdm.CunZu + ".doc"); } } }
public void ExportZu_TuDiQuanShuLaiYuanZhengMing(JTSYQ jtsyq, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); var doc = WordRead.Read(JTSYQCustom.Zu_TuDiQuanShuLaiYuanZhengMing); WordWrite.ReplaceText(doc, ClazzDic, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/01土地权属来源证明" + jtsyq.XZDM.XiangZheng + jtsyq.XZDM.CunZu + "(" + jtsyq.XZDM.DJZQDM + ").doc"); }
public static ShiftSizOkCommand GetInstance(JTSYQ jtsyq, IList <IFeature> features, PreviewKeyDownEventArgs siziE) { if (shiftSizOkCommand == null) { shiftSizOkCommand = new ShiftSizOkCommand(jtsyq, features, siziE); } return(shiftSizOkCommand); }
public int JZDBM(int startBH, JTSYQ jtsyq, IFeatureLayer featureLayer) { IList <JZD> jzds = JZDCustom.SearchOrCreateJZD(jtsyq, featureLayer); //设置界址点号 //jzds = JZDCustom.GetMapJZD(" JTSYQOBJECTID = " + jtsyq.OBJECTID); JZDCustom.SetBM(startBH, jtsyq, jzds, featureLayer); jtsyq.JZDS = jzds; return(jzds.Count); }
public void ExportZu_DangAnDai(JTSYQ jtsyq, string saveDir) { Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.Zu_DangAnDai); XZDM xzdm = jtsyq.XZDM; WordWrite.ReplaceText(doc, ClazzDic, xzdm); Dictionary <string, XMLObject> ClazzDic2 = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); WordWrite.ReplaceText(doc, ClazzDic2, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/00" + xzdm.XiangZheng + xzdm.CunZu + "(" + xzdm.DJZQDM + ")_1档案袋.doc"); }
public void ExportZu_ShenPiBiao(JTSYQ jtsyq, string saveDir) { //JTSYQCustom.SetContainsFeatureArea(jtsyq); XZDM xzdm = jtsyq.XZDM; Dictionary <string, XMLObject> xzdmDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); var doc = WordRead.Read(JTSYQCustom.ShenPiaoBiao); WordWrite.ReplaceText(doc, xzdmDic, xzdm); Dictionary <string, XMLObject> jtsyqDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); WordWrite.ReplaceText(doc, jtsyqDic, jtsyq); WordWrite.SaveToFile(doc, saveDir + "/05审批表" + xzdm.Zu + ".doc"); }
public IList <JZD> ExtractJZD_Intersectant(JTSYQ jtsyq, IList <JZD> jzds) { IFeature feature = jtsyq.Feature; IList <JZD> jzds1 = ExtractJzd(jtsyq, ArcGisUtils.GetFeatureLayer(JTSYQCustom.JTSYQLayerName), ArcGisUtils.GetFeatureLayer(JZDCustom.JZDLayer)); foreach (JZD jzd in jzds1) { jzd.ZDNUM = jtsyq.BM; jzd.JTSYQOBJECTID = jtsyq.OBJECTID; //jzd.Feature.Shape = jzd.Point; //JZDCustom.SaveMap(jzd); } JZDCustom.SaveMap(jzds1); return(null); }
public void ExportZu_QuanJiDiaoChaBiao(JTSYQ jtsyqGroup, string saveDir) { var doc = WordRead.Read(JTSYQCustom.QuanJiDiaoChaBiao); List <JZD> jzds = new List <JZD>(); int jzdCount = 0; foreach (JTSYQ jtsyq in jtsyqGroup.GroupJTSYQ) { IList <JZD> temp = jtsyq.JZDS; if (Utils.CheckListExists(temp)) { jzdCount += temp.Count; jzds.AddRange(temp); jzds.Add(temp[0]); JZD jzd = new JZD(); jzds.Add(jzd); } else { MessageBox.Show(jtsyq.QLR + ",图上还没有界址点!!!"); return; } } jtsyqGroup.JZDCount = jzdCount; //最后一个空白不要 jzds.RemoveAt(jzds.Count - 1); int jzdEndTableIndex = QuanJiDiaoChaBiaoWriteJZDS(doc, jzds); List <QZB> qzbs = new List <QZB>(); foreach (JTSYQ jtsyq in jtsyqGroup.GroupJTSYQ) { qzbs.AddRange(jtsyq.QZBS); } QuanJiDiaoChaBiaoWriteQZBS(doc, jzdEndTableIndex + 1, qzbs); // JTSYQCustom.SetContainsFeatureArea(jtsyqGroup); XZDM xzdm = jtsyqGroup.XZDM; Dictionary <string, XMLObject> xzdmDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true); WordWrite.ReplaceText(doc, xzdmDic, xzdm); Dictionary <string, XMLObject> jtsyqDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); WordWrite.ReplaceText(doc, jtsyqDic, jtsyqGroup); WordWrite.SaveToFile(doc, saveDir + "/" + System.IO.Path.GetFileName(JTSYQCustom.QuanJiDiaoChaBiao)); }
/// <summary> /// 设置多个四至 /// </summary> /// <param name="features"></param> private void SetJTSYQSiZi(PreviewKeyDownEventArgs e) { if (CurrentJTSYQ == null) { return; } IList <IFeature> features = ArcGisUtils.GetInstance().GetSelectFeature(); if (!MyUtils.Utils.CheckListExists(features)) { return; } JTSYQCustom jTSYQCustom = new JTSYQCustom(CurrentJTSYQ); Dictionary <string, IList <IFeature> > featuresDic = ArcGisUtils.GetFeatureDicByLayer(features); //其他集体所有权 IList <IFeature> siziFeatures; if (featuresDic.TryGetValue(JTSYQCustom.JTSYQLayerName, out siziFeatures)) { IList <JTSYQ> siziJTSYQS = JTSYQCustom.FeaturesToJTSYQ(siziFeatures); if (!MyUtils.Utils.CheckListExists(siziJTSYQS)) { return; } //移除自身地块 int count = siziJTSYQS.Count; for (int a = 0; a < count; a++) { JTSYQ round = siziJTSYQS[a]; if (round.Feature.OID == CurrentJTSYQ.Feature.OID) { siziJTSYQS.RemoveAt(a); count--; a--; } } jTSYQCustom.SetSiZi(e, siziJTSYQS); } jTSYQCustom.ArcGisSave(); //更新显示的table中 的josn数据 }
public void ExportZu_ZhongDiBiao(JTSYQ jtsyqGroup, string saveDir) { // JTSYQCustom.SetContainsFeatureArea(jtsyqGroup); Dictionary <int, XMLTable> ClazzDic = XMLRead.GetXmlToXMLTabl(JTSYQCustom.DangZhongDi_Reflect); XMLTable xmlTable = ClazzDic[1]; IWorkbook workbook = ExcelRead.ReadExcel(JTSYQCustom.DangZhongDi); ISheet sheet = workbook.GetSheetAt(0); //行数据插入 IList <JTSYQ> list = new List <JTSYQ>(); list.Add(jtsyqGroup); double area = jtsyqGroup.Area; jtsyqGroup.Area = jtsyqGroup.Area * 10000; ExcelWrite.WriteObjects(sheet, xmlTable, list); ExcelWrite.Save(workbook, saveDir + "//" + jtsyqGroup.BM + ".xls"); jtsyqGroup.Area = area; }
private IList <JZD> ExtractJzd(JTSYQ dk, IFeatureLayer dkLayer, IFeatureLayer jzdLayer) { IFeature feature = dk.Feature; IPolygon polygon = feature.Shape as IPolygon; IPointCollection pointCollection = polygon as IPointCollection; IList <JZD> list = new List <JZD>(); int num = pointCollection.PointCount - 2; IPoint point = new PointClass(); point.X = 0.0; point.Y = 0.0; IList <JTSYQ> list2 = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(num), dkLayer)); IList <JTSYQ> list3 = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(0), dkLayer)); IList <JTSYQ> entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(1), dkLayer)); for (int i = 0; i <= num; i++) { IPoint point2 = pointCollection.get_Point(i); int num2 = list3.Count <JTSYQ>(); bool flag2 = num2 > list2.Count || num2 > entity.Count; if (flag2) { JZD JZD = new JZD(); JZD.JZDIndex = i; JZD.Point = point2; list.Add(JZD); point = point2; } else { bool flag3 = num2 != 1 && this.DifferentDks(list3, list2); if (flag3) { JZD JZD = new JZD(); JZD.JZDIndex = i; JZD.Point = point2; list.Add(JZD); point = point2; } else { double num3 = ArcGisUtils.CalculateTwoPt(point2, point); bool flag4 = i == 0; double num4 = -1; if (flag4) { num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(num), pointCollection.get_Point(1)); } else { bool flag5 = i == num; if (flag5) { num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(i - 1), pointCollection.get_Point(0)); double num5 = ArcGisUtils.CalculateTwoPt(point2, pointCollection.get_Point(0)); bool flag6 = num5 < num3; if (flag6) { num3 = num5; } } else { num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(i - 1), pointCollection.get_Point(i + 1)); } } bool flag7 = num4 < 150; if (flag7) { bool flag8 = num4 <130.0 || num3> 2.0; if (flag8) { //检查与上一个 int count = list.Count - 1; if (count >= 0) { double di = ArcGisUtils.CalculateTwoPt(point2, list[count].Point); if (di > 1) { //有上一个点的话,要大于50距离才增加 JZD JZD = new JZD(); JZD.JZDIndex = i; JZD.Point = point2; list.Add(JZD); point = point2; } } else { JZD JZD = new JZD(); JZD.JZDIndex = i; JZD.Point = point2; list.Add(JZD); point = point2; } } else { IList <IFeature> featureCursor = ArcGisUtils.CircleSelect(point2, jzdLayer); if (Utils.CheckListExists(featureCursor)) { JZD JZD = new JZD(); JZD.JZDIndex = i; JZD.Point = point2; list.Add(JZD); point = point2; } } } } } list2 = list3; list3 = entity; bool flag10 = i != num; if (flag10) { entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(i + 2), dkLayer)); } else { entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(0), dkLayer)); } } return(list); }
public void ExportZu_ZhongDiTu(JTSYQ jtsyqGroup, string saveDir) { IList <JZX> jzxs = JZXCustom.SetJZX(jtsyqGroup.GroupJTSYQ); string mxdPath = saveDir + "\\" + System.IO.Path.GetFileName(JTSYQCustom.JTSYQZDTMxd); string mdbPath = saveDir + "\\" + System.IO.Path.GetFileName(JTSYQCustom.JTSYQZDTMdb); //1、复制maxd FileUtils.CopyFile(JTSYQCustom.JTSYQZDTMxd, mxdPath); //2、复制数据库 FileUtils.CopyFile(JTSYQCustom.JTSYQZDTMdb, mdbPath); //打开工作文件 MapDocumentClass mapDocument = new MapDocumentClass(); mapDocument.Open(mxdPath, ""); AxMapControl mapControl = ArcGisUtils.axMapControl; IMap map = mapDocument.Map[0]; mapControl.Map = map; //3、设置数据源,数据源是相对路径,不需要设置 //4、复制shap JTSYQCustom.SaveMap(jtsyqGroup.GroupJTSYQ); JTSYQCustom.SaveJTSYQBZMap(map, jtsyqGroup.GroupJTSYQ); IList <JZD> jzds = JZDCustom.SaveMap(jtsyqGroup); JZXCustom.SaveJZXMap(jzxs); JZXCustom.SaveJZXBZMap(map, jzxs); JZDCustom.SaveJZDBZMap(map, jzds); double scale = 100.0; mapControl.Extent = JTSYQCustom.SetExtent(jtsyqGroup.GroupJTSYQ); double num = (double)((int)((map.MapScale + 30.0) / scale) * scale + scale); //mapControl.MapScale = 329; ArcGisUtils.ChangeMapScale(mapDocument, num); //5、替换文字内容, int index = 0; for (int a = 0; a > -1; a++) { string tufu = jtsyqGroup.TuFu; if (Utils.IsStrNull(tufu)) { MessageBox.Show("你还没有生成图幅号!!!:" + jtsyqGroup.QLR); ArcGisUtils.Refresh(); return; } index = tufu.IndexOf("、", index + 1); if (index == -1) { break; } if (a % 2 != 0) { jtsyqGroup.TuFu = tufu.Insert(index + 1, "\n"); } } Dictionary <string, XMLObject> xmlObjectDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true); XMLObject xmlObject = new XMLObject { Column = "BLC", Deafult = "1:" + num }; xmlObjectDic.Add("BLC", xmlObject); ArcGisService.ReplaceText(jtsyqGroup, xmlObjectDic, mapDocument); //使用的xml缓存,必须移除 xmlObjectDic.Remove("BLC"); //6、工程文件保留 mapDocument.Save(); mapDocument.Close(); ArcGisUtils.Refresh(); }