Ejemplo n.º 1
0
        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");
                }
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        public void ExportZu_FaRenDaiBiaoShenFengZhengMing(XZDM xzdm, string saveDir)
        {
            Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true);
            var doc = WordRead.Read(JTSYQCustom.FaRenDaiBiaoShenFengZhengMing);

            WordWrite.ReplaceText(doc, ClazzDic, xzdm);
            WordWrite.SaveToFile(doc, saveDir + "/02法人代表身份证明" + xzdm.Zu + ".doc");
        }
Ejemplo n.º 4
0
        public void ExportCunYiJianFanKuaiShu(XZDM xzdm, string dir)
        {
            Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.FanKuiYiJianShuXMLRelfect, false);
            var doc = WordRead.Read(JTSYQCustom.FanKuiYiJianShu);

            WordWrite.ReplaceText(doc, ClazzDic, xzdm);
            WordWrite.SaveToFile(doc, dir + "//" + System.IO.Path.GetFileName(JTSYQCustom.FanKuiYiJianShu));
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        public void ExportCunJieGuo_GongShi(XZDM xzdm, string dir)
        {
            Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true);
            var doc = WordRead.Read(JTSYQCustom.JieGuo_GongShi);

            xzdm.SetZuMiaoShu();
            WordWrite.ReplaceText(doc, ClazzDic, xzdm);
            WordWrite.SaveToFile(doc, dir + "//" + System.IO.Path.GetFileName(JTSYQCustom.JieGuo_GongShi));
        }
Ejemplo n.º 7
0
        public void ExportZu_FaRenDaiBiaoWeiTuoShu(XZDM xzdm, string saveDir)
        {
            Dictionary <string, XMLObject> ClazzDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true);
            var doc = WordRead.Read(JTSYQCustom.FaRenDaiBiaoWeiTuoShu);

            WordWrite.ReplaceText(doc, ClazzDic, xzdm);
            //查看是村不是组
            WordWrite.SaveToFile(doc, saveDir + "/03法人代表授权委托书" + xzdm.Zu + ".doc");
        }
Ejemplo n.º 8
0
        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");
        }
Ejemplo n.º 9
0
        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");
        }
Ejemplo n.º 10
0
        public void ExportCun_GongShi(IList <JTSYQ> jtsyqs, XZDM xzdm, string dir)
        {
            Dictionary <int, XMLTable> ClazzDic = XMLRead.GetXmlToXMLTabl(JTSYQCustom.Cun_GongGao_Reflect);
            XMLTable  xmlTable = ClazzDic[1];
            IWorkbook workbook = ExcelRead.ReadExcel(JTSYQCustom.Cun_GongShi);
            ISheet    sheet    = workbook.GetSheetAt(0);
            //文字替换
            Dictionary <string, XMLObject> xmlobjectDic = XMLRead.XmlToObjects(JTSYQCustom.FanKuiYiJianShuXMLRelfect, false);

            xzdm.JTSYQ_DasTatal = (xzdm.JTSYQ_GSEndTime - xzdm.JTSYQ_GSStartTime).Days;
            ExcelWrite.ReplaceTextByXMLObject(sheet, xzdm, xmlobjectDic);

            //行数据插入
            ExcelWrite.WriteObjects(sheet, xmlTable, jtsyqs);

            ExcelWrite.Save(workbook, dir + "//" + System.IO.Path.GetFileName(JTSYQCustom.Cun_GongShi));
        }
Ejemplo n.º 11
0
        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));
        }
Ejemplo n.º 12
0
Archivo: ZJDDao.cs Proyecto: YB9527/CG
        public void ExportZJD_SMS(JSYD jsyd, string saveDir)
        {
            string       docTempletePath           = JSYDCustom.SMSDocPath;
            XWPFDocument doc                       = WordRead.Read(docTempletePath);
            Dictionary <string, XMLObject> jsydXML = XMLRead.XmlToObjects(JSYDCustom.JSYDXMLPath);

            WordWrite.ReplaceText(doc, jsydXML, jsyd);

            Dictionary <string, XMLObject> xzdmXML = XMLRead.XmlToObjects(JSYDCustom.ZJDXZDMMLPath);

            WordWrite.ReplaceText(doc, xzdmXML, jsyd.ZJDXZDM);

            Dictionary <string, XMLObject> jtcyXML = XMLRead.XmlToObjects(JSYDCustom.JTCYXMLPath);

            WordWrite.ReplaceText(doc, jtcyXML, jsyd.HZs[0]);

            IList <JTCY>  jTCies = jsyd.HZs[0].JTCies;
            StringBuilder sb     = new StringBuilder();

            for (int a = 0; a < jTCies.Count; a++)
            {
                JTCY jtcy = jTCies[a];
                if (a % 2 == 0)
                {
                    sb.Append(jtcy.XM + "(" + jtcy.GMSFHM + ")、");
                }
                else
                {
                    sb.Append(jtcy.XM + "(" + jtcy.GMSFHM + ")、\r\n");
                }
            }
            sb.Remove(sb.Length - 1, 1);
            Dictionary <string, string> replaceDic = new Dictionary <string, string>();

            replaceDic.Add("JTCYCount", jsyd.HZs[0].JTCies.Count + "");
            replaceDic.Add("Jtcy", sb.ToString());
            WordWrite.ReplaceText(doc, replaceDic);

            string saveName = GetZJDSaveFileName(jsyd, saveDir, docTempletePath);

            WordWrite.SaveToFile(doc, saveName);
        }
Ejemplo n.º 13
0
        public static IList <T> ToObject <T>(IList <JObject> jObjects, string xmlPath)
        {
            IList <T> list = new List <T>();
            Dictionary <string, Clazz> clazzDic = ReflectUtils.MethodToFunction <T>();

            /*Dictionary<string, string> xmlDic = XMLRead.GetConfigXmlDic(xmlPath, "property", "name", "column");
             *
             * Dictionary<string, Clazz> dic = ReflectUtils.ReplaceString(xmlDic, clazzDic);
             * foreach(JObject jObject in jObjects)
             * {
             *  list.Add(ToObject<T>(jObject,dic));
             * }*/
            Dictionary <string, XMLObject> xmlObject = XMLRead.XmlToObjects(xmlPath);

            foreach (JObject jObject in jObjects)
            {
                list.Add(ToObject <T>(jObject, xmlObject));
            }
            return(list);
        }
Ejemplo n.º 14
0
Archivo: ZJDDao.cs Proyecto: YB9527/CG
        public void ExportZJD_DangAnDai(JSYD jsyd, string saveDir)
        {
            string docTempletePath = JSYDCustom.DanAnDaiDocPath;

            XWPFDocument doc = WordRead.Read(docTempletePath);
            Dictionary <string, XMLObject> jsydXML = XMLRead.XmlToObjects(JSYDCustom.JSYDXMLPath);

            WordWrite.ReplaceText(doc, jsydXML, jsyd);

            Dictionary <string, XMLObject> xzdmXML = XMLRead.XmlToObjects(JSYDCustom.ZJDXZDMMLPath);

            WordWrite.ReplaceText(doc, xzdmXML, jsyd.ZJDXZDM);

            Dictionary <string, XMLObject> jtcyXML = XMLRead.XmlToObjects(JSYDCustom.JTCYXMLPath);

            WordWrite.ReplaceText(doc, jtcyXML, jsyd.HZs[0]);



            Dictionary <string, IList <RunCustomer> > docDic = WordRead.GetDocxDic(doc);
            IList <RunCustomer> runCustomers;
            NF nf = jsyd.NFs[0];

            //土地证位置是第一个
            if (nf.YJTTDSYZ.Equals("遗失/灭失"))
            {
                if (docDic.TryGetValue("遗失声明", out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[0]);
                }
                if (docDic.TryGetValue("土地登记档案", out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[0]);
                }
            }
            else
            {
                if (docDic.TryGetValue(nf.YJTTDSYZ, out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[0]);
                }
            }
            //房屋来源
            if (nf.YFWSYQZ.Equals("遗失/灭失"))
            {
                if (docDic.TryGetValue("遗失声明", out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[1]);
                }
                if (docDic.TryGetValue("房屋登记档案", out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[0]);
                }
            }
            else
            {
                if (docDic.TryGetValue(nf.YFWSYQZ, out runCustomers))
                {
                    WordWrite.ReplaceSmpbol(runCustomers[1]);
                }
            }
            //房屋来源
            if (docDic.TryGetValue(nf.FWLY, out runCustomers))
            {
                WordWrite.ReplaceSmpbol(runCustomers[0]);
            }


            string saveName = GetZJDSaveFileName(jsyd, saveDir, docTempletePath);

            WordWrite.SaveToFile(doc, saveName);
        }
Ejemplo n.º 15
0
        public static IList <T> ReadAllData <T>(string tableName, string mdbPath, string xmlPath = null)
        {
            Dictionary <string, XMLObject> xmlObjectDic;

            if (Utils.IsStrNull(xmlPath))
            {
                xmlObjectDic = XMLRead.XmlToObjects_get <T>();
            }
            else
            {
                xmlObjectDic = XMLRead.XmlToObjects(xmlPath);
            }


            Type   type     = typeof(T);
            string fullName = type.AssemblyQualifiedName;

            object[] array = new object[1];

            IList <T>       list            = new List <T>();
            string          str             = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdbPath;
            OleDbConnection oleDbConnection = new OleDbConnection(str + ";OLE DB Services=-4");

            oleDbConnection.Open();
            OleDbCommand oleDbCommand = oleDbConnection.CreateCommand();

            oleDbCommand.CommandText = "select * from " + tableName;
            Dictionary <int, string> dictionary      = new Dictionary <int, string>();
            OleDbDataReader          oleDbDataReader = oleDbCommand.ExecuteReader();
            int fieldCount = oleDbDataReader.FieldCount;

            for (int i = 0; i < fieldCount; i++)
            {
                dictionary.Add(i, oleDbDataReader.GetName(i));
            }
            Dictionary <string, Clazz> clazzDic = ReflectUtils.MethodToFunction <T>();
            Clazz             clazz;
            string            title;
            XMLObject         xmlObject;
            IList <XMLObject> defualts = new List <XMLObject>();

            foreach (XMLObject xml in xmlObjectDic.Values)
            {
                if (!Utils.IsStrNull(xml.Deafult))
                {
                    defualts.Add(xml);
                }
            }
            while (oleDbDataReader.Read())
            {
                object obj = Activator.CreateInstance(type);
                for (int j = 0; j < fieldCount; j++)
                {
                    title = oleDbDataReader.GetName(j);
                    if (xmlObjectDic.TryGetValue(title, out xmlObject))
                    {
                        clazz    = clazzDic[xmlObject.Key];
                        array[0] = Utils.GetValueTrueType(oleDbDataReader[j], clazz.getParamterType().Name);

                        if (array[0] == null)
                        {
                            continue;
                        }
                        else
                        {
                            clazz.SetMethodInfo.Invoke(obj, array);
                        }
                    }
                }
                foreach (XMLObject x in defualts)
                {
                    clazz    = clazzDic[x.Column];
                    array[0] = Utils.GetValueTrueType(x.Deafult, clazz.getParamterType().Name);

                    if (array[0] == null)
                    {
                        continue;
                    }
                    else
                    {
                        clazz.SetMethodInfo.Invoke(obj, array);
                    }
                }
                list.Add((T)((object)obj));
            }
            oleDbDataReader.Close();
            oleDbConnection.Close();
            return(list);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 导出 农村土地家庭承包农户基本情况信息表(一)
        /// </summary>
        /// <param name="hzs"></param>
        public static bool ExportBsicInformationExcel(IList <JTCY> hzs, string saveDir)
        {
            Dictionary <string, string> dklbDic = new Dictionary <string, string>();

            dklbDic.Add("10", "承包地");
            dklbDic.Add("21", "自留地");
            dklbDic.Add("22", "机动地");
            dklbDic.Add("23", "开荒地");
            dklbDic.Add("99", "其他集体土地");


            if (Utils.IsStrNull(saveDir))
            {
                return(false);
            }
            string basicInformationExxcelTemplete       = System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\农村土地家庭承包农户基本情况信息表(一)模板.xls";
            Dictionary <int, XMLTable>     ClazzDic     = XMLRead.GetXmlToXMLTabl(System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\WriteJTCYBaicInformationExcel.xml");
            Dictionary <string, XMLObject> xmlObjectDic = XMLRead.XmlToObjects(System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\WriteJTCYBaicInformationExcel.xml");



            string basicInformationExxcelTemplete2       = System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\农村土地承包经营权(家庭承包)台帐(二)模板.xls";
            Dictionary <int, XMLTable>     ClazzDic2     = XMLRead.GetXmlToXMLTabl(System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\WriteDKBaicInformationExcel.xml");
            Dictionary <string, XMLObject> xmlObjectDic2 = XMLRead.XmlToObjects(System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\WriteDKBaicInformationExcel.xml");


            string cbfbm;

            if (Utils.CheckListExists(hzs))
            {
                DMToText(hzs);
                foreach (JTCY hz in hzs)
                {
                    string cbfdz = hz.DZ;
                    if (!cbfdz.EndsWith("组"))
                    {
                        cbfdz = cbfdz.Substring(0, cbfdz.LastIndexOf("组")) + "组";
                    }
                    int index = cbfdz.IndexOf("镇");
                    if (index == -1)
                    {
                        index = cbfdz.IndexOf("乡");
                    }
                    hz.DZ = cbfdz.Substring(index + 1, cbfdz.Length - index - 1);
                    XMLTable  xmlTable = ClazzDic[0];
                    IWorkbook workbook = ExcelRead.ReadExcel(basicInformationExxcelTemplete);
                    ISheet    sheet    = workbook.GetSheetAt(0);
                    //家庭成员表行数据插入
                    ExcelWrite.WriteObjects(sheet, xmlTable, hz.jTCies);
                    //家庭成员表 文字替换
                    ExcelWrite.ReplaceTextByXMLObject(sheet, hz, xmlObjectDic);
                    ExcelWrite.Save(workbook, saveDir + "//TZ-" + hz.CBFBM.Substring(0, 14) + " " + cbfdz + "\\TZ4 -" + hz.CBFBM + "-1农村土地家庭承包农户基本情况信息表(一).xls");

                    //写地块表
                    Dictionary <string, string> tdlylxDic = ExcelRead.ReadExcelToDic(System.AppDomain.CurrentDomain.BaseDirectory + "CBDTemplete\\土地利用类型映射表.xlsx", 0);
                    IList <DK> dks = hz.DKs;
                    if (dks == null)
                    {
                        continue;
                    }
                    foreach (DK dk in dks)
                    {
                        if (dk.DKLB == "21")
                        {
                            dk.ZLDMJ = Math.Round(dk.HTMJ, 2).ToString("f2");
                        }
                        else
                        {
                            dk.ELCBMJ = Math.Round(dk.HTMJ, 2).ToString("f2");
                        }


                        string dklb = dk.DKLB;
                        if (dklb != null)
                        {
                            if (dklbDic.TryGetValue(dklb, out dklb))
                            {
                                //地块类别无法识别的情况
                                dk.DKLB = dklb;
                            }
                        }
                        string tdlylx = dk.TDLYLX;
                        if (tdlylx != null)
                        {
                            if (tdlylxDic.TryGetValue(tdlylx, out tdlylx))
                            {
                                dk.TDLYLX = tdlylx;
                            }
                        }
                    }
                    IWorkbook workbook2 = ExcelRead.ReadExcel(basicInformationExxcelTemplete2);
                    ISheet    sheet2    = workbook2.GetSheetAt(0);
                    ExcelWrite.ReplaceTextByXMLObject(sheet2, hz, xmlObjectDic);
                    ExcelWrite.WriteObjects(sheet2, ClazzDic2[0], hz.DKs);


                    for (int a = 0; a < dks.Count; a++)
                    {
                        IRow row = sheet.GetRow(a + 5);
                    }

                    ExcelWrite.Save(workbook2, saveDir + "//TZ-" + hz.CBFBM.Substring(0, 14) + " " + cbfdz + "\\TZ4 -" + hz.CBFBM + "-2农村土地承包经营权(家庭承包)台帐(二).xls");
                }
                return(true);
            }
            return(false);
        }
Ejemplo n.º 17
0
Archivo: ZJDDao.cs Proyecto: YB9527/CG
        public void ExportZJD_QJDCB(JSYD jsyd, string saveDir)
        {
            string       docTempletePath = JSYDCustom.QJDCBDocPath;
            XWPFDocument doc             = WordRead.Read(docTempletePath);

            //写入界址签章表
            IList <QZB> qzbs = jsyd.QZBs;

            WordWrite.SetTableRowObj(doc, qzbs, JZXInfoCustom.qzbReflect);

            //写入标示表
            IList <JZXInfo> jzxinfos = jsyd.JZXInfos;

            JZXInfoCustom.CreateBSB(doc, jzxinfos);



            Dictionary <string, XMLObject> jsydXML = XMLRead.XmlToObjects(JSYDCustom.JSYDXMLPath);

            WordWrite.ReplaceText(doc, jsydXML, jsyd);

            Dictionary <string, XMLObject> xzdmXML = XMLRead.XmlToObjects(JSYDCustom.ZJDXZDMMLPath);

            WordWrite.ReplaceText(doc, xzdmXML, jsyd.ZJDXZDM);

            Dictionary <string, XMLObject> jtcyXML = XMLRead.XmlToObjects(JSYDCustom.JTCYXMLPath);

            WordWrite.ReplaceText(doc, jtcyXML, jsyd.HZs[0]);

            Dictionary <string, XMLObject> nfXML = XMLRead.XmlToObjects(JSYDCustom.NFXMLPath);

            WordWrite.ReplaceText(doc, nfXML, jsyd.NFs[0]);

            Dictionary <string, string> replaceDic = new Dictionary <string, string>();

            replaceDic.Add("Company", "四川旭普信息产业发展有限公司");
            string zdnum = jsyd.ZDNUM;

            replaceDic.Add("Qjbh", zdnum.Substring(6, 3) + "-" + zdnum.Substring(9, 3) + "-" + zdnum.Substring(12, 2) + "-" + zdnum.Substring(14, 5));



            //本宗地已取得原土地使用证: 简镇清集用(1990)字第0304 - 37号; 原房屋所有权证: 简农房权字第1002010383号;
            StringBuilder sb  = new StringBuilder();
            string        str = jsyd.YTDSYZSH;

            if (!Utils.IsStrNull(str))
            {
                sb.Append("原土地使用证:" + str + ";");
            }
            str = jsyd.NFs[0].SYQZH;
            if (!Utils.IsStrNull(str))
            {
                sb.Append("原房屋所有权证:" + str + ";");
            }
            if (sb.Length > 0)
            {
                sb.Insert(0, "本宗地已取得");
            }
            replaceDic.Add("Tag0", sb.ToString());

            WordWrite.ReplaceText(doc, replaceDic);

            string saveName = GetZJDSaveFileName(jsyd, saveDir, docTempletePath);

            WordWrite.SaveToFile(doc, saveName);
        }
Ejemplo n.º 18
0
Archivo: ZJDDao.cs Proyecto: YB9527/CG
        public void ExportZJD_CHBG(JSYD jsyd, string saveDir)
        {
            string       docTempletePath = JSYDCustom.CHBGDocPath;
            XWPFDocument doc             = WordRead.Read(docTempletePath);

            Dictionary <string, XMLObject> xzdmXML = XMLRead.XmlToObjects(JSYDCustom.ZJDXZDMMLPath);

            WordWrite.ReplaceText(doc, xzdmXML, jsyd.ZJDXZDM);

            Dictionary <string, XMLObject> jsydXML = XMLRead.XmlToObjects(JSYDCustom.JSYDXMLPath);

            WordWrite.ReplaceText(doc, jsydXML, jsyd);

            Dictionary <string, XMLObject> jtcyXML = XMLRead.XmlToObjects(JSYDCustom.JTCYXMLPath);

            WordWrite.ReplaceText(doc, jtcyXML, jsyd.HZs[0]);

            Dictionary <string, XMLObject> nfXML = XMLRead.XmlToObjects(JSYDCustom.NFXMLPath);

            WordWrite.ReplaceText(doc, nfXML, jsyd.NFs[0]);

            Dictionary <string, string> replaceDic = new Dictionary <string, string>();

            replaceDic.Add("Company", "四川旭普信息产业发展有限公司");
            string zdnum = jsyd.ZDNUM;

            replaceDic.Add("Qjbh", zdnum.Substring(6, 3) + "-" + zdnum.Substring(9, 3) + "-" + zdnum.Substring(12, 2) + "-" + zdnum.Substring(14, 5));
            foreach (NF nf in jsyd.NFs)
            {
                if (replaceDic.ContainsKey("JZJG"))
                {
                    replaceDic["JZJG"] = replaceDic["JZJG"] + "、" + nf.JG;
                }
                else
                {
                    replaceDic.Add("JZJG", nf.JG);
                }
            }
            StringBuilder sb = new StringBuilder();

            foreach (Floor f in jsyd.Floors)
            {
                sb.Append("S" + f.SZC + " = " + f.CJZMJ + "  平方米    ");
            }
            replaceDic.Add("FCMJ", sb.ToString());

            XMLTable  xmlTable = XMLRead.GetXmlToXMLTabl(JSYDCustom.FloorXMLPath)[0];
            XWPFTable table    = WordWrite.ReplaceTable_Font <Floor>(doc, xmlTable, jsyd.Floors);
            int       rowX     = xmlTable.RowStartIndex + jsyd.Floors.Count;

            while (table.Rows.Count - rowX > 1)
            {
                table.RemoveRow(rowX);
            }


            WordWrite.ReplaceText(doc, replaceDic);
            string saveName = GetZJDSaveFileName(jsyd, saveDir, docTempletePath);

            WordWrite.SaveToFile(doc, saveName);
        }
Ejemplo n.º 19
0
        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();
        }
Ejemplo n.º 20
0
        public void ExportCun_GongShiTuActions(XZDM cunXZDM, string saveDir)
        {
            //IList<JTSYQ> jtsyqs = null;
            //得到所有界址短线
            IList <JZX> jzxs = JZXCustom.SetJZX(cunXZDM.JTSYQS);

            //从中删除本村的界址短线
            for (int a = 0; a < jzxs.Count; a++)
            {
                JZX    jzx = jzxs[a];
                string str = jzx.BM.Substring(0, 12);
                if (str == cunXZDM.DJZQDM)
                {
                    jzxs.RemoveAt(a);
                    a--;
                }
            }

            string mxdPath = saveDir + "\\" + System.IO.Path.GetFileName(JTSYQCustom.JTSYQGSTMxd);
            string mdbPath = saveDir + "\\" + System.IO.Path.GetFileName(JTSYQCustom.JTSYQGSTMDB);

            //1、复制maxd
            FileUtils.CopyFile(JTSYQCustom.JTSYQGSTMxd, 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(cunXZDM.JTSYQS);
            //设置本村的界址点标注
            JTSYQCustom.SaveJTSYQBZMap(map, cunXZDM.JTSYQS);


            JZXCustom.SaveJZXMap(jzxs);
            JZXCustom.SaveJZXBZMap(map, jzxs);

            double scale = 100.0;

            // mapControl.Extent = JTSYQCustom.SetExtent(cunXZDM.JTSYQS);
            ArcGisUtils.axMapControl.Extent = JTSYQCustom.GetLayer().AreaOfInterest;
            double num = (double)((int)((map.MapScale + 30.0) / scale) * scale + scale);

            //mapControl.MapScale = 329;
            ArcGisUtils.ChangeMapScale(mapDocument, num);
            //5、替换文字内容,
            Dictionary <string, XMLObject> xmlObjectDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true);
            XMLObject xmlObject = new XMLObject {
                Column = "BLC", Deafult = "1:" + num
            };

            xmlObjectDic.Add("BLC", xmlObject);
            ArcGisService.ReplaceText(cunXZDM, xmlObjectDic, mapDocument);
            //使用的xml缓存,必须移除
            xmlObjectDic.Remove("BLC");
            //6、工程文件保留
            mapDocument.Save();
            mapDocument.Close();
            ArcGisUtils.Refresh();
        }
Ejemplo n.º 21
0
Archivo: ZJDDao.cs Proyecto: YB9527/CG
        public void ExportZJD_SPB(JSYD jsyd, string saveDir)
        {
            string       docTempletePath = JSYDCustom.SPBDocPath;
            XWPFDocument doc             = WordRead.Read(docTempletePath);

            Dictionary <string, XMLObject> jsydXML = XMLRead.XmlToObjects(JSYDCustom.JSYDXMLPath);

            WordWrite.ReplaceText(doc, jsydXML, jsyd);

            Dictionary <string, XMLObject> xzdmXML = XMLRead.XmlToObjects(JSYDCustom.ZJDXZDMMLPath);

            WordWrite.ReplaceText(doc, xzdmXML, jsyd.ZJDXZDM);

            Dictionary <string, XMLObject> jtcyXML = XMLRead.XmlToObjects(JSYDCustom.JTCYXMLPath);

            WordWrite.ReplaceText(doc, jtcyXML, jsyd.HZs[0]);

            Dictionary <string, XMLObject> nfXML = XMLRead.XmlToObjects(JSYDCustom.NFXMLPath);

            WordWrite.ReplaceText(doc, nfXML, jsyd.NFs[0]);


            Dictionary <string, string> replaceDic = new Dictionary <string, string>();

            replaceDic.Add("JTCYCount", jsyd.HZs[0].JTCies.Count + "");
            replaceDic.Add("JTCYs", JTCYCustom.ToStringJTCYs(jsyd.HZs[0]));
            WordWrite.ReplaceText(doc, replaceDic);

            //替换符号
            Dictionary <String, IList <RunCustomer> > docDic = WordRead.GetDocxDic(doc);
            IList <RunCustomer> customers;

            //房屋来源
            if (docDic.TryGetValue(jsyd.NFs[0].FWLY, out customers))
            {
                WordWrite.ReplaceSmpbol(customers[0]);
            }

            //土地证位置是第一个

            if (docDic.TryGetValue(jsyd.NFs[0].YJTTDSYZ, out customers))
            {
                WordWrite.ReplaceSmpbol(customers[0]);
            }
            //房产证位置是第二个
            if (docDic.TryGetValue(jsyd.NFs[0].YFWSYQZ, out customers))
            {
                WordWrite.ReplaceSmpbol(customers[1]);
            }
            if (jsyd.GYFS == "共同共有")
            {
                if (docDic.TryGetValue("是", out customers))
                {
                    WordWrite.ReplaceSmpbol(customers[1]);
                }
                if (docDic.TryGetValue("共同共有", out customers))
                {
                    WordWrite.ReplaceSmpbol(customers[0]);
                }
            }
            else
            {
                if (docDic.TryGetValue("否", out customers))
                {
                    WordWrite.ReplaceSmpbol(customers[1]);
                }
            }



            string saveName = GetZJDSaveFileName(jsyd, saveDir, docTempletePath);

            WordWrite.SaveToFile(doc, saveName);
        }