JAVA实现城市交通查询系统

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.
  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值