📄 reqiaoliang.java
字号:
package net.aetherial.gis.jiaotongbu.output.tocheck.type;
import net.aetherial.gis.jiaotongbu.output.type.Qiaoliang;
import org.w3c.dom.Node;
import java.util.Vector;
import net.aetherial.gis.jiaotongbu.output.tocheck.PermanenceBubao;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.jiaotongbu.output.publicuse.Item;
import net.aetherial.gis.publicuse.wpt.WPTsTrack;
import java.text.DecimalFormat;
import net.aetherial.gis.publicuse.wpt.getWptZhuanghao;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ReQiaoliang
extends Qiaoliang {
private static boolean isNewCreate = true;
public static void reCreate(){
isNewCreate = false;
}
public ReQiaoliang(Node wpt) {
super(wpt);
}
private String getRefZhuanghao(){
getWptZhuanghao getzhuanghao = new getWptZhuanghao();
getzhuanghao.setWaypoint(this.wpt);
getzhuanghao.setTrack(this.hisTrack);
return getzhuanghao.getWaypointZhuanghao();
}
private String getZhuanghaoIfNotExist(){
if (this.zhuanghao.trim().equals("")) {
return this.getRefZhuanghao();
}else{
return this.zhuanghao.trim();
}
}
private String getQlBianma(BubaoQIaoliang ql) throws Exception {
// this.getTrackName();
if (ql == null && hisTrack != null) {
return ItemValue.getTracksNumber(hisTrack).toUpperCase() +
Item.getSix_6_XianNumber() +
"L0010";
}
if (ql == null && hisTrack == null) {
Node[] trks = WPTsTrack.getWptNearTrack(wpt);
if (trks != null && trks.length != 0) {
return ItemValue.getTracksNumber(trks[0]).toUpperCase() +
Item.getSix_6_XianNumber() +
"L0010";
}
else {
throw new Exception("航点:" + this.getName() + "没有航迹。");
}
}
if (ql != null && hisTrack == null) {
return ql.getBianma();
}
else if (ql.getBianma().equals("")) {
return ItemValue.getTracksNumber(hisTrack).toUpperCase() +
Item.getSix_6_XianNumber() +
"L0010";
}
else {
try {
return ItemValue.getTracksNumber(hisTrack).toUpperCase() +
Item.getSix_6_XianNumber() +
ql.getBianma().substring(ql.getBianma().length() - 5,
ql.getBianma().length());
}
catch (Exception ex) {
return ql.getBianma();
}
}
}
private String getLXbianma(String qlBianma) {
if (qlBianma.equals("")) {
return "";
}
else {
try {
return qlBianma.substring(0, 10);
}
catch (Exception ex) {
return "";
}
}
}
private String getLXName(String qlBianma) {
if (qlBianma.equals("")) {
return "";
}
else {
try {
return qlBianma.substring(0, 4).toUpperCase();
}
catch (Exception ex) {
return "";
}
}
}
public String getQiaoliangValue() throws Exception {
String n = "";
Vector bubaoQiaoliang = PermanenceBubao.qiaoliang;
BubaoQIaoliang ql = null;
String qlBianma = "";
this.setValue();
System.out.println("this.isGPSDataHaveFillValue():" + this.isGPSDataHaveFillValue() + "," + this.getName());
// if (!this.isGPSDataHaveFillValue()) {
if (!this.isGPSDataHaveFillValue() || this.isNewCreate) {
/**
* 按照补报表格填补数据
*/
for (int i = 0; i < bubaoQiaoliang.size(); i++) {
ql = (BubaoQIaoliang) bubaoQiaoliang.get(i);
if (ql.isXYZInThis(this.getLongitudeX(), this.getLatitudeY())) {
qlBianma = this.getQlBianma(ql);
n = n + "GPS测量\t" + this.getLXbianma(qlBianma) + "\t" +
this.getLXName(qlBianma) + "\t" + qlBianma +
"\t" +
ql.getMingcheng() + "\t" + this.getRefZhuanghao() + "\t \t" +
ql.getKuadu() + "\t" + ql.getKuajinfenlei() + "\t" +
ql.getJianzhucailiao() + "\t" + ql.getShejihezai() + "\t" +
ql.getKongshu() + "\t" + ql.getJianchengshijian() + "\t" +
// ql.getJianchengshijian() + "\t" +
ql.getShifouweiqiao() + "\t" + ql.getX() + "\t" + ql.getY();
break;
// if (qlBianma.trim().equals("X047340123014L001")) {
// System.out.println("********************" + ql.getKuadu() + ql.getKuajinfenlei());
// }
}
}
/**
* 按照Gps填写表格
*/
if (n.trim().equals("")) {
java.text.DecimalFormat format = new DecimalFormat("#.#######");
qlBianma = this.getQlBianma(null);
n = n + "GPS测量\t" + this.getLXbianma(qlBianma) + "\t" +
this.getLXName(qlBianma) + "\t" + qlBianma + "\t" +
this.getName() + "\t" + this.getRefZhuanghao() + "\t \t" +
this.kuadu + "\t" + this.getKuajinfenlei() + "\t" +
" " + "\t" + " " + "\t" + " " + "\t" + " " + "\t" +
// " " + "\t" + " " + "\t" + " " + "\t" +
" " + "\t" + format.format(Double.parseDouble(this.getLongitudeX())) +
"\t" + format.format(Double.parseDouble(this.getLatitudeY()));
// if (this.getName().trim().equals("王集大桥")) {
// System.out.println("********************" + this.kuadu + "," +
// this.getKuajinfenlei() + "," +
// format.format(Double.parseDouble(this.getLongitudeX())) +
// "," +
// format.format(Double.parseDouble(this.getLatitudeY())) +
// "," + this.getName());
// }
}
}else{
java.text.DecimalFormat format = new DecimalFormat("#.#######");
qlBianma = this.getQlBianma(null);
n = n + "GPS测量\t" + this.getLXbianma(qlBianma) + "\t" + this.getLXName(qlBianma) + "\t" + this.bianhao + "\t" +
this.getName() + "\t" + this.getZhuanghaoIfNotExist() + "\t" + this.quanchang + "\t" +
this.kuadu + "\t" + this.getKuajinfenlei() + "\t" +
// this.cailiao + "\t" + this.hezai + "\t" + this.kongshu + "\t" + this.shijian + "\t" +
this.cailiao + "\t" + this.hezai + "\t" + this.shijian + "\t" +
this.weiqiao + "\t" + format.format(Double.parseDouble(this.getLongitudeX())) +
"\t" + format.format(Double.parseDouble(this.getLatitudeY()));
}
return n;
}
private String getNewBianma(String key) {
String bianhao = PermanenceBubao.qiaoliangbianhao.get(key) + "";
String temp = bianhao.substring(bianhao.length() - 4, bianhao.length() - 1);
long newBH = Long.parseLong(temp) + 1;
return bianhao.substring(0, bianhao.length() - 4) + newBH;
}
private void addBianmaToPermanence(String key, String qlBianma) {
if (PermanenceBubao.qiaoliangbianhao.get(key).equals(null)) {
PermanenceBubao.qiaoliangbianhao.put(key, qlBianma);
}
else {
String bianhao = PermanenceBubao.qiaoliangbianhao.get(key) + "";
bianhao = bianhao.substring(bianhao.length() - 4, bianhao.length() - 1);
String qlBianmaTemp = qlBianma.substring(qlBianma.length() - 4,
qlBianma.length() - 1);
long oldBH = Long.parseLong(bianhao);
long newBH = Long.parseLong(qlBianmaTemp);
if (newBH > oldBH) {
PermanenceBubao.qiaoliangbianhao.remove(key);
PermanenceBubao.qiaoliangbianhao.put(key, qlBianma);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -