|
|
@@ -16,7 +16,8 @@ import com.common.data.TextUtil;
|
|
|
public class BusinessTravel {
|
|
|
public static final int TITLE = 1;
|
|
|
public static final int AIR = 2;
|
|
|
- public static final int HOTEL = 3;
|
|
|
+ public static final int TRAIN = 3;
|
|
|
+ public static final int HOTEL = 4;
|
|
|
private boolean expand;
|
|
|
private int id;//明细id
|
|
|
private int type;
|
|
|
@@ -37,38 +38,57 @@ public class BusinessTravel {
|
|
|
private String title;
|
|
|
private String cttpid;
|
|
|
|
|
|
- private String city;
|
|
|
- private String address;
|
|
|
- private String starting;
|
|
|
- private String destination;
|
|
|
-
|
|
|
private String airStarting;
|
|
|
private String airStartingCode;
|
|
|
private String airDestination;
|
|
|
private String airDestinationCode;
|
|
|
+
|
|
|
private String trainStarting;
|
|
|
private String trainStartingCode;
|
|
|
private String trainDestination;
|
|
|
private String trainDestinationCode;
|
|
|
+
|
|
|
private String hotelCity;
|
|
|
private String hotelCityCode;
|
|
|
private String flightCode;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ private String hotelAddress;
|
|
|
|
|
|
public BusinessTravel() {
|
|
|
}
|
|
|
|
|
|
+ public BusinessTravel(String titleCode) {
|
|
|
+ this.type = TITLE;
|
|
|
+ code = titleCode;
|
|
|
+ }
|
|
|
+
|
|
|
public BusinessTravel(String cttpid, JSONObject reimbursement) {
|
|
|
try {
|
|
|
- this.cttpid = cttpid;
|
|
|
- id = JSONUtil.getInt(reimbursement, "FPD_ID");
|
|
|
title = JSONUtil.getText(reimbursement, "FPD_RES_TYPE");
|
|
|
- code = JSONUtil.getText(reimbursement, "FPD_ORDER_CODE");
|
|
|
- starting = JSONUtil.getText(reimbursement, "FPD_STARTING");
|
|
|
- destination = JSONUtil.getText(reimbursement, "FPD_DESTINATION");
|
|
|
+ switch (title) {
|
|
|
+ case "火车票":
|
|
|
+ this.type = TRAIN;
|
|
|
+ trainStarting = JSONUtil.getText(reimbursement, "FPD_TRAIN_STARTING");
|
|
|
+ trainDestination = JSONUtil.getText(reimbursement, "FPD_TRAIN_DESTINATION");
|
|
|
+ trainStartingCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE1");
|
|
|
+ trainDestinationCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE2");
|
|
|
+ break;
|
|
|
+ case "飞机票":
|
|
|
+ this.type = AIR;
|
|
|
+ airStarting = JSONUtil.getText(reimbursement, "FPD_AIR_STARTING");
|
|
|
+ airStartingCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE3");
|
|
|
+ airDestination = JSONUtil.getText(reimbursement, "FPD_AIR_DESTINATION");
|
|
|
+ airDestinationCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE4");
|
|
|
+ break;
|
|
|
+ case "住宿":
|
|
|
+ this.type = HOTEL;
|
|
|
+ hotelCity = JSONUtil.getText(reimbursement, "FPD_HOTEL_CITY");
|
|
|
+ hotelCityCode = JSONUtil.getText(reimbursement, "FPD_CITYCODE5");
|
|
|
+ hotelAddress = JSONUtil.getText(reimbursement, "FPD_HOTEL_ADDRESS");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ this.type = TITLE;
|
|
|
+ }
|
|
|
+ flightCode = JSONUtil.getText(reimbursement, "FPD_FLIGHT_CODE");
|
|
|
startTime = JSONUtil.getLong(reimbursement, "FPD_START_TIME");
|
|
|
endTime = JSONUtil.getLong(reimbursement, "FPD_END_TIME");
|
|
|
status = JSONUtil.getText(reimbursement, "FPD_STATUS");
|
|
|
@@ -77,39 +97,54 @@ public class BusinessTravel {
|
|
|
realFee = JSONUtil.getText(reimbursement, "FPD_REAL_FEE");
|
|
|
expecteFee = JSONUtil.getText(reimbursement, "FPD_EXPECTE_FEE");
|
|
|
level = JSONUtil.getText(reimbursement, "FPD_LEVEL");
|
|
|
- city = JSONUtil.getText(reimbursement, "FPD_CITY");
|
|
|
- address = JSONUtil.getText(reimbursement, "FPD_ADDRESS");
|
|
|
number = JSONUtil.getInt(reimbursement, "FPD_NUMBER");
|
|
|
payType = JSONUtil.getText(reimbursement, "FPD_PAY_TYPE");
|
|
|
businessName = JSONUtil.getText(reimbursement, "FPD_BUSINESS_NAME");
|
|
|
remark = JSONUtil.getText(reimbursement, "FPD_REMARK");
|
|
|
allTime = JSONUtil.getText(reimbursement, "FPD_ALL_TIME");
|
|
|
- if (StringUtil.isEmpty(title)) {
|
|
|
- title = "飞机票";
|
|
|
- }
|
|
|
+ this.cttpid = cttpid;
|
|
|
+ id = JSONUtil.getInt(reimbursement, "FPD_ID");
|
|
|
+ code = JSONUtil.getText(reimbursement, "FPD_ORDER_CODE");
|
|
|
if (TextUtils.isEmpty(allTime)) {
|
|
|
allTime = longTime2Time(endTime - startTime);
|
|
|
}
|
|
|
- switch (title) {
|
|
|
- case "火车票":
|
|
|
- case "飞机票":
|
|
|
- this.type = AIR;
|
|
|
- break;
|
|
|
- case "住宿":
|
|
|
- if (TextUtils.isEmpty(allTime)) {
|
|
|
- allTime = "0天";
|
|
|
- } else {
|
|
|
- allTime += "天";
|
|
|
- }
|
|
|
- this.type = HOTEL;
|
|
|
- break;
|
|
|
- default:
|
|
|
- this.type = TITLE;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public String getProduct() {
|
|
|
+ switch (title) {
|
|
|
+ case "火车票":
|
|
|
+ return "train";
|
|
|
+ case "住宿":
|
|
|
+ return "hotel";
|
|
|
+ case "飞机票":
|
|
|
+ return "air";
|
|
|
+ default:
|
|
|
+ return "center";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getStarting() {
|
|
|
+ return type == AIR ? StringUtil.getMessage(airStarting) : StringUtil.getMessage(trainStarting);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public String getDestination() {
|
|
|
+ return type == AIR ? StringUtil.getMessage(airDestination) : StringUtil.getMessage(trainDestination);
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getDate() {
|
|
|
+ return type == AIR ? (DateFormatUtil.long2Str(endTime, "yyyy-MM-dd")) : (DateFormatUtil.long2Str(startTime, "yyyy-MM-dd") + "-" + DateFormatUtil.long2Str(endTime, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getTitleAndCode() {
|
|
|
+ return title + " " + (StringUtil.isEmpty(code) ? "未订票" : code);
|
|
|
+ }
|
|
|
+
|
|
|
private String longTime2Time(long time) {
|
|
|
long second = time / 1000;
|
|
|
long hh = second / 3600;
|
|
|
@@ -117,219 +152,150 @@ public class BusinessTravel {
|
|
|
return hh + "小时" + mm + "分钟";
|
|
|
}
|
|
|
|
|
|
- public boolean isExpand() {
|
|
|
- return expand;
|
|
|
- }
|
|
|
-
|
|
|
public void setExpand(boolean expand) {
|
|
|
this.expand = expand;
|
|
|
}
|
|
|
|
|
|
- public int getId() {
|
|
|
- return id;
|
|
|
+ public boolean isExpand() {
|
|
|
+ return expand;
|
|
|
}
|
|
|
|
|
|
- public void setId(int id) {
|
|
|
- this.id = id;
|
|
|
+ public int getId() {
|
|
|
+ return id;
|
|
|
}
|
|
|
|
|
|
public int getType() {
|
|
|
return type;
|
|
|
}
|
|
|
|
|
|
- public void setType(int type) {
|
|
|
- this.type = type;
|
|
|
- }
|
|
|
-
|
|
|
- public String getAllTime() {
|
|
|
- return allTime;
|
|
|
- }
|
|
|
-
|
|
|
- public String getCttpid() {
|
|
|
- return StringUtil.isEmpty(cttpid) ? "****" : cttpid;
|
|
|
- }
|
|
|
-
|
|
|
- public void setAllTime(String allTime) {
|
|
|
- this.allTime = allTime;
|
|
|
+ public int getNumber() {
|
|
|
+ return number;
|
|
|
}
|
|
|
|
|
|
public long getStartTime() {
|
|
|
return startTime;
|
|
|
}
|
|
|
|
|
|
- public void setStartTime(long startTime) {
|
|
|
- this.startTime = startTime;
|
|
|
- }
|
|
|
-
|
|
|
public long getEndTime() {
|
|
|
return endTime;
|
|
|
}
|
|
|
|
|
|
- public void setEndTime(long endTime) {
|
|
|
- this.endTime = endTime;
|
|
|
+ public String getAllTime() {
|
|
|
+ return allTime;
|
|
|
}
|
|
|
|
|
|
public String getCode() {
|
|
|
- return code == null ? "" : code;
|
|
|
- }
|
|
|
-
|
|
|
- public void setCode(String code) {
|
|
|
- this.code = code;
|
|
|
- }
|
|
|
-
|
|
|
- public String getStarting() {
|
|
|
- return starting;
|
|
|
- }
|
|
|
-
|
|
|
- public void setStarting(String starting) {
|
|
|
- this.starting = starting;
|
|
|
- }
|
|
|
-
|
|
|
- public String getDestination() {
|
|
|
- return destination;
|
|
|
- }
|
|
|
-
|
|
|
- public void setDestination(String destination) {
|
|
|
- this.destination = destination;
|
|
|
+ return code;
|
|
|
}
|
|
|
|
|
|
public String getStatus() {
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
- public void setStatus(String status) {
|
|
|
- this.status = status;
|
|
|
- }
|
|
|
-
|
|
|
public String getOrderType() {
|
|
|
return orderType;
|
|
|
}
|
|
|
|
|
|
- public void setOrderType(String orderType) {
|
|
|
- this.orderType = orderType;
|
|
|
- }
|
|
|
-
|
|
|
public String getSeat() {
|
|
|
return seat;
|
|
|
}
|
|
|
|
|
|
- public void setSeat(String seat) {
|
|
|
- this.seat = seat;
|
|
|
- }
|
|
|
-
|
|
|
public String getRealFee() {
|
|
|
return realFee;
|
|
|
}
|
|
|
|
|
|
- public void setRealFee(String realFee) {
|
|
|
- this.realFee = realFee;
|
|
|
- }
|
|
|
-
|
|
|
public String getExpecteFee() {
|
|
|
return expecteFee;
|
|
|
}
|
|
|
|
|
|
- public void setExpecteFee(String expecteFee) {
|
|
|
- this.expecteFee = expecteFee;
|
|
|
- }
|
|
|
-
|
|
|
public String getLevel() {
|
|
|
return level;
|
|
|
}
|
|
|
|
|
|
- public void setLevel(String level) {
|
|
|
- this.level = level;
|
|
|
+ public String getPayType() {
|
|
|
+ return payType;
|
|
|
}
|
|
|
|
|
|
- public String getCity() {
|
|
|
- return city;
|
|
|
+ public String getBusinessName() {
|
|
|
+ return businessName;
|
|
|
}
|
|
|
|
|
|
- public void setCity(String city) {
|
|
|
- this.city = city;
|
|
|
+ public String getRemark() {
|
|
|
+ return remark;
|
|
|
}
|
|
|
|
|
|
- public String getAddress() {
|
|
|
- return address == null ? "" : address;
|
|
|
+ public String getTitle() {
|
|
|
+ return title;
|
|
|
}
|
|
|
|
|
|
- public void setAddress(String address) {
|
|
|
- this.address = address;
|
|
|
+ public String getCttpid() {
|
|
|
+ return cttpid;
|
|
|
}
|
|
|
|
|
|
- public String getPayType() {
|
|
|
- return payType;
|
|
|
+ public String getAirStarting() {
|
|
|
+ return airStarting;
|
|
|
}
|
|
|
|
|
|
- public void setPayType(String payType) {
|
|
|
- this.payType = payType;
|
|
|
+ public String getAirStartingCode() {
|
|
|
+ return StringUtil.isEmpty(airStartingCode)?(getTestAir(airStarting)):airStartingCode;
|
|
|
}
|
|
|
|
|
|
- public String getBusinessName() {
|
|
|
- return businessName == null ? "" : businessName;
|
|
|
+ //TODO 测试数据
|
|
|
+ private String getTestAir(String air){
|
|
|
+ if (air.equals("南宁")){
|
|
|
+ return "NNG";
|
|
|
+ }else if (air.equals("深圳")){
|
|
|
+ return "SZX";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
}
|
|
|
|
|
|
- public void setBusinessName(String businessName) {
|
|
|
- this.businessName = businessName;
|
|
|
+ public String getAirDestination() {
|
|
|
+ return airDestination;
|
|
|
}
|
|
|
|
|
|
- public int getNumber() {
|
|
|
- return number;
|
|
|
+ public String getAirDestinationCode() {
|
|
|
+ return StringUtil.isEmpty(airDestinationCode)?(getTestAir(airDestination)):airDestinationCode;
|
|
|
}
|
|
|
|
|
|
- public void setNumber(int number) {
|
|
|
- this.number = number;
|
|
|
+ public String getTrainStarting() {
|
|
|
+ return trainStarting;
|
|
|
}
|
|
|
|
|
|
- public String getRemark() {
|
|
|
- return remark;
|
|
|
+ public String getTrainStartingCode() {
|
|
|
+ return StringUtil.isEmpty(trainStartingCode)?(getTestTrain(trainStarting)):trainStartingCode;
|
|
|
}
|
|
|
|
|
|
- public void setRemark(String remark) {
|
|
|
- this.remark = remark;
|
|
|
+ public String getTrainDestination() {
|
|
|
+ return trainDestination;
|
|
|
}
|
|
|
|
|
|
- public boolean canChange() {
|
|
|
- return true;
|
|
|
+ public String getTrainDestinationCode() {
|
|
|
+ return StringUtil.isEmpty(trainDestinationCode)?(getTestTrain(trainDestination)):trainDestinationCode;
|
|
|
}
|
|
|
|
|
|
- public String getTitle() {
|
|
|
- return title;
|
|
|
+ private String getTestTrain(String train){
|
|
|
+ if (train.equals("南宁")){
|
|
|
+ return "2102";
|
|
|
+ }else if (train.equals("深圳")){
|
|
|
+ return "2003";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
}
|
|
|
|
|
|
- public String getTitleCode() {
|
|
|
- String product = "";
|
|
|
- switch (title) {
|
|
|
- case "火车票":
|
|
|
- product = "train";
|
|
|
- break;
|
|
|
- case "住宿":
|
|
|
- product = "hotel";
|
|
|
- break;
|
|
|
- case "飞机票":
|
|
|
- product = "air";
|
|
|
- break;
|
|
|
- default:
|
|
|
- product = "center";
|
|
|
- break;
|
|
|
- }
|
|
|
-// if (status != null) switch (status) {
|
|
|
-// case "待改签":
|
|
|
-// product += "gq";
|
|
|
-// break;
|
|
|
-// case "待退票":
|
|
|
-// product += "tp";aQaqaaq
|
|
|
-// break;
|
|
|
-// }
|
|
|
- return product;
|
|
|
+ public String getHotelCity() {
|
|
|
+ return hotelCity;
|
|
|
}
|
|
|
|
|
|
+ public String getHotelCityCode() {
|
|
|
+ return hotelCityCode;
|
|
|
+ }
|
|
|
|
|
|
- public String getTitleAndCode() {
|
|
|
- return title + " " + (StringUtil.isEmpty(code) ? "未订票" : code);
|
|
|
+ public String getFlightCode() {
|
|
|
+ return flightCode;
|
|
|
}
|
|
|
|
|
|
- public String getDate() {
|
|
|
- return type == AIR ? (DateFormatUtil.long2Str(endTime, "yyyy-MM-dd")) : (DateFormatUtil.long2Str(startTime, "yyyy-MM-dd") + "-" + DateFormatUtil.long2Str(endTime, "yyyy-MM-dd"));
|
|
|
+ public String getHotelAddress() {
|
|
|
+ return hotelAddress;
|
|
|
}
|
|
|
}
|