资源简介
secondHandBookstore.rar
代码片段和文件信息
package com.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.ServletActionContext;
import com.dao.TCatelogDAO;
import com.dao.TGoodsDAO;
import com.dao.TOrderDAO;
import com.dao.TOrderItemDAO;
import com.dao.TXiaoleibieDAO;
import com.model.TCatelog;
import com.model.TGoods;
import com.model.TOrder;
import com.model.TOrderItem;
import com.model.TUser;
import com.opensymphony.xwork2.ActionSupport;
import com.service.cartService;
import com.util.Cart;
public class buyAction extends ActionSupport
{
private int goodsId;
private int quantity;
private int orderId;
private TGoodsDAO goodsDAO;
private TOrderDAO orderDAO;
private TOrderItemDAO orderItemDAO;
private String message;
private String path;
private String odderSonghuodizhi;
private String odderFukuangfangshi;
private TCatelogDAO catelogDAO;
private TXiaoleibieDAO xiaoleibieDAO;
private String orderBianhao;
//添加商品到购物车
public String addToCart()
{
TGoods goods=goodsDAO.findById(goodsId);
TOrderItem orderItem=new TOrderItem();
orderItem.setGoods(goods);
orderItem.setGoodsQuantity(quantity);
Map session= ServletActionContext.getContext().getSession();
Cart cart = (Cart)session.get(“cart“);
cart.addGoods(goodsId orderItem);
session.put(“cart“cart);
//this.setMessage(““);
this.setPath(“myCart.action“);
return “succeed“;
}
public String myCart()
{
//图书类别
String sql=“from TCatelog where catelogDel=‘no‘“;
List cateLogList=catelogDAO.getHibernateTemplate().find(sql);
for(int i=0;i {
TCatelog catelog=(TCatelog)cateLogList.get(i);
String ss=“from TXiaoleibie where del=‘no‘ and catelogId=“+catelog.getCatelogId();
catelog.setXiaoleibieList(xiaoleibieDAO.getHibernateTemplate().find(ss));
}
Map request=(Map)ServletActionContext.getContext().get(“request“);
request.put(“cateLogList“ cateLogList);
return ActionSupport.SUCCESS;
}
//订单确认
public String orderQueren()
{
Map request=(Map)ServletActionContext.getContext().get(“request“);
return ActionSupport.SUCCESS;
}
//订单提交
public String orderSubmit()
{
Map session= ServletActionContext.getContext().getSession();
Cart cart = (Cart)session.get(“cart“);
TUser user=(TUser)session.get(“user“);
TOrder order=new TOrder();
order.setOrderBianhao(new SimpleDateFormat(“yyyyMMddhhmmss“).format(new Date()));
order.setOrderDate(new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss“).format(new Date()));
order.
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 834 2018-03-16 09:48 secondHandBookstore\.classpath
文件 1052 2018-03-16 09:48 secondHandBookstore\.project
文件 567 2018-03-16 09:48 secondHandBookstore\.settings\.jsdtscope
文件 79 2018-03-16 15:10 secondHandBookstore\.settings\org.eclipse.core.resources.prefs
文件 364 2018-03-16 09:48 secondHandBookstore\.settings\org.eclipse.jdt.core.prefs
文件 509 2018-03-16 09:48 secondHandBookstore\.settings\org.eclipse.wst.common.component
文件 345 2018-03-16 09:48 secondHandBookstore\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-03-16 09:48 secondHandBookstore\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-03-16 09:48 secondHandBookstore\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 10811 2018-03-18 17:35 secondHandBookstore\build\classes\com\action\buyAction.class
文件 6025 2018-03-17 15:20 secondHandBookstore\build\classes\com\action\catelogAction.class
文件 11259 2018-03-17 14:59 secondHandBookstore\build\classes\com\action\goodsAction.class
文件 2847 2018-03-16 15:23 secondHandBookstore\build\classes\com\action\indexAction.class
文件 3359 2018-03-16 15:23 secondHandBookstore\build\classes\com\action\pinglunAction.class
文件 9545 2018-03-17 12:07 secondHandBookstore\build\classes\com\action\UserAction.class
文件 3538 2018-03-17 15:42 secondHandBookstore\build\classes\com\action\xiaoleibieAction.class
文件 7690 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TAdminDAO.class
文件 5884 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TCatelogDAO.class
文件 6652 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TGoodsDAO.class
文件 5693 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TOrderDAO.class
文件 5622 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TOrderItemDAO.class
文件 5136 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TPinglunDAO.class
文件 7612 2018-03-17 10:39 secondHandBookstore\build\classes\com\dao\TUserDAO.class
文件 5208 2018-03-16 15:23 secondHandBookstore\build\classes\com\dao\TXiaoleibieDAO.class
文件 1149 2018-03-16 15:23 secondHandBookstore\build\classes\com\model\TAdmin.class
文件 782 2018-03-16 09:49 secondHandBookstore\build\classes\com\model\TAdmin.hbm.xm
文件 1310 2018-03-16 15:23 secondHandBookstore\build\classes\com\model\TCatelog.class
文件 809 2018-03-16 09:49 secondHandBookstore\build\classes\com\model\TCatelog.hbm.xm
文件 2421 2018-03-16 15:23 secondHandBookstore\build\classes\com\model\TGoods.class
文件 1710 2018-03-16 09:49 secondHandBookstore\build\classes\com\model\TGoods.hbm.xm
............此处省略1048个文件信息
相关资源
- blogSSM.rar
- onlineLearnSystem.rar
- CompTIASecurity+StudyGuide7thEdition.pdf
- 《深度学习之TensorFlow:入门、原理与
- UnderstandingDeepLearninginOneDay.rar
-
75882586Polyu_Pamprint_Databa
se(1).rar - 开放式工业控制系统的软件开发技术
- 频谱分析仪最终版程序.zip
- C题代码.zip
- 算法图解高清版.pdf.zip
- KaoQinMS.zip
- 实时绿幕抠像应用.zip
- 排样遗传算法.zip
- C仿传奇代码.rar
- 侯捷-STL源码解析视频教程及原书PDF
- delphi重庆医保支付demo.rar
- DiskGenius4.9.1-X64.rar
- xp430patch免墨盒程序.zip
- 微擎系统V2.0新版.zip
- DiskGeniusX86X64.rar
- Shadowrocketv2.1.21.ipa
- 前沿和目录(车载以太网).PDF
- SecureCRT中文免安装版.zip
- AI圣经深度学习.rar
- 金橙子激光打标软件EzCad免狗版.exe
- LoginWithReg.zip
- [David_C.Lay]_solution-manual-linear-algebra-a
- ASR_CNN.zip
- OptiFiber.v2.0.rar
- TIMS.zip
评论
共有 条评论