Java项目:SSM共享汽车租赁平台

news2024/11/15 9:59:30

作者主页:源码空间站2022

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目分为前后台,前台为普通用户登录,后台为管理员登录;

管理员角色包含以下功能:
管理员登录,修改管理员信息,用户信息管理,管理新闻公告,汽车品牌信息管理,城市信息管理,租赁点信息管理,共享汽车信息管理,汽车订单信息管理,汽车评价信息管理等功能。

用户角色包含以下功能:

查看首页,查看网站公告,查看可用共享汽车,查看租赁点,查看汽车详情,加入租赁单,提交订单,查看我的订单,修改个人信息等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 

5.数据库:MySql 5.7版本;

6.是否Maven项目:否;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:JSP+CSS+JavaScript+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;

3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入http://localhost:8080/ 登录
用户账号/密码: user/123456

管理员账号/密码:admin/admin

运行截图

前台界面

后台界面

相关代码

UsersAction

package com.action;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.entity.Users;
import com.service.UsersService;
import com.util.PageHelper;
import com.util.VeDate;
//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/users" , produces = "text/plain;charset=utf-8")
public class UsersAction extends BaseAction {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
@Resource
private UsersService usersService;

// 准备添加数据
@RequestMapping("createUsers.action")
public String createUsers() {
return "admin/addusers";
}
// 添加数据
@RequestMapping("addUsers.action")
public String addUsers(Users users) {
users.setRegdate(VeDate.getStringDateShort());
this.usersService.insertUsers(users);
return "redirect:/users/createUsers.action";
}

// 通过主键删除数据
@RequestMapping("deleteUsers.action")
public String deleteUsers(String id) {
this.usersService.deleteUsers(id);
return "redirect:/users/getAllUsers.action";
}

// 批量删除数据
@RequestMapping("deleteUsersByIds.action")
public String deleteUsersByIds() {
String[] ids = this.getRequest().getParameterValues("usersid");
for (String usersid : ids) {
this.usersService.deleteUsers(usersid);
}
return "redirect:/users/getAllUsers.action";
}

// 更新数据
@RequestMapping("updateUsers.action")
public String updateUsers(Users users) {
this.usersService.updateUsers(users);
return "redirect:/users/getAllUsers.action";
}
// 显示全部数据
@RequestMapping("getAllUsers.action")
public String getAllUsers(String number) {
List<Users> usersList = this.usersService.getAllUsers();
PageHelper.getPage(usersList, "users", null, null, 10, number, this.getRequest(), null);
return "admin/listusers";
}

// 按条件查询数据 (模糊查询)
@RequestMapping("queryUsersByCond.action")
public String queryUsersByCond(String cond, String name, String number) {
Users users = new Users();
if(cond != null){
if ("username".equals(cond)) {
users.setUsername(name);
}
if ("password".equals(cond)) {
users.setPassword(name);
}
if ("realname".equals(cond)) {
users.setRealname(name);
}
if ("sex".equals(cond)) {
users.setSex(name);
}
if ("birthday".equals(cond)) {
users.setBirthday(name);
}
if ("contact".equals(cond)) {
users.setContact(name);
}
if ("regdate".equals(cond)) {
users.setRegdate(name);
}
}

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.usersService.getUsersByLike(users), "users", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/queryusers";
}

// 按主键查询数据
@RequestMapping("getUsersById.action")
public String getUsersById(String id ) {
Users users = this.usersService.getUsersById(id);
this.getRequest().setAttribute("users", users);
return "admin/editusers";
}

public UsersService getUsersService() { return usersService; }

public void setUsersService(UsersService usersService) { this.usersService = usersService; }

}

UploadAction

package com.action;

import java.io.File;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import com.util.VeDate;

@Controller
@RequestMapping("/upload")
public class UploadAction {

	@RequestMapping(value = "/image.action")
	public String upload(@RequestParam(value = "image", required = false) MultipartFile file,
			HttpServletRequest request, ModelMap model) {
		String path = request.getSession().getServletContext().getRealPath("/") + "upfiles/";
		String fileName = file.getOriginalFilename();
		int i = fileName.lastIndexOf(".");
		String name = String.valueOf(VeDate.getStringDatex());
		String type = fileName.substring(i + 1);
		fileName = name + "." + type;
		File targetFile = new File(path, fileName);
		if (!targetFile.exists()) {
			targetFile.mkdirs();
		}

		// 保存
		try {
			file.transferTo(targetFile);
		} catch (Exception e) {
			e.printStackTrace();
		}
		model.addAttribute("imageFileName", fileName);
		return "saveimage";
	}

	@RequestMapping(value = "/files.action")
	public String files(@RequestParam(value = "image", required = false) MultipartFile file, HttpServletRequest request,
			ModelMap model) {
		String path = request.getSession().getServletContext().getRealPath("/") + "upfiles/";
		String fileName = file.getOriginalFilename();
		int i = fileName.lastIndexOf(".");
		String name = String.valueOf(VeDate.getStringDatex());
		String type = fileName.substring(i + 1);
		fileName = name + "." + type;
		File targetFile = new File(path, fileName);
		if (!targetFile.exists()) {
			targetFile.mkdirs();
		}

		// 保存
		try {
			file.transferTo(targetFile);
		} catch (Exception e) {
			e.printStackTrace();
		}
		model.addAttribute("imageFileName", fileName);
		return "savefile";
	}
}

TopicAction

package com.action;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.entity.Topic;
import com.service.TopicService;
import com.entity.Users;
import com.entity.Jiancai;
import com.service.UsersService;
import com.service.JiancaiService;
import com.util.PageHelper;
//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/topic" , produces = "text/plain;charset=utf-8")
public class TopicAction extends BaseAction {
	// 注入Service 由于标签的存在 所以不需要getter setter
	@Autowired
	@Resource
	private TopicService topicService;
	@Autowired
	@Resource
	private UsersService usersService;
	@Autowired
	@Resource
	private JiancaiService jiancaiService;

	// 准备添加数据
	@RequestMapping("createTopic.action")
	public String createTopic() {
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
		this.getRequest().setAttribute("jiancaiList", jiancaiList);
		return "admin/addtopic";
	}
	// 添加数据
	@RequestMapping("addTopic.action")
	public String addTopic(Topic topic) {
		this.topicService.insertTopic(topic);
		return "redirect:/topic/createTopic.action";
	}

	// 通过主键删除数据
	@RequestMapping("deleteTopic.action")
	public String deleteTopic(String id) {
		this.topicService.deleteTopic(id);
		return "redirect:/topic/getAllTopic.action";
	}

	// 批量删除数据
	@RequestMapping("deleteTopicByIds.action")
	public String deleteTopicByIds() {
		String[] ids = this.getRequest().getParameterValues("topicid");
		for (String topicid : ids) {
			this.topicService.deleteTopic(topicid);
		}
		return "redirect:/topic/getAllTopic.action";
	}

	// 更新数据
	@RequestMapping("updateTopic.action")
	public String updateTopic(Topic topic) {
		this.topicService.updateTopic(topic);
		return "redirect:/topic/getAllTopic.action";
	}
	// 显示全部数据
	@RequestMapping("getAllTopic.action")
	public String getAllTopic(String number) {
		List<Topic> topicList = this.topicService.getAllTopic();
		PageHelper.getPage(topicList, "topic", null, null, 10, number, this.getRequest(), null);
		return "admin/listtopic";
	}

	// 按条件查询数据 (模糊查询)
	@RequestMapping("queryTopicByCond.action")
	public String queryTopicByCond(String cond, String name, String number) {
		Topic topic = new Topic();
		if(cond != null){
			if ("username".equals(cond)) {
				topic.setUsername(name);
			}
			if ("jiancainame".equals(cond)) {
				topic.setJiancainame(name);
			}
			if ("num".equals(cond)) {
				topic.setNum(name);
			}
			if ("contents".equals(cond)) {
				topic.setContents(name);
			}
			if ("addtime".equals(cond)) {
				topic.setAddtime(name);
			}
		}

		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.topicService.getTopicByLike(topic), "topic", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/querytopic";
	}

	// 按主键查询数据
	@RequestMapping("getTopicById.action")
	public String getTopicById(String id ) {
		Topic topic = this.topicService.getTopicById(id);
		this.getRequest().setAttribute("topic", topic);
		List<Users> usersList = this.usersService.getAllUsers();
		this.getRequest().setAttribute("usersList", usersList);
		List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
		this.getRequest().setAttribute("jiancaiList", jiancaiList);
		return "admin/edittopic";
	}

	public TopicService getTopicService() { return topicService; }

	public void setTopicService(TopicService topicService) { this.topicService = topicService; }

}

首页相关

package com.action;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.entity.Article;
import com.entity.Cart;
import com.entity.Cate;
import com.entity.City;
import com.entity.Details;
import com.entity.Jiancai;
import com.entity.Orders;
import com.entity.Topic;
import com.entity.Users;
import com.service.ArticleService;
import com.service.CartService;
import com.service.CateService;
import com.service.PeihuoService;
import com.service.CityService;
import com.service.DetailsService;
import com.service.JiancaiService;
import com.service.OrdersService;
import com.service.TopicService;
import com.service.UsersService;
import com.util.VeDate;

//定义为控制器
@Controller
// 设置路径
@RequestMapping("/index")
public class IndexAction extends BaseAction {

	@Autowired
	@Resource
	private UsersService usersService;
	@Autowired
	@Resource
	private ArticleService articleService;
	@Autowired
	@Resource
	private CateService cateService;
	@Autowired
	@Resource
	private CityService cityService;
	@Autowired
	@Resource
	private PeihuoService peihuoService;
	@Autowired
	@Resource
	private JiancaiService jiancaiService;
	@Autowired
	@Resource
	private CartService cartService;
	@Autowired
	@Resource
	private OrdersService ordersService;
	@Autowired
	@Resource
	private DetailsService detailsService;
	@Autowired
	@Resource
	private TopicService topicService;

	// 公共方法 提供公共查询数据
	private void front() {
		this.getRequest().setAttribute("title", "龙城共享汽车网-力作中国最大的共享汽车网站");
		List<Cate> cateList = this.cateService.getAllCate();
		this.getRequest().setAttribute("cateList", cateList);
		List<Jiancai> hotList = this.jiancaiService.getJiancaiByHot();
		Collections.shuffle(hotList);
		this.getRequest().setAttribute("hotList", hotList);
	}

	// 首页显示
		@RequestMapping("index.action")
		public String index() {
			this.front();
			List<Cate> cateList = this.cateService.getCateFront();
			List<Cate> frontList = new ArrayList<Cate>();
			for (Cate cate : cateList) {
				List<Jiancai> flimList = this.jiancaiService.getJiancaiByCate(cate.getCateid());
				cate.setFlimList(flimList);
				frontList.add(cate);
			}
			this.getRequest().setAttribute("frontList", frontList);
			return "users/index";
		}
		
		// 首页显示
		@RequestMapping("network.action")
		public String network() {
			this.front();
			List<Cate> cateList = this.cateService.getCateFront();
			List<Cate> frontList = new ArrayList<Cate>();
			for (Cate cate : cateList) {
				List<Jiancai> flimList = this.jiancaiService.getJiancaiByCate(cate.getCateid());
				cate.setFlimList(flimList);
				frontList.add(cate);
			}
			this.getRequest().setAttribute("frontList", frontList);
			return "users/network";
		}

	// 公告
	@RequestMapping("article.action")
	public String article(String number) {
		this.front();
		List<Article> articleList = new ArrayList<Article>();
		List<Article> tempList = this.articleService.getAllArticle();
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Article x = tempList.get(i);
			articleList.add(x);
		}
		String html = "";
		StringBuffer buffer = new StringBuffer();
		buffer.append("&nbsp;&nbsp;共为");
		buffer.append(maxPage);
		buffer.append("页&nbsp; 共有");
		buffer.append(pageNumber);
		buffer.append("条&nbsp; 当前为第");
		buffer.append((Integer.parseInt(number) + 1));
		buffer.append("页 &nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("首页");
		} else {
			buffer.append("<a href=\"index/article.action?number=0\">首页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("上一页");
		} else {
			buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/article.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			buffer.append("<a href=\"index/article.action?number=" + (maxPage - 1) + "\">尾页</a>");
		}
		html = buffer.toString();
		this.getRequest().setAttribute("html", html);
		this.getRequest().setAttribute("articleList", articleList);
		return "users/article";
	}

	// 阅读公告
	@RequestMapping("read.action")
	public String read(String id) {
		this.front();
		Article article = this.articleService.getArticleById(id);
		article.setHits("" + (Integer.parseInt(article.getHits()) + 1));
		this.articleService.updateArticle(article);
		this.getRequest().setAttribute("article", article);
		return "users/read";
	}

	// 准备登录
	@RequestMapping("preLogin.action")
	public String prelogin() {
		this.front();
		return "users/login";
	}

	// 用户登录
	@RequestMapping("login.action")
	public String login() {
		this.front();
		String username = this.getRequest().getParameter("username");
		String password = this.getRequest().getParameter("password");
		Users u = new Users();
		u.setUsername(username);
		List<Users> usersList = this.usersService.getUsersByCond(u);
		if (usersList.size() == 0) {
			this.getSession().setAttribute("message", "用户名不存在");
			return "redirect:/index/preLogin.action";
		} else {
			Users users = usersList.get(0);
			if (password.equals(users.getPassword())) {
				this.getSession().setAttribute("userid", users.getUsersid());
				this.getSession().setAttribute("username", users.getUsername());
				this.getSession().setAttribute("users", users);
				return "redirect:/index/index.action";
			} else {
				this.getSession().setAttribute("message", "密码错误");
				return "redirect:/index/preLogin.action";
			}
		}
	}

	// 准备注册
	@RequestMapping("preReg.action")
	public String preReg() {
		this.front();
		return "users/register";
	}

	// 用户注册
	@RequestMapping("register.action")
	public String register(Users users) {
		this.front();
		Users u = new Users();
		u.setUsername(users.getUsername());
		List<Users> usersList = this.usersService.getUsersByCond(u);
		if (usersList.size() == 0) {
			users.setRegdate(VeDate.getStringDateShort());
			this.usersService.insertUsers(users);
		} else {
			this.getSession().setAttribute("message", "用户名已存在");
			return "redirect:/index/preReg.action";
		}

		return "redirect:/index/preLogin.action";
	}

	// 退出登录
	@RequestMapping("exit.action")
	public String exit() {
		this.front();
		this.getSession().removeAttribute("userid");
		this.getSession().removeAttribute("username");
		this.getSession().removeAttribute("users");
		return "index";
	}

	// 准备修改密码
	@RequestMapping("prePwd.action")
	public String prePwd() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		return "users/editpwd";
	}

	// 修改密码
	@RequestMapping("editpwd.action")
	public String editpwd() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		String password = this.getRequest().getParameter("password");
		String repassword = this.getRequest().getParameter("repassword");
		Users users = this.usersService.getUsersById(userid);
		if (password.equals(users.getPassword())) {
			users.setPassword(repassword);
			this.usersService.updateUsers(users);
		} else {
			this.getSession().setAttribute("message", "旧密码错误");
			return "redirect:/index/prePwd.action";
		}
		return "redirect:/index/prePwd.action";
	}

	@RequestMapping("usercenter.action")
	public String usercenter() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		return "users/usercenter";
	}

	@RequestMapping("userinfo.action")
	public String userinfo() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		this.getSession().setAttribute("users", this.usersService.getUsersById(userid));
		return "users/userinfo";
	}

	@RequestMapping("personal.action")
	public String personal(Users users) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		this.usersService.updateUsers(users);
		return "redirect:/index/userinfo.action";
	}

	// 添加产品到购物车
	@RequestMapping("addcart.action")
	public String addcart() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Cart cart = new Cart();
		cart.setJiancaiid(getRequest().getParameter("goodsid"));
		cart.setNum(getRequest().getParameter("num"));
		cart.setPrice(getRequest().getParameter("price"));
		cart.setUsersid(userid);
		this.cartService.insertCart(cart);
		return "redirect:/index/cart.action";
	}

	// 查看购物车
	@RequestMapping("cart.action")
	public String cart() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Cart cart = new Cart();
		cart.setUsersid(userid);
		List<Cart> cartList = this.cartService.getCartByCond(cart);
		this.getRequest().setAttribute("cartList", cartList);
		return "users/cart";
	}

	// 删除购物车中的产品
	@RequestMapping("deletecart.action")
	public String deletecart(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		this.cartService.deleteCart(id);
		return "redirect:/index/cart.action";
	}

	// 准备结算
	@RequestMapping("preCheckout.action")
	public String preCheckout() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Cart cart = new Cart();
		cart.setUsersid(userid);
		List<Cart> cartList = this.cartService.getCartByCond(cart);
		if (cartList.size() == 0) {
			this.getRequest().setAttribute("message", "请选购共享汽车");
			return "redirect:/index/cart.action";
		}
		List<City> cityList = this.cityService.getAllCity();
		this.getRequest().setAttribute("cityList", cityList);
		return "users/checkout";
	}

	// 结算
	@RequestMapping("checkout.action")
	public String checkout() {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Cart cart1 = new Cart();
		cart1.setUsersid(userid);
		List<Cart> cartList = this.cartService.getCartByCond(cart1);
		if (cartList.size() == 0) {
			this.getRequest().setAttribute("message", "请选购共享汽车");
			return "redirect:/index/cart.action";
		} else {
			// 获取一个1200-9999的随机数 防止同时提交
			String ordercode = "PD" + VeDate.getStringDatex();
			double total = 0;
			for (Cart cart : cartList) {
				Details details = new Details();
				details.setDetailsid(VeDate.getStringDatex() + (Math.random() * 9 + 1) * 1200);
				details.setJiancaiid(cart.getJiancaiid());
				details.setNum(cart.getNum());
				details.setOrdercode(ordercode);
				details.setPrice(cart.getPrice());
				details.setPeihuoid(this.getRequest().getParameter("peihuoid"));
				details.setCityid(this.getRequest().getParameter("cityid"));
				details.setViewdate(this.getRequest().getParameter("viewdate"));
				this.detailsService.insertDetails(details);
				Jiancai goods = this.jiancaiService.getJiancaiById(cart.getJiancaiid());
				goods.setSellnum("" + (Integer.parseInt(goods.getSellnum()) + Integer.parseInt(cart.getNum())));
				this.jiancaiService.updateJiancai(goods);
				total += Double.parseDouble(cart.getPrice()) * Double.parseDouble(cart.getNum());
				this.cartService.deleteCart(cart.getCartid());
			}
			Orders orders = new Orders();
			orders.setAddtime(VeDate.getStringDateShort());
			orders.setOrdercode(ordercode);
			orders.setStatus("未付款");
			orders.setTotal("" + total);
			orders.setUsersid(userid);
			this.ordersService.insertOrders(orders);
		}
		return "redirect:/index/showOrders.action";
	}

	// 查看订购
	@RequestMapping("showOrders.action")
	public String showOrders(String number) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Orders orders = new Orders();
		orders.setUsersid(userid);
		List<Orders> ordersList = new ArrayList<Orders>();
		List<Orders> tempList = this.ordersService.getOrdersByCond(orders);
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Orders o = tempList.get(i);
			ordersList.add(o);
		}
		String html = "";
		StringBuffer buffer = new StringBuffer();
		buffer.append("&nbsp;&nbsp;共为");
		buffer.append(maxPage);
		buffer.append("页&nbsp; 共有");
		buffer.append(pageNumber);
		buffer.append("条&nbsp; 当前为第");
		buffer.append((Integer.parseInt(number) + 1));
		buffer.append("页 &nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("首页");
		} else {
			buffer.append("<a href=\"index/showOrders.action?number=0\">首页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("上一页");
		} else {
			buffer.append("<a href=\"index/showOrders.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/showOrders.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			buffer.append("<a href=\"index/showOrders.action?number=" + (maxPage - 1) + "\">尾页</a>");
		}
		html = buffer.toString();
		this.getRequest().setAttribute("html", html);
		this.getRequest().setAttribute("ordersList", ordersList);
		return "users/orderlist";
	}

	// 准备付款
	@RequestMapping("prePay.action")
	public String prePay(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		this.getRequest().setAttribute("id", id);
		return "users/pay";
	}

	// 付款
	@RequestMapping("pay.action")
	public String pay(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));
		orders.setStatus("已付款");
		this.ordersService.updateOrders(orders);
		return "redirect:/index/showOrders.action";
	}

	// 确认收货
	@RequestMapping("over.action")
	public String over(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));
		orders.setStatus("已收货");
		this.ordersService.updateOrders(orders);
		return "redirect:/index/showOrders.action";
	}

	// 取消订单
	@RequestMapping("cancel.action")
	public String cancel(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		Orders orders = this.ordersService.getOrdersById(this.getRequest().getParameter("id"));
		orders.setStatus("已取消");
		this.ordersService.updateOrders(orders);
		return "redirect:/index/showOrders.action";
	}

	// 订单明细
	@RequestMapping("orderdetail.action")
	public String orderdetail(String id) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		Details details = new Details();
		details.setOrdercode(id);
		List<Details> detailsList = this.detailsService.getDetailsByCond(details);
		this.getRequest().setAttribute("detailsList", detailsList);
		return "users/orderdetail";
	}

	// 按分类查询
	@RequestMapping("cate.action")
	public String cate(String id, String number) {
		this.front();
		Jiancai goods = new Jiancai();
		goods.setCateid(id);
		List<Jiancai> flimList = new ArrayList<Jiancai>();
		List<Jiancai> tempList = this.jiancaiService.getJiancaiByCond(goods);
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Jiancai x = tempList.get(i);
			flimList.add(x);
		}
		String html = "";
		StringBuffer buffer = new StringBuffer();
		buffer.append("&nbsp;&nbsp;共为");
		buffer.append(maxPage);
		buffer.append("页&nbsp; 共有");
		buffer.append(pageNumber);
		buffer.append("条&nbsp; 当前为第");
		buffer.append((Integer.parseInt(number) + 1));
		buffer.append("页 &nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("首页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=0&id=\" + id+ \"\">首页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("上一页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) - 1) + "&id=\" + id+ \"\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=" + (Integer.parseInt(number) + 1) + "&id=\" + id+ \"\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			buffer.append("<a href=\"index/cate.action?number=" + (maxPage - 1) + "&id=\" + id+ \"\">尾页</a>");
		}
		html = buffer.toString();
		this.getRequest().setAttribute("html", html);
		this.getRequest().setAttribute("flimList", flimList);
		return "users/list";
	}

	// 推荐产品
		@RequestMapping("recommend.action")
		public String recommend(String number) {
			this.front();
			Jiancai goods = new Jiancai();
			goods.setRecommend("是");
			List<Jiancai> flimList = new ArrayList<Jiancai>();
			List<Jiancai> tempList = this.jiancaiService.getJiancaiByCond(goods);
			int pageNumber = tempList.size();
			int maxPage = pageNumber;
			if (maxPage % 12 == 0) {
				maxPage = maxPage / 12;
			} else {
				maxPage = maxPage / 12 + 1;
			}
			if (number == null) {
				number = "0";
			}
			int start = Integer.parseInt(number) * 12;
			int over = (Integer.parseInt(number) + 1) * 12;
			int count = pageNumber - over;
			if (count <= 0) {
				over = pageNumber;
			}
			for (int i = start; i < over; i++) {
				Jiancai x = tempList.get(i);
				flimList.add(x);
			}
			String html = "";
			StringBuffer buffer = new StringBuffer();
			buffer.append("&nbsp;&nbsp;共为");
			buffer.append(maxPage);
			buffer.append("页&nbsp; 共有");
			buffer.append(pageNumber);
			buffer.append("条&nbsp; 当前为第");
			buffer.append((Integer.parseInt(number) + 1));
			buffer.append("页 &nbsp;");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("首页");
			} else {
				buffer.append("<a href=\"index/recommend.action?number=0\">首页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("上一页");
			} else {
				buffer.append("<a href=\"index/recommend.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("下一页");
			} else {
				buffer.append("<a href=\"index/recommend.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("尾页");
			} else {
				buffer.append("<a href=\"index/recommend.action?number=" + (maxPage - 1) + "\">尾页</a>");
			}
			html = buffer.toString();
			this.getRequest().setAttribute("html", html);
			this.getRequest().setAttribute("flimList", flimList);
			return "users/list";
		}
		
		// 推荐产品
		@RequestMapping("hot.action")
		public String getHost(String number) {
			this.front();
			Jiancai goods = new Jiancai();
			goods.setRecommend("是");
			List<Jiancai> flimList = new ArrayList<Jiancai>();
			List<Jiancai> tempList = this.jiancaiService.getJiancaiByHot();
			int pageNumber = tempList.size();
			int maxPage = pageNumber;
			if (maxPage % 12 == 0) {
				maxPage = maxPage / 12;
			} else {
				maxPage = maxPage / 12 + 1;
			}
			if (number == null) {
				number = "0";
			}
			int start = Integer.parseInt(number) * 12;
			int over = (Integer.parseInt(number) + 1) * 12;
			int count = pageNumber - over;
			if (count <= 0) {
				over = pageNumber;
			}
			for (int i = start; i < over; i++) {
				Jiancai x = tempList.get(i);
				flimList.add(x);
			}
			String html = "";
			StringBuffer buffer = new StringBuffer();
			buffer.append("&nbsp;&nbsp;共为");
			buffer.append(maxPage);
			buffer.append("页&nbsp; 共有");
			buffer.append(pageNumber);
			buffer.append("条&nbsp; 当前为第");
			buffer.append((Integer.parseInt(number) + 1));
			buffer.append("页 &nbsp;");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("首页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=0\">首页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if ((Integer.parseInt(number) + 1) == 1) {
				buffer.append("上一页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("下一页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
			}
			buffer.append("&nbsp;&nbsp;");
			if (maxPage <= (Integer.parseInt(number) + 1)) {
				buffer.append("尾页");
			} else {
				buffer.append("<a href=\"index/hot.action?number=" + (maxPage - 1) + "\">尾页</a>");
			}
			html = buffer.toString();
			this.getRequest().setAttribute("html", html);
			this.getRequest().setAttribute("flimList", flimList);
			return "users/list";
		}

	// 全部产品
	@RequestMapping("all.action")
	public String all(String number) {
		this.front();
		List<Jiancai> flimList = new ArrayList<Jiancai>();
		List<Jiancai> tempList = this.jiancaiService.getAllJiancai();
		int pageNumber = tempList.size();
		int maxPage = pageNumber;
		if (maxPage % 12 == 0) {
			maxPage = maxPage / 12;
		} else {
			maxPage = maxPage / 12 + 1;
		}
		if (number == null) {
			number = "0";
		}
		int start = Integer.parseInt(number) * 12;
		int over = (Integer.parseInt(number) + 1) * 12;
		int count = pageNumber - over;
		if (count <= 0) {
			over = pageNumber;
		}
		for (int i = start; i < over; i++) {
			Jiancai x = tempList.get(i);
			flimList.add(x);
		}
		String html = "";
		StringBuffer buffer = new StringBuffer();
		buffer.append("&nbsp;&nbsp;共为");
		buffer.append(maxPage);
		buffer.append("页&nbsp; 共有");
		buffer.append(pageNumber);
		buffer.append("条&nbsp; 当前为第");
		buffer.append((Integer.parseInt(number) + 1));
		buffer.append("页 &nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("首页");
		} else {
			buffer.append("<a href=\"index/all.action?number=0\">首页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if ((Integer.parseInt(number) + 1) == 1) {
			buffer.append("上一页");
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) - 1) + "\">上一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("下一页");
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (Integer.parseInt(number) + 1) + "\">下一页</a>");
		}
		buffer.append("&nbsp;&nbsp;");
		if (maxPage <= (Integer.parseInt(number) + 1)) {
			buffer.append("尾页");
		} else {
			buffer.append("<a href=\"index/all.action?number=" + (maxPage - 1) + "\">尾页</a>");
		}
		html = buffer.toString();
		this.getRequest().setAttribute("html", html);
		this.getRequest().setAttribute("flimList", flimList);
		return "users/list";
	}

	// 查询共享汽车
	@RequestMapping("query.action")
	public String query(String name) {
		this.front();
		Jiancai goods = new Jiancai();
		goods.setJiancainame(name);
		List<Jiancai> flimList = this.jiancaiService.getJiancaiByLike(goods);
		this.getRequest().setAttribute("flimList", flimList);
		return "users/list";
	}

	// 共享汽车详情
	@RequestMapping("detail.action")
	public String detail(String id) {
		this.front();
		Jiancai goods = this.jiancaiService.getJiancaiById(id);
		goods.setHits("" + (Integer.parseInt(goods.getHits()) + 1));
		this.jiancaiService.updateJiancai(goods);
		this.getRequest().setAttribute("goods", goods);
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		Topic topic = new Topic();
		topic.setJiancaiid(id);
		List<Topic> topicList = this.topicService.getTopicByCond(topic);
		this.getRequest().setAttribute("topicList", topicList);
		this.getRequest().setAttribute("tnum", topicList.size());
		return "users/detail";
	}

	@RequestMapping("addTopic.action")
	public String addTopic(Topic topic) {
		this.front();
		if (this.getSession().getAttribute("userid") == null) {
			return "redirect:/index/preLogin.action";
		}
		String userid = (String) this.getSession().getAttribute("userid");
		topic.setAddtime(VeDate.getStringDateShort());
		topic.setContents(this.getRequest().getParameter("contents"));
		topic.setJiancaiid(this.getRequest().getParameter("goodsid"));
		topic.setNum(this.getRequest().getParameter("num"));
		topic.setUsersid(userid);
		this.topicService.insertTopic(topic);
		return "redirect:/index/detail.action?id=" + topic.getJiancaiid();
	}

}

如果也想学习本系统,下面领取。关注并回复:085ssm  

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/61643.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

ElementUI组件-日期时间控件设置禁用日期

ElementUI组件-日期时间控件禁用指定日期 主要属性 查看官网&#xff0c;可以看到有个叫做picker-options的组件属性&#xff0c;没错&#xff0c;就是借助他来完成禁用指定日期的操作&#xff0c;如下 该属性值传入的是一个对象&#xff0c;对于时间选择器、日期选择器、日…

[阶段4 企业开发进阶] 3. 消息队列--RabbitMQ

文章目录1 消息队列1.1 MQ的概念基本介绍使用原因MQ分类如何选择1.2 RabbitMQRabbitMQ核心工作原理安装教程1 消息队列 1.1 MQ的概念 基本介绍 MQ本质是个队列&#xff0c;FIFO 先入先出&#xff0c;只不过队列中存放的内容是 message 而已是一种跨进程的通信机制&#xff0…

[附源码]计算机毕业设计校刊投稿系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Py之removebg:removebg的简介、安装、使用方法之详细攻略

Py之removebg&#xff1a;removebg的简介、安装、使用方法之详细攻略 目录 removebg的简介 1、官网注册获取APIKey removebg的安装 removebg的使用方法 1、直接调用并实现抠图 2、更多案例 removebg的简介 Remove Image Background&#xff0c;是一款不用PS就完成抠图的强…

每日挠头算法题(十五)螺旋矩阵II

“强大方能侠义” ------持续更新Blue Bridge杯入门系列算法实例-------- 如果你也喜欢Java和算法&#xff0c;欢迎订阅专栏共同学习交流&#xff01; 你的点赞、关注、评论、是我创作的动力&#xff01; -------希望我的文章对你有所帮助-------- 前言&#xff1a;最近可能…

【Python自学笔记】报错No module Named Wandb

【Python自学笔记】已经装了wandb&#xff0c;还报错No module Named Wandb 方法1.重启cmd和jupyter notebook 直接把窗口和cmd页面全关了&#xff0c;重新打开&#xff0c;再次运行安装和启动代码&#xff1a; !pip install wandbimport wandb wandb.init(project"你自…

【Matlab】一、解常微分方程ODE

文章目录求解常微分方程 ODE&#xff08;1&#xff09;求解解析解&#xff08;2&#xff09;求解数值解求解常微分方程 ODE ​ 在matlab中&#xff0c;我们可以求解常微分方程的解析解&#xff0c;和数值解&#xff0c;一般使用dsolve来求解常微分方程的解析解&#xff0c;使用…

jsp 上传文件及实体信息,ajax post 请求(formdata)报错400<======>前后端代码示例

Content-Type最常见的几种类型&#xff1a; 通常&#xff0c;没有声明&#xff0c;默认application/x-www-form-urlencoded application/x-www-form-urlencoded form表单默认的数据格式&#xff0c;提交的数据形式 key1val1&key2val2&#xff08;参数少&#xff09; mu…

[附源码]计算机毕业设计线上社区管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

〖全域运营实战白宝书 - 高转化文案速成篇③〗- 高打开率标题型文案的10大黄金法则

大家好&#xff0c;我是 哈士奇 &#xff0c;一位工作了十年的"技术混子"&#xff0c; 致力于为开发者赋能的UP主, 目前正在运营着 TFS_CLUB社区。 &#x1f4ac; 人生格言&#xff1a;优于别人,并不高贵,真正的高贵应该是优于过去的自己。&#x1f4ac; &#x1f4e…

第一期 | 整洁,从桌面开始

文章目录前言一、主要内容介绍二、文件分类&#xff0c;整理你的桌面1.网格对齐图标&#xff0c;取消自动排列2.保持工作状态&#xff0c;提取近期文件3.用好排序&#xff0c;让文件一目了然4.分类整理&#xff0c;让文件听你的话5.按照实际情况作调整三、合理归档&#xff0c;…

[附源码]JAVA毕业设计框架的企业机械设备智能管理系统的设计与实现(系统+LW)

[附源码]JAVA毕业设计框架的企业机械设备智能管理系统的设计与实现&#xff08;系统LW&#xff09; 目运行 环境项配置&#xff1a; Jdk1.8 Tomcat8.5 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支…

文献阅读-VQAR-基于计算机视觉和自然语言处理的信息检索技术综述

VQAR: Review on Information Retrieval Techniques based on Computer Vision and Natural Language Processing 标题&#xff1a;VQAR-基于计算机视觉和自然语言处理的信息检索技术综述 Authors&#xff1a;Shivangi ModiDhatri Pandya Journal&#xff1a;2019 3rd Inter…

在Docker中运行Dubbo应用,详细教程,一学就会

Dubbo概述 Dubbo是阿里开源的一个分布式服务框架&#xff0c;在国内粉丝很多。官网上的介绍是&#xff1a; DUBBO是一个分布式服务框架&#xff0c;致力于提供高性能和透明化的RPC远程服务调用方案&#xff0c;是阿里巴巴SOA服务化治理方案的核心框架&#xff0c;每天为2,000…

Spring_第2章_注解开发+整合Mybatis+Junit

Spring_第2章_注解开发整合MybatisJunit 文章目录Spring_第2章_注解开发整合MybatisJunit一、第三方资源配置管理1 管理DataSource连接池对象问题导入1.1 管理Druid连接池【重点】1.2 管理c3p0连接池2 加载properties属性文件【重点】问题导入2.1 基本用法2.2 配置不加载系统属…

浅谈Android输入法(IME)架构

简介&#xff1a; 输入法 (IME) 是一种可让用户输入文本的用户控件。Android 提供了一种可扩展的输入法框架。借助该框架&#xff0c;应用可以为用户提供备选输入法&#xff0c;例如屏幕键盘&#xff0c;甚至语音输入。安装所需的 IME 后&#xff0c;用户可以从系统设置中选择要…

每日一题:斐波那契数列

每日一题&#xff1a;斐波那契数列 我们先来看一下斐波那契数列的定义&#xff1a; 斐波那契数列&#xff08;Fibonacci sequence&#xff09;&#xff0c;又称黄金分割数列&#xff0c;因数学家莱昂纳多斐波那契&#xff08;Leonardo Fibonacci&#xff09;以兔子繁殖为例子而…

Linux进程调度(二)——主动调度

目录 分析__schedule() 第一步&#xff1a; 第二步&#xff1a; pick_next_task的实现如下&#xff1a; 第三步&#xff1a; 进程上下文切换 内存空间的切换&#xff1a; 寄存器和栈的切换switch_to 指令指针的保存与恢复 总结 进程的调度分为两种方式&#xff0c;本篇…

MOOC——多项式加法(5分)好难!

1.多项式加法&#xff08;5分&#xff09; 题目内容&#xff1a; 一个多项式可以表达为x的各次幂与系数乘积的和&#xff0c;比如&#xff1a; 2x63x512x36x20 现在&#xff0c;你的程序要读入两个多项式&#xff0c;然后输出这两个多项式的和&#xff0c;也就是把对应的幂…

java GUI 实现的socket在线聊天系统项目源码运行教程

大家好&#xff0c;今天给大家演示一下一个简单的图形界面的聊天程序&#xff0c;上次我们演示的是Java实现的群聊程序&#xff0c;还可以发送文件&#xff0c;今天这个小程序只能聊天&#xff0c;不能发文件&#xff0c;功能非常简单&#xff0c;可在局域网内实现互相聊天&…