jzccontrol.java

来自「基于Java的地图数据管理软件。使用MySQL数据库管理系统。」· Java 代码 · 共 430 行 · 第 1/2 页

JAVA
430
字号
package net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.array;

import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.txt.Jzcjbqk;
import java.util.Vector;
import net.aetherial.gis.table.WuWei;
import net.aetherial.gis.publicuse.StringOper;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.excel.ReadAdder;
import net.aetherial.gis.jiaotongbu.output.type.Jianzhicun;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Enumeration;
import net.aetherial.gis.surface.ItemValue;
import org.w3c.dom.Node;
import java.io.PrintStream;
import net.aetherial.gis.jiaotongbu.output.publicuse.Item;
import java.io.*;


/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class JZCControl {

  protected XiangzhenJzcjbqk[] jzctb = null;
  /**
   * 新的Jzcjbqk数组
   */
  protected Vector newjzc = new Vector();
  /**
   * array的{乡镇,村}数组,以民政部门为标准
   */
  private XiangzhenXZC[] arrayMinzheng = null;

  private  WuWei ww = new WuWei();
//  private  Hashtable xzcWayPointHash = new Hashtable();

  private ReadAdder adder = null;
  public JZCControl() {
    this.setwwArray();
String name;
//    Node[] xzcWayPoint = ItemValue.getXingZCInWaypoint(ItemValue.getWaypoint());
//    for(int i = 0; xzcWayPoint != null && i < xzcWayPoint.length; i++){
//
//      name = ItemValue.getWaypointName(xzcWayPoint[i]);
//
//      String xz = ItemValue.getTracksT3(ItemValue.getWaypointHisTrack(xzcWayPoint[i]));
////System.out.print("发现行政村:" + xz + "-" + name);
//      for(int j = 0; j<ww.wuwei_cun.length; j++){
//        String shortName = ww.wuwei_cun[j].length() < 2 ? ww.wuwei_cun[j] :
//                ww.wuwei_cun[j].replaceAll("社区", "").
//                replaceAll("社居委", "").
//                replaceAll("街道", "").
//                replaceAll("村支部", "").
//                replaceAll("村委会", "").
//                replaceAll("村", "").
//          replaceAll("居委会", "");
//
////        if(xz == null || xz.length() < 2 || StringOper.isInclude(xz, ww.wuchen_xiangzhen[j].replaceAll("镇", "").
////                                     replaceAll("乡", ""))){
//          if (StringOper.isInclude(name, shortName)) {
//            String pos = ItemValue.getWaypointX(xzcWayPoint[i]) + "|" +
//                  ItemValue.getWaypointY(xzcWayPoint[i]);
//
////              System.out.println("添加 "+ww.wuwei_cun[j]+" 进哈西表");
//              xzcWayPointHash.put(ww.wuwei_cun[j], pos);
//
//
//            break;
//          }
////        }
//      }
////      System.out.println();
//
//
//    }
//   xzcWayPoint = null;


  }

  public void setReadAdder(ReadAdder adder){
    this.adder = adder;
  }

  public void setJZCExcelArrayFile(Jzcjbqk[] jzc) {
    try {
      boolean tempFind = false;
      java.io.PrintStream bo = new PrintStream(new java.io.FileOutputStream(new
          java.io.File(ItemValue.getArrayPath().substring(0,ItemValue.getArrayPath().lastIndexOf("\\array")+1)+"\\部接口\\未找到的建制村.txt")));
      bo.println("" + Item.shiName + " " + Item.xianName);
      for (int i = 0; i < ww.wuwei_cun.length; i++) {
        if ("社居委|社区|居委会|村委会|村委|行政村|乡|镇|县|市".indexOf(ww.wuwei_cun[i]) < 0) {
          tempFind = false;
          String shortName = ww.wuwei_cun[i].length() < 3 ? ww.wuwei_cun[i] :
              ww.wuwei_cun[i].replaceAll("社区", "").
              replaceAll("社居委", "").
              replaceAll("街道", "").
              replaceAll("村支部", "").
              replaceAll("村委会", "").
              replaceAll("村", "").
              replaceAll("居委会", "");
          for (int j = 0; jzc != null && j < jzc.length; j++) {

            if (jzc[j] != null) {
              String shortXZMingChen = ww.wuchen_xiangzhen[i].replaceAll(
                "镇", "").replaceAll("乡", "").replaceAll("办事处", "").replaceAll("街道", "");

              if (jzc[j].getXiangzhen_Name().replaceAll(
                "镇", "").replaceAll("乡", "").replaceAll("办事处", "").replaceAll("街道", "").equals(shortXZMingChen)&&
                  jzc[j].getJianzhicunName().replaceAll("社区", "").
              replaceAll("社居委", "").
              replaceAll("街道", "").
              replaceAll("村支部", "").
              replaceAll("村委会", "").
              replaceAll("村", "").
              replaceAll("居委会", "")
.equals(shortName)) {
//                if (ww.wuwei_cun[i].indexOf("居委会") > -1) {
                  jzc[j].set0_2ColumnName(ww.wuwei_cun[i]);
//                }
                jzc[j].set3_4ColumnXiangzhenName(ww.wuchen_xiangzhen[i]);
                newjzc.add(jzc[j]);
                tempFind = true;
                break;
              }
            }
          }
          if (!tempFind){
            for (int j = 0; jzc != null && j < jzc.length; j++) {

              if (jzc[j] != null) {
                String shortXZMingChen = ww.wuchen_xiangzhen[i].replaceAll(
                    "镇", "").replaceAll("乡", "").replaceAll("办事处", "").
                    replaceAll("街道", "");

                if (jzc[j].getXiangzhen_Name().replaceAll("乡", "").replaceAll("办事处", "").
                    replaceAll("街道", "").equals(shortXZMingChen) &&
                    jzc[j].getJianzhicunName().indexOf(shortName) == 0) {
//                if (ww.wuwei_cun[i].indexOf("居委会") > -1) {
                  jzc[j].set0_2ColumnName(ww.wuwei_cun[i]);
//                }
                  jzc[j].set3_4ColumnXiangzhenName(ww.wuchen_xiangzhen[i]);
                  newjzc.add(jzc[j]);
                  tempFind = true;
                  break;
                }
              }
            }
          }
                    if (!tempFind){
                      for (int j = 0; jzc != null && j < jzc.length; j++) {

                        if (jzc[j] != null) {
                          String shortXZMingChen = ww.wuchen_xiangzhen[i].
                              replaceAll(
                                  "镇", "").replaceAll("乡", "").replaceAll("办事处",
                              "").replaceAll("街道", "");

                          if (jzc[j].getXiangzhen_Name().indexOf(
                              shortXZMingChen) == 0 &&
                              jzc[j].getJianzhicunName().equals(shortName)) {
//                if (ww.wuwei_cun[i].indexOf("居委会") > -1) {
                            jzc[j].set0_2ColumnName(ww.wuwei_cun[i]);
//                }
                            jzc[j].set3_4ColumnXiangzhenName(ww.
                                wuchen_xiangzhen[i]);
                            newjzc.add(jzc[j]);
                            tempFind = true;
                            break;
                          }
                        }
                      }
                    }
                          if (!tempFind){
                            for (int j = 0; jzc != null && j < jzc.length; j++) {

                              if (jzc[j] != null) {
                                String shortXZMingChen = ww.wuchen_xiangzhen[i].
                                    replaceAll(
                                        "镇", "").replaceAll("乡",
                                    "").replaceAll("办事处", "").replaceAll("街道",
                                    "");

                                if (jzc[j].getXiangzhen_Name().indexOf(
                                    shortXZMingChen) == 0 &&
                                    jzc[j].getJianzhicunName().indexOf(
                                    shortName) == 0) {
//                if (ww.wuwei_cun[i].indexOf("居委会") > -1) {
                                  jzc[j].set0_2ColumnName(ww.wuwei_cun[i]);
//                }
                                  jzc[j].set3_4ColumnXiangzhenName(ww.
                                      wuchen_xiangzhen[i]);
                                  newjzc.add(jzc[j]);
                                  tempFind = true;
                                  break;
                                }
                              }
                            }
                          }
          if (!tempFind) {

//          System.out.println("添加: " + ww.wuwei_cun[i]);
            Jzcjbqk temp = new Jzcjbqk();
            temp.set0_1ColumnNumber("");
            temp.set0_2ColumnName(ww.wuwei_cun[i]);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?