1.技术介绍
java+struts+mysql+spring+mybatis+JSP
开发工具:eclipse或idea
2.主要功能说明:
登录
1)管理员
管理员信息管理(新增、修改、删除、查询)
用户信息管理(新增、修改、删除、查询)
车次信息管理(新增、修改、删除、查询)
站台信息管理(新增、修改、删除、查询)
公告信息管理(新增、修改、删除、查询)
评论信息管理(新增、修改、删除、查询)
2)用户
用户注册、登录、查询公交信息、百度地图导航、评论、个人中心
3.核心代码实现:
站台控制器
package com.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.dao.TCheciDAO;
import com.dao.TGonggaoDAO;
import com.dao.TZhantaiDAO;
import com.model.TCheci;
import com.model.TZhantai;
import com.opensymphony.xwork2.ActionSupport;
public class zhantaiAction extends ActionSupport {
private Integer id;
private Integer checi;
private String zhantai;
private Integer dijizhan;
private String miaoshu;
private String message;
private String path;
private TCheciDAO checiDAO;
private TZhantaiDAO zhantaiDAO;
public TCheciDAO getCheciDAO() {
return checiDAO;
}
public void setCheciDAO(TCheciDAO checiDAO) {
this.checiDAO = checiDAO;
}
public String zhantaiAdd() {
TZhantai zhantaiObj = new TZhantai();
zhantaiObj.setCheci(checi);
zhantaiObj.setDijizhan(dijizhan);
zhantaiObj.setZhantai(zhantai);
zhantaiObj.setMiaoshu(miaoshu);
zhantaiObj.setDel("no");
zhantaiDAO.save(zhantaiObj);
this.setMessage("�����ɹ�");
this.setPath("zhantaiMana.action");
return "succeed";
}
public String zhantaiMana() {
String sql = "from TZhantai where del='no'";
List zhantaiList = zhantaiDAO.getHibernateTemplate().find(sql);
for (Object obj : zhantaiList) {
TZhantai zhantaiObj = (TZhantai) obj;
zhantaiObj.setCheciname(checiDAO.findById(zhantaiObj.getCheci())
.getCheci());
}
Map request = (Map) ServletActionContext.getContext().get("request");
request.put("zhantaiList", zhantaiList);
return ActionSupport.SUCCESS;
}
public String zhantaiBycheci() {
String sql = "from TZhantai where del='no' and checi = " + checi;
List zhantaiList = zhantaiDAO.getHibernateTemplate().find(sql);
for (Object obj : zhantaiList) {
TZhantai zhantaiObj = (TZhantai) obj;
zhantaiObj.setCheciname(checiDAO.findById(zhantaiObj.getCheci())
.getCheci());
}
Map request = (Map) ServletActionContext.getContext().get("request");
request.put("zhantaiList", zhantaiList);
return ActionSupport.SUCCESS;
}
public String zhantaiDel() {
TZhantai zhantai = zhantaiDAO.findById(id);
zhantai.setDel("yes");
zhantaiDAO.attachDirty(zhantai);
this.setMessage("�����ɹ�");
this.setPath("zhantaiMana.action");
return "succeed";
}
public String zhantaiDetail() {
TZhantai zhantai = zhantaiDAO.findById(id);
Map request = (Map) ServletActionContext.