package com.weishang.my.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.dom4j.DocumentException;
import com.weishang.my.pojo.Address;
import com.weishang.my.pojo.Aunt;
import com.weishang.my.pojo.AuntImg;
import com.weishang.my.pojo.CombineMarket;
import com.weishang.my.pojo.Comment;
import com.weishang.my.pojo.Coupon;
import com.weishang.my.pojo.GoodsPojo;
import com.weishang.my.pojo.User;
import com.weishang.my.service.CategoryService;
import com.weishang.my.service.ShopService;
import com.weishang.my.tool.SendMessageInfo;
import com.weishang.my.tool.StringUtil;
import com.weishang.pojo.Template;
import com.weishang.service.AdminService;
import com.weishang.service.GetNoCmsService;
import com.weishang.service.UserService;
import com.weishang.tool.AbstractServlet;
import com.weishang.tool.CommonUrl;
import com.weishang.tool.IsPhone;
import com.weishang.tool.Md5Util;
@WebServlet(displayName="前端基本信息",name="FrontAction",urlPatterns="/front")
public class FrontAction extends AbstractServlet{
private static final long serialVersionUID = 1L;
ShopService ss=new ShopService();
AdminService as=new AdminService();
UserService us=new UserService();
CategoryService cs=new CategoryService();
GetNoCmsService ps=new GetNoCmsService();
/**
* 获取商品详情
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
public void goodsDetail(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
response.setContentType("text/html;charset=UTF-8");
String jsp="";
Template tpl=null;
String tem_id=request.getParameter("id");
Integer id=0;
if(tem_id!=null && !tem_id.equals("")){
id=Integer.parseInt(tem_id);
}
GoodsPojo goods=null;
try {
tpl =us.getTemplate();
goods=ss.getGoodsPojoById(id);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.setAttribute("goods",goods);
if(goods.getCategory().getId().equals(17)){
request.setAttribute("special","x");
}else if(goods.getCategory().getId().equals(15)){
request.setAttribute("special","h");
}
jsp= "/template/"+tpl.getFolder()+"/page/goods_detail.jsp";//前台的手机jsp页面
RequestDispatcher rd = request.getRequestDispatcher(jsp);
rd.forward(request,response);
}
/**
* 获取外聘员工详情
* @param id外聘员工id
*/
public void auntDetail(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
response.setContentType("text/html;charset=UTF-8");
String jsp="";
Template tpl=null;
String tem_id=request.getParameter("id");
Integer id=0;
if(tem_id!=null && !tem_id.equals("")){
id=Integer.parseInt(tem_id);
}
Aunt aunt=null;
List<AuntImg> imgList=null;
List<Comment> commetnList=null;
try {
tpl =us.getTemplate();
aunt=ss.getAuntById(id);
commetnList=ss.getCommentByCmsId(1, 4, null, id.toString(),"0");
imgList=ss.getAuntImgByAunt(id, "aunt");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
request.setAttribute("aunt",aunt);
request.setAttribute("imgList",imgList);
request.setAttribute("commetnList",commetnList);
jsp= "/template/"+tpl.getFolder()+"/page/aunt_detail.jsp";//前台的手机jsp页面
RequestDispatcher rd = request.getRequestDispatcher(jsp);
rd.forward(request,response);
}
/**
* 活动下单第一步
*/
public void activetiOrderOne(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
response.setContentType("text/html;charset=UTF-8");
HttpSession session = request.getSession(true);
Object ordinary_user=session.getAttribute("ordinary_user");
Template tpl=null;
String jsp="";
try {
tpl = us.getTemplate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(ordinary_user==null){//非登陆用户
IsPhone isPhone=new IsPhone();
if(isPhone.JudgeIsMoblie(request)){
jsp= "/template/"+tpl.getFolder()+"/page/mobile/user_login.jsp";//前台的手机jsp页面
}else{
jsp= "/template/"+tpl.getFolder()+"/page/user_login.jsp";
}
RequestDispatcher rd = request.getRequestDispatcher(jsp);
rd.forward(request,response);
}else{//登陆用户
User user=(User)ordinary_user;
String integel=CommonUrl.getValue("integel");
String tem_id=request.getParameter("id");
Integer id=0;
if(tem_id!=null && !tem_id.equals("")){
id=Integer.parseInt(tem_id);
}
CombineMarket market=null;
List<Address> addressList=null;
try {
market=ss.getCombineMarketById(id);
addressList=ss.getAddressByUser(user.getId());
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}//获取正在使用的模板
IsPhone isPhone=new IsPhone();
if(isPhone.JudgeIsMoblie(request)){
jsp= "/template/"+tpl.getFolder()+"/page/mobile/activities_order_one.jsp";//前台的手机jsp页面
}else{
jsp= "/template/"+tpl.getFolder()+"/page/activities_order_one.jsp";
}
request.setAttribute("id",id);
request.setAttribute("market",market);
request.setAttribute("integel",integel);
request.setAttribute("addressList",addressList);
RequestDispatcher rd = request.getRequestDispatcher(jsp);
rd.forward(request,response);
}
}
/**
* 下订单第一步
*/
public void goodsOrderOne(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
response.setContentType("text/html;charset=UTF-8");
HttpSession session = request.getSession(true);
Object ordinary_user=session.getAttribute("ordinary_user");
Template tpl=null;
String jsp="";
try {
tpl = us.getTemplate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(ordinary_user==null){//非登陆用户
IsPhone isPhone=new IsPhone();
if(isPhone.JudgeIsMoblie(request)){
jsp= "/template/"+tpl.getFolder()+"/page/user_login.jsp";//前台的手机jsp页面
}else{
jsp= "/template/"+tpl.getFolder()+"/page/user_login.jsp";
}
RequestDispatcher rd = request.getRequestDispatcher(jsp);
rd.forward(request,response);
}else{//登陆用户
String special=request.getParameter("sp");//特殊的标志(此处是用来表示接送机),不为空或者不为null就为接送机
User user=(User)ordinary_user;
List<Coupon> couponList=null;
String integel=CommonUrl.getValue("integel");
String tem_id=request.getParameter("id");
Integer id=0;
if(tem_id!=null && !tem_id.equals("")){
id=Integer.parseInt(tem_id);
}
GoodsPojo goods=null;
List<Address> addressList=null;
try {
goods=ss.getGoodsPojoById(id);
addressList=ss.getAddressByUser(user.getId());
couponList=ss.getUserCouponByUsername(user.getUsername(),1);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}//获取正在使用的模板
IsPhone isPhone=new IsPhone();
if(isPhone.JudgeIsMoblie(request)){
jsp= "/template/"+tpl.getFolder()+"/page/order_one.jsp";//前台的手机jsp页面
}else{
jsp= "/template/"+tpl.getFolder()+"/page/order_one.jsp";
}
if(goods.getCategory().getId().equals(17)){
request.setAttribute("special","x");
}else if(goods.getCategory().getId().equals(15)){
request.setAttri
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
环境jdk1.7 (及以上)+mysql5.0(及以上)+tomcat8(及以上) 系统基于租车业务而搭建的服务平台,可为用户提供商务租车、接送机、旅游租车、企业租车、自驾租车、婚庆用车等自助租车服务。系统根据相关版本提供相关内容服务。包含车辆库管理、司机管理、订单管理、活动管理、评价管理等。 安装运行程序: (1)将解压文件夹中的opencarrun安装包复制到tomcat-->webapps--> 下; (2)将sql导入mysql; (3)启动tomcat; (4)启动完毕后,前台访问地址:http://localhost:8080/opencarrun/ 后台访问地址:http://localhost:8080/opencarrun/admin/login (默认账号:adimin 默认密码:zft3285497) 3、开发包安装 打开MyEclipse-->File-->Import-->选择Existing Porjects into Workspace-->Next-->Select root directory 选择刚才解压的开发包文件中
资源推荐
资源详情
资源评论
收起资源包目录
基于Java web的租车系统(前后端源码+数据库).zip (2082个子文件)
spellchecker.cfm 5KB
spellchecker.cfm 5KB
FrontAction.class 15KB
FrontAction.class 15KB
CommonUserAction.class 8KB
CommonUserAction.class 8KB
GoodsList.class 6KB
GoodsList.class 6KB
Auto.class 5KB
Auto.class 5KB
UserCancelOrder.class 5KB
UserCancelOrder.class 5KB
AuntList.class 4KB
AuntList.class 4KB
ThematicList.class 4KB
ThematicList.class 4KB
PromotPackage.class 4KB
PromotPackage.class 4KB
PcUserAddOrderTwo.class 4KB
PcUserAddOrderTwo.class 4KB
PcUserOrder.class 4KB
PcUserOrder.class 4KB
PcUserMoney.class 4KB
PcUserMoney.class 4KB
WxUpdateUserInfo.class 4KB
WxUpdateUserInfo.class 4KB
PcUserAddAddress.class 4KB
PcUserAddAddress.class 4KB
LookPageDetail.class 4KB
LookPageDetail.class 4KB
ThematicPage.class 4KB
ThematicPage.class 4KB
PcUpdateUserPass.class 3KB
PcUpdateUserPass.class 3KB
WxDeleteAddress.class 3KB
WxDeleteAddress.class 3KB
Help.class 3KB
Help.class 3KB
PcUserIndex.class 3KB
PcUserIndex.class 3KB
PcUserGetCoupon.class 3KB
PcUserGetCoupon.class 3KB
GoPetition.class 3KB
GoPetition.class 3KB
PcUserAddress.class 3KB
PcUserAddress.class 3KB
EnterpriseService.class 3KB
EnterpriseService.class 3KB
PcUsercoupon.class 3KB
PcUsercoupon.class 3KB
GoUserRecharge.class 3KB
GoUserRecharge.class 3KB
ReceptAction.class 2KB
ReceptAction.class 2KB
PcGoUserPass.class 2KB
PcGoUserPass.class 2KB
PcLoginOut.class 2KB
PcLoginOut.class 2KB
PcUserIntegel.class 2KB
PcUserIntegel.class 2KB
.classpath 1KB
org.eclipse.wst.common.component 480B
org.eclipse.wst.jsdt.ui.superType.container 49B
pintuer.css 111KB
pintuer.css 111KB
base.css 99KB
base.css 99KB
layout.css 52KB
layout.css 52KB
index.css 49KB
index.css 49KB
style_pc.css 47KB
style_pc.css 47KB
editor.css 34KB
editor.css 34KB
admin_lay.css 23KB
admin_lay.css 23KB
dialog.css 22KB
dialog.css 22KB
layer.css 11KB
layer.css 11KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
fck_editor.css 8KB
swyc.css 7KB
swyc.css 7KB
fck_dialog.css 6KB
fck_dialog.css 6KB
fck_dialog.css 6KB
fck_dialog.css 6KB
fck_dialog.css 6KB
fck_dialog.css 6KB
tanchu.css 6KB
tanchu.css 6KB
fck_dialog.css 6KB
共 2082 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
等天晴i
- 粉丝: 3391
- 资源: 10万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页