【文件属性】:
文件名称:jsp 火车订票系统
文件大小:160KB
文件格式:RAR
更新时间:2018-06-06 06:38:51
aaaa
完成订票和预定成功等功能:
String date = this.getRequest().getParameter("chuFaRiQi");
String chuFaDi = RailwayTicket.Function.encodingFunction.getMethodEncoding(this.getRequest().getParameter("chuFaDi").trim());
String muDiDi = RailwayTicket.Function.encodingFunction.getMethodEncoding(this.getRequest().getParameter("muDiDi").trim());
List lstTrain = this.sellTicketService.queryTrain(chuFaDi, muDiDi);
JSONObject jsObj = new JSONObject();
JSONArray jsArr = new JSONArray();
for(int i = 0;i"+obj[3]);
String[] strDDate = obj[4].toString().split(":");
String[] strADate = obj[5].toString().split(":");
//计算列车历时
int dMin = Integer.parseInt(strDDate[1]);
int aMin = Integer.parseInt(strADate[1]);
int dHour = Integer.parseInt(strDDate[0]);
int aHour = Integer.parseInt(strADate[0]);
int daySpan = Integer.parseInt(obj[7].toString()) - Integer.parseInt(obj[6].toString());
if(aMin < dMin){
aMin += 60;
aHour -= 1;
}
boolean flag = false;
if(aHour < dHour){
aHour += 24;
flag = true;
}
aHour += daySpan * 24;
jsObj.put("timeSpan", (aHour - dHour) + ":" + (aMin - dMin));
String strDaySpan;
if((aHour - dHour) > 24 && daySpan > 0){
strDaySpan = "两日到达";
}
else{
if(daySpan > 0 || flag){
strDaySpan = "次日到达";
}
else{
strDaySpan = "当日到达";
}
}
List lst = this.sellTicketService.queryTrainSeatInfo(Integer.parseInt(obj[0].toString()),date);
List lstExist = (List)lst.get(0);
List lstNotExist = (List)lst.get(1);
//查询各类坐席座位数 0011100 1*2^2+1*2^3+1*2^4
int intChuFaSNO = Integer.parseInt(obj[8].toString());
int intDaoDaSNO = Integer.parseInt(obj[9].toString());
Double intervalBit = 0.0;
for(int j = intChuFaSNO;j= intChuFaSNO){
intervalBit = intervalBit + 1 * Math.pow(2, j);//1*2^j
//}
/*else{
intervalBit = intervalBit + 0 * Math.pow(2, j);
}*/
}
jsObj.put("intervalBit", intervalBit);
for(int j = 0;j 40){
jsObj.put(objCarType[1].toString().trim(),"有");
}
else if (lstTrainSeatExist.size() == 0){
jsObj.put(objCarType[1].toString().trim(),"无");
}
else{
jsObj.put(objCarType[1].toString().trim(),lstTrainSeatExist.size());
}
}
List lstTrainNoSeatExist = this.sellTicketService.queryNoSeat(intervalBit.longValue(), Integer.parseInt(obj[0].toString()), date);
if(lstTrainNoSeatExist.size() > 40){
jsObj.put("无座","有");
}
else if (lstTrainNoSeatExist.size() == 0){
jsObj.put("无座","无");
}
else{
jsObj.put("无座",lstTrainNoSeatExist.size());
}
for(int j = 0;j < lstNotExist.size();j++){
CarType ct = (CarType) lstNotExist.get(j);
jsObj.put(ct.getCarTypeName().trim(),"--");
}
jsObj.put("DATime", obj[4]+"
"+obj[5]+"
"+strDaySpan);
jsArr.add(jsObj);
}
HashMap jsMap = new HashMap();
jsMap.put("rows", jsArr);
JSObj = JSONObject.fromObject(jsMap);
return SUCCESS;
【文件预览】:
transportTracking.bak