📄 checkdata.java
字号:
package com.tongtu.comm.checkData;
import java.io.File;
import java.util.List;
import org.w3c.dom.Node;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.output.toLd.OpenDirectory;
import net.aetherial.gis.surface.ItemValue;
import com.tongtu.Dao.plan.PlanDAO;
import com.tongtu.Dao.plan.planDao.PlanDAOImpl;
import com.tongtu.Dao.role.RoleDAO;
import com.tongtu.Dao.role.roleDao.RoleDAOImpl;
import com.tongtu.comm.loadData.FileOperate;
import com.tongtu.util.City;
import com.tongtu.util.PlanDetail;
import com.tongtu.util.Village;
public class CheckData {
public void CheckVillage(){
RoleDAO roleDao = new RoleDAOImpl();
PlanDAO planDao = new PlanDAOImpl();
FileOperate fo = new FileOperate();
List villageList = roleDao.getVillageListByCode("3401");
String villageName ;
String villageCode ;
String cityName ;
String countyName;
String rowStr = "";
String content = "市\t县\t乡镇\t建制村名称\n";
PlanDetail gtpd = new PlanDetail();
PlanDetail fgtpd = new PlanDetail();
Village village = new Village();
for (int i = 0; i < villageList.size();i++){
village = (Village)villageList.get(i);
villageCode = village.getVillageCode();
villageName = village.getVillageName();
gtpd = planDao.getPlanInfoByVillageName(villageCode.substring(0,6), 1, villageName);//查询沟通
if (gtpd == null){
fgtpd = planDao.getPlanInfoByVillageName(villageCode.substring(0,6), 2, villageName); //查询非沟通
if (fgtpd == null){
cityName = City.getCityNameByNum(villageCode.substring(0,4)+"00000000");
countyName = City.getCountyName(villageCode.substring(0,6)+"000000");
String townName = roleDao.getTownName(villageCode.substring(0,9)+"000");
rowStr = cityName + "\t" + countyName + "\t" + townName + "\t" + villageName+"\n";
content += rowStr;
}
}
}
fo.newFile("d:\\村村通数据检查结果\\查询建制村\\找不到的建制村(合肥市).txt", content);
}
//获取所有村道GPS文件
public File[] getAllGSFiles(String filePath) {
OpenDirectory od = new OpenDirectory();
od.setGradeStr("乡村");
File[] allFiles = od.getOpenFile(filePath);// 读取所有乡村道GPS文件
return allFiles;
}
//获取一个县下面的乡村道航迹
public Node[] getAllTrack(File[] files){
FrameOur fo = new FrameOur();
ItemValue.setShowDialogMessage(false);
Node[] allTrack = null;
File file ;
for (int i = 0; i < files.length;i++){
file = files[i];
fo.openFile(file);
}
allTrack = ItemValue.getTracks();
return allTrack;
}
//根据建制村名称查询已经达标的航迹
public Node getDBTrack(Node[] allTrack,String cunName){
String lm = "";
String keyName = "";
Node dbTrack = null ;
for (int j = 0; allTrack!=null&& j < allTrack.length;j++){
lm = ItemValue.getTracksType(allTrack[j]);
Node[] pointNodes = ItemValue.getTracksWaypoint(allTrack[j]);
for (int k = 0; pointNodes!= null&&k<pointNodes.length;k++){
keyName = ItemValue.getWaypointName(pointNodes[k]);
if (keyName.equals(cunName)){
dbTrack = allTrack[j];
//返回航迹名称,里程数等.
}
}
}
return dbTrack;
}
public void SelectTrack(File[] files){
FrameOur fo = new FrameOur();
ItemValue.setShowDialogMessage(false);
File file ;
String lm = "";
String keyName = "";
Node[] allTrack = null;
for (int i = 0; i < files.length;i++){
file = files[i];
fo.openFile(file);
allTrack = ItemValue.getTracks();
for (int j = 0; j < allTrack.length;j++){
lm = ItemValue.getTracksType(allTrack[j]);
Node[] pointNodes = ItemValue.getTracksWaypoint(allTrack[j]);
for (int k = 0; pointNodes!= null&&k<pointNodes.length;k++){
keyName = ItemValue.getWaypointName(pointNodes[k]);
if (keyName.equals("三合村委会")){
//返回航迹名称,里程数等.
}
}
}
fo.reset();
}
}
public static void main(String[] args){
CheckData cd = new CheckData();
cd.CheckVillage();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -