package action;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.persistence.criteria.Order;
import org.apache.struts2.ServletActionContext;
import org.hibernate.mapping.Collection;
import utils.MyFileUtil;
import com.opensymphony.xwork2.ActionSupport;
import dao.EvaluationDao;
import dao.OrderShoesDao;
import dao.ShoesDao;
import daoImpl.ShoesDaoImpl;
import entity.Brand;
import entity.Client;
import entity.Evaluation;
import entity.OrderShoes;
import entity.Shoes;
public class ShoesAction extends SuperAction {
private ShoesDao shoesDao;
private Brand brand;
private List<OrderShoes> shoppingCarShoes;
private Shoes shoes;
private Evaluation evaluation;
private EvaluationDao evaluationDao;
private MyFileUtil brandPhoto;
private MyFileUtil evaluationPhoto;
private MyFileUtil smallPhoto;
private MyFileUtil bigPhoto;
private OrderShoesDao orderShoesDao;
private String searchStr;
public MyFileUtil getBrandPhoto() {
return brandPhoto;
}
public void setBrandPhoto(MyFileUtil brandPhoto) {
this.brandPhoto = brandPhoto;
}
public String getSearchStr() {
return searchStr;
}
public void setSearchStr(String searchStr) {
this.searchStr = searchStr;
}
public OrderShoesDao getOrderShoesDao() {
return orderShoesDao;
}
public void setOrderShoesDao(OrderShoesDao orderShoesDao) {
this.orderShoesDao = orderShoesDao;
}
public MyFileUtil getEvaluationPhoto() {
return evaluationPhoto;
}
public void setEvaluationPhoto(MyFileUtil evaluationPhoto) {
this.evaluationPhoto = evaluationPhoto;
}
public MyFileUtil getSmallPhoto() {
return smallPhoto;
}
public void setSmallPhoto(MyFileUtil smallPhoto) {
this.smallPhoto = smallPhoto;
}
public MyFileUtil getBigPhoto() {
return bigPhoto;
}
public void setBigPhoto(MyFileUtil bigPhoto) {
this.bigPhoto = bigPhoto;
}
public Evaluation getEvaluation() {
return evaluation;
}
public void setEvaluation(Evaluation evaluation) {
this.evaluation = evaluation;
}
public EvaluationDao getEvaluationDao() {
return evaluationDao;
}
public void setEvaluationDao(EvaluationDao evaluationDao) {
this.evaluationDao = evaluationDao;
}
public Shoes getShoes() {
return shoes;
}
public void setShoes(Shoes shoes) {
this.shoes = shoes;
}
public ShoesDao getShoesDao() {
return shoesDao;
}
public void setShoesDao(ShoesDao shoesDao) {
this.shoesDao = shoesDao;
}
public Brand getBrand() {
return brand;
}
public void setBrand(Brand brand) {
this.brand = brand;
}
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("execute");
// queryShoesByBrand();
return SUCCESS;
}
public String queryAllShoes() {
queryAllBrand();
List<Shoes> shoesList = shoesDao.getAllShoes();
if (shoesList != null && shoesList.size() > 0) {
session.setAttribute("shoes_list", shoesList);
}
System.out.println(shoesList.size());
if (request.getParameter("user") != null) {
return "admin_shoes_list";
}
return "shoes_list";
}
public String queryShoesById() {
int sid = Integer.valueOf(request.getParameter("sid"));
System.out.println("sid"+sid);
Shoes s = shoesDao.getShoesById(sid);
session.setAttribute("shoes_detial", s);
List<Evaluation> allEvaluations = new ArrayList<Evaluation>();
List<OrderShoes> orderShoes = orderShoesDao.queryOrderByShoes(sid);
for(OrderShoes os:orderShoes){
List<Evaluation> evaluations = evaluationDao.queryEvaluationByOidUserInShoesDetial(os.getOid());
allEvaluations.addAll(evaluations);
}
//System.out.println(allEvaluations.get(0).getOrderShoes().getClient().getNickName());
session.setAttribute("allEvaluations", allEvaluations);
if (request.getParameter("fuction").equals("update")) {
return "admin_shoes_detial";
}else {
return "shoes_detial";
}
}
public String jumpEvaluation() {
int oid = Integer.valueOf(request.getParameter("eOId"));
Evaluation evaluation = evaluationDao.queryEvaluationByOid(oid);
if (evaluation!=null) {
session.setAttribute("evaluation",evaluation);
return "browser_evaluation_succuss";
}
session.setAttribute("eOId", oid);
return "jumpEvaluation_success";
}
public String insertEvaluation() throws Exception {
int oid = (Integer) session.getAttribute("eOId");
OrderShoes orderShoes = orderShoesDao.queryOrderByOid(oid);
System.out.println(oid);
String pathString = evaluationPhoto.uploadPhoto("evalue");
evaluation.setOrderShoes(orderShoes);
evaluation.setEvaluePicturePath(pathString);
evaluationDao.saveEvaluation(evaluation);
return "evalue_success";
}
public String insertShoes() throws Exception {
System.out.println(brand.getBid());
brand = shoesDao.queryBrandById(brand.getBid());
shoes.setBrand(brand);
String smallPicturePath = smallPhoto.uploadPhoto("shoesSmall");
String bigPicturePath = bigPhoto.uploadPhoto("shoesBig");
shoes.setBigPicturePath(bigPicturePath);
shoes.setSmallPicturePath(smallPicturePath);
shoesDao.saveShoes(shoes);
List<Shoes> shoess = (List<Shoes>) session.getAttribute("shoes_list");
if (shoess==null) {
shoess=new ArrayList<Shoes>();
}
shoess.add(shoes);
session.setAttribute("shoes_list", shoess);
return "shoes_insert";
}
public String showGenderShoes() {
String gender = request.getParameter("gender");
if (gender.equals("boy")) {
gender = "男";
} else {
gender = "女";
}
List<Shoes> shoesGenderList = shoesDao.queryShoesByGender(gender);
session.setAttribute("shoes_gender_list", shoesGenderList);
return "shoes_gender";
}
public String updateShoes() throws Exception {
Shoes s = (Shoes) session.getAttribute("shoes_detial");
shoes.setSid(s.getSid());
if (smallPhoto != null) {
String smallPicturePath = smallPhoto.uploadPhoto("shoesSmall");
shoes.setSmallPicturePath(smallPicturePath);
} else {
shoes.setSmallPicturePath(s.getSmallPicturePath());
}
if (bigPhoto != null) {
String bigPicturePath = bigPhoto.uploadPhoto("shoesBig");
shoes.setBigPicturePath(bigPicturePath);
} else {
shoes.setBigPicturePath(s.getBigPicturePath());
}
shoesDao.updateShoes(shoes);
return "shoes_update";
}
public String insertBrand() throws Exception {
System.out.println("调用");
//System.out.println("photo"+brandPhoto);
//String str = brandPhoto.uploadPhoto("brand");
//brand.setBrandPhoto(str);
shoesDao.saveBrand(brand);
return "brand_save_success";
}
public String queryAllBrand() {
List<Brand> brands = shoesDao.queryAllBrand();
System.out.println(brands.size());
System.out.println(brands.get(0).getBcname());
session.setAttribute("brand_list", brands);
return "brand_query_success";
}
public String addShoppingCar() {
int tempShoesNum = Integer
.valueOf(request.getParameter("tempShoesNum"));
System.out.println(tempShoesNum);
if (session.getAttribute("online_client") == null) {
return "add_shopingcar_faliure";
}
if (session.getAttribute("shoppingcar") == null) {
shoppingCarShoes = new ArrayList<OrderShoes>();
} else {
shoppingCarShoes = (List<OrderShoes>) session
.getAttribute("shoppingcar");
}
Shoes shoes = (Shoes) session.getAttribute("shoes_detial");
OrderShoes shoesBuy = new OrderShoes();
shoesBuy.setNum(tempShoesNum);
shoesBuy.setShoes(shoes);
System.out.println(shoesBuy.getNum());
shoesBuy.setPayment(tempShoesNum * shoes.getPrice());
System.out.print
没有合适的资源?快使用搜索试试~ 我知道了~
鞋子商城购物系统java+structs实现 源码+页面
共1126个文件
jpg:458个
png:417个
html:44个
需积分: 0 0 下载量 18 浏览量
2023-10-24
22:45:43
上传
评论
收藏 125.93MB ZIP 举报
温馨提示
鞋子商城购物系统java+structs实现源码+页面,实现登陆,购物,下单,会员,优惠等模块功能
资源推荐
资源详情
资源评论
收起资源包目录
鞋子商城购物系统java+structs实现 源码+页面 (1126个子文件)
ShoesAction.class 11KB
ClientAction.class 4KB
adminLoginFilter.class 4KB
clientLoginFilter.class 4KB
AdminAction.class 3KB
ShoesDaoImpl.class 3KB
Shoes.class 3KB
MyFileUtil.class 3KB
HibernateSessionFactory.class 3KB
RegisterAction.class 2KB
OrderShoesDaoImpl.class 2KB
OrderShoes.class 2KB
Client.class 2KB
Evaluation.class 2KB
Inventory.class 2KB
testSessionFactory.class 2KB
RegisterAction2.class 2KB
Brand.class 2KB
EvaluationDaoImpl.class 2KB
ClientDaoImpl.class 2KB
AdminDaoImpl.class 1KB
SuperAction.class 1KB
adminAuthInterceptor.class 1KB
clientAuthInterceptor.class 1KB
Administrator.class 1KB
QueryAction.class 1KB
AddAddressAction.class 1KB
Address.class 885B
ClientDaoImpl2.class 682B
ShoesDao.class 646B
OrderShoesDao.class 470B
EvaluationDao.class 350B
OrderAction.class 293B
ClientDao.class 260B
AdminDao.class 224B
.classpath 3KB
org.eclipse.wst.common.component 614B
org.eclipse.wst.jsdt.ui.superType.container 49B
templatemo_style.css 11KB
login.css 3KB
fangda.css 2KB
goumai.css 2KB
lanmu.css 2KB
nivo-slider.css 1KB
top.css 1KB
.DS_Store 10KB
.DS_Store 8KB
.DS_Store 6KB
2co.gif 3KB
loading.gif 3KB
prevlabel.gif 1KB
nextlabel.gif 1KB
paypal.gif 1KB
closelabel.gif 979B
remove_x.gif 119B
new balance3.html 10KB
yundong2.html 10KB
luotuo3.html 10KB
luotuo2.html 10KB
yundong1.html 10KB
luotuo1.html 10KB
caoren2.html 10KB
luotuo4.html 10KB
yundong4.html 10KB
adidas1.html 10KB
adidas4.html 10KB
anta2.html 9KB
new balance2.html 9KB
new balance1.html 9KB
yundong3.html 9KB
new balance4.html 9KB
vans1.html 9KB
vans3.html 9KB
xiuxian1.html 9KB
vans4.html 9KB
vans2.html 9KB
xiuxian2.html 9KB
xiuxian3.html 9KB
caoren1.html 9KB
anta4.html 9KB
xiuxian4.html 9KB
caoren4.html 9KB
lining3.html 9KB
anta1.html 9KB
caoren3.html 9KB
lining1.html 9KB
lining2.html 9KB
lining4.html 9KB
anta3.html 9KB
adidas2.html 9KB
nike4.html 9KB
nike3.html 9KB
gaogen3.html 9KB
gaogen4.html 9KB
gaogen2.html 9KB
gaogen1.html 9KB
nike1.html 9KB
nike2.html 9KB
adidas3.html 9KB
hibernate3.jar 3.75MB
共 1126 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
心似浮云️
- 粉丝: 163
- 资源: 69
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2022NOC软件创意编程赛项真题python小学高年级-决赛(有解析)
- mathml转换latex需要的xsl文件
- 2022NOC软件创意编程赛项真题图形化小学高年级-决赛赛(有解析)
- gbase驱动下载gbase-connector-java-8.3.81.53驱动下载
- 2022NOC软件创意编程赛项真题图形化小学低年级-决赛赛(有解析)
- InsightFace从青铜到王者,超大规模人脸识别的优雅解法
- python后端开发spider框架详解
- 基于 STM32 与 ESP8266 的智能家居系统源码.zip
- 毕业设计:基于SSM的mysql-个性化点餐配送系统(源码 + 数据库 + 说明文档)
- 基于matlab的鱼苗计数识别(GUI界面).zip代码57
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功