package com.action;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.dao.TCatelogDAO;
import com.dao.TCommentDAO;
import com.dao.TGoodsDAO;
import com.dao.TOrderItemDAO;
import com.model.TCatelog;
import com.model.TGoods;
import com.model.TOrderItem;
import com.model.TUser;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class goodsAction extends ActionSupport
{
private Integer goodsId;
private Integer dianpuId;
private String goodsName;
private String publisher;
private String isbn;
private String author;
private String publishtime;
private String goodsMiaoshu;
private String goodsPic;
private Integer goodsShichangjia;
private Integer goodsTejia;
private String goodsYangshi;
private Integer goodsCatelogId;
private Integer goodsNum;
private String goodsDel;
private String message;
private String path;
private TGoodsDAO goodsDAO;
private TCommentDAO commentDAO;
private TOrderItemDAO orderItemDAO;
public String goodsAdd()
{
HttpServletRequest re=ServletActionContext.getRequest();
String fujian=re.getParameter("fujian");
TGoods goods=new TGoods();
goods.setGoodsCatelogId(goodsCatelogId);
goods.setGoodsName(goodsName);
goods.setPublisher(publisher);
goods.setIsbn(isbn);
goods.setPublishtime(publishtime);
goods.setAuthor(author);
goods.setGoodsMiaoshu(goodsMiaoshu);
goods.setGoodsPic(fujian);
goods.setGoodsShichangjia(goodsShichangjia);
goods.setGoodsTejia(goodsShichangjia);
goods.setGoodsYangshi(goodsYangshi);
goods.setGoodsNum(goodsNum);
goods.setGoodsDel("no");
goodsDAO.save(goods);
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("msg", "商品发布完毕");
return "msg";
}
public String toUpdate(){
TGoods goods=goodsDAO.findById(goodsId);
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("goods", goods);
return SUCCESS;
}
public String update(){
HttpServletRequest re=ServletActionContext.getRequest();
String fujian=re.getParameter("fujian");
TGoods goods=goodsDAO.findById(goodsId);
goods.setGoodsName(goodsName);
goods.setPublisher(publisher);
goods.setIsbn(isbn);
goods.setPublishtime(publishtime);
goods.setAuthor(author);
goods.setGoodsMiaoshu(goodsMiaoshu);
goods.setGoodsPic(fujian);
goods.setGoodsShichangjia(goodsShichangjia);
goods.setGoodsTejia(goodsShichangjia);
goods.setGoodsYangshi(goodsYangshi);
goods.setGoodsNum(goodsNum);
goodsDAO.attachDirty(goods);
this.setMessage("操作成功");
this.setPath("goodsMana.action");
return "succeed";
}
public String goodsMine()
{
Map session = ActionContext.getContext().getSession();
String sql="from TGoods where goodsDel='no'";
List goodsList=goodsDAO.getHibernateTemplate().find(sql);
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("goodsList", goodsList);
return ActionSupport.SUCCESS;
}
public String goodsDel()
{
TGoods goods=goodsDAO.findById(goodsId);
goods.setGoodsDel("yes");
goodsDAO.attachDirty(goods);
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("msg", "删除完毕");
return "msg";
}
public String goodsMana()
{
String sql="from TGoods where goodsDel='no'";
List goodsList=goodsDAO.getHibernateTemplate().find(sql);
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("goodsList", goodsList);
return ActionSupport.SUCCESS;
}
public String goodsDetailHou()
{
Map request=(Map)ServletActionContext.getContext().get("request");
TGoods goods=goodsDAO.findById(goodsId);
request.put("goods", goods);
return ActionSupport.SUCCESS;
}
public String goodsAllNoTejia()
{
Map request=(Map)ServletActionContext.getContext().get("request");
String sql="from TGoods where goodsDel='no' order by goodsCatelogId";
List goodsList=goodsDAO.getHibernateTemplate().find(sql);
request.put("goodsList", goodsList);
return ActionSupport.SUCCESS;
}
public String goodsDetailQian()
{
Map session= ServletActionContext.getContext().getSession();
TUser user=(TUser)session.get("user");
Map request=(Map)ServletActionContext.getContext().get("request");
TGoods goods=goodsDAO.findById(goodsId);
request.put("goods", goods);
Integer count=0;
if(user!=null){
count=orderItemDAO.shifougoumai(goods.getGoodsId(),user.getUserId());
request.put("count", count);
}
List comments=commentDAO.findByProperty("goods.goodsId", goods.getGoodsId());
request.put("comments", comments);
return ActionSupport.SUCCESS;
}
public String goodsByCatelog()
{
Map request=(Map)ServletActionContext.getContext().get("request");
String sql="from TGoods where goodsDel='no' and goodsCatelogId=? order by goodsCatelogId";
Object[] con={goodsCatelogId};
List goodsList=goodsDAO.getHibernateTemplate().find(sql,con);
request.put("goodsList", goodsList);
return ActionSupport.SUCCESS;
}
public Integer getGoodsId()
{
return goodsId;
}
public void setGoodsId(Integer goodsId)
{
this.goodsId = goodsId;
}
public Integer getDianpuId()
{
return dianpuId;
}
public void setDianpuId(Integer dianpuId)
{
this.dianpuId = dianpuId;
}
public String getGoodsName()
{
return goodsName;
}
public void setGoodsName(String goodsName)
{
this.goodsName = goodsName;
}
public String getPublisher()
{
return publisher;
}
public void setPublisher(String publisher)
{
this.publisher = publisher;
}
public String getIsbn()
{
return isbn;
}
public void setIsbn(String isbn)
{
this.isbn = isbn;
}
public String getAuthor()
{
return author;
}
public void setAuthor(String author)
{
this.author = author;
}
public String getPublishtime()
{
return publishtime;
}
public void setPublishtime(String publishtime)
{
this.publishtime = publishtime;
}
public String getGoodsMiaoshu()
{
return goodsMiaoshu;
}
public void setGoodsMiaoshu(String goodsMiaoshu)
{
this.goodsMiaoshu = goodsMiaoshu;
}
public String getGoodsPic()
{
return goodsPic;
}
public void setGoodsPic(String goodsPic)
{
this.goodsPic = goodsPic;
}
public Integer getGoodsShichangjia()
{
return goodsShichangjia;
}
public void setGoodsShichangjia(Integer goodsShichangjia)
{
this.goodsShichangjia = goodsShichangjia;
}
public Integer getGoodsTejia()
{
return goodsTejia;
}
public void setGoodsTejia(Integer goodsTejia)
{
this.goodsTejia = goodsTejia;
}
public Integer getGoodsCatelogId()
{
return goodsCatelogId;
}
public void setGoodsCatelogId(Integer goodsCatelogId)
{
this.goodsCatelogId = goodsCatelogId;
}
public String getGoodsDel()
{
return goodsDel;
}
public void setGoodsDel(String goodsDel)
{
this.goodsDel = goodsDel;
}
public String getMessage()
{
return message;
}
public void setMessage(String message)
{
this.message = message;
}
public String getPath()
{
return path;
}
public void setPath(String path)
{
this.path = path;
}
public TGoodsDAO getGoodsDAO()
{
return goodsDAO;
}
public void setGoodsDAO(TGoodsDAO goodsDAO)
{
this.goodsDAO = goodsDAO;
}
public String getGoodsYangshi() {
return goodsYangshi;
}
public void setGoodsYangshi(String goodsYangshi) {
this.goodsYangshi = goodsYangshi;
}
public TCommentDAO
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计&课设_美妆购物商城管理系统:Java 毕设项目,含代码,提供多种服务.zip (595个子文件)
banner.231png 86KB
goodsAction.class 9KB
buyAction.class 8KB
TOrderItemDAO.class 6KB
UserAction.class 6KB
xiaoshouAction.class 6KB
TOrderDAO.class 6KB
TGoodsDAO.class 6KB
TCatelogDAO.class 5KB
TLiuyanDAO.class 5KB
TAdminDAO.class 5KB
TGonggaoDAO.class 5KB
TCommentDAO.class 5KB
TUserDAO.class 5KB
commentAction.class 4KB
liuyanAction.class 4KB
catelogAction.class 4KB
gonggaoAction.class 4KB
upload.class 4KB
TGoods.class 4KB
indexAction.class 4KB
loginService.class 3KB
adminAction.class 3KB
xiaoshouAction$2.class 3KB
xiaoshouAction$1.class 3KB
Util.class 3KB
Cart.class 2KB
cartService.class 2KB
TLiuyan.class 2KB
TOrderItemDAO$1.class 2KB
TOrder.class 2KB
TUser.class 2KB
TOrderItem.class 2KB
TComment.class 2KB
safeFileter.class 2KB
TOrderItemDAO$2.class 2KB
TGonggao.class 1KB
TOrderDAO$1.class 1KB
TAdmin.class 1KB
catelogService.class 1KB
TCatelog.class 1KB
bootstrap.css 124KB
Common.css 93KB
samples.css 66KB
style.css 35KB
editor_ie8.css 31KB
editor_iequirks.css 31KB
editor_ie.css 31KB
editor_gecko.css 30KB
editor.css 30KB
dialog_ie8.css 15KB
dialog_iequirks.css 14KB
dialog_ie.css 14KB
dialog.css 13KB
codemirror.css 8KB
datepicker.css 5KB
sample.css 5KB
datepicker.css 5KB
base.css 5KB
component.css 5KB
etalage.css 4KB
datepicker.css 4KB
datepicker.css 4KB
contents.css 3KB
outputxhtml.css 2KB
fontello.css 2KB
neo.css 851B
show-hint.css 700B
sitegeneric08.css 532B
WdatePicker.css 158B
WdatePicker.css 158B
.DS_Store 6KB
fontello.eot 5KB
index_icon.gif 20KB
login_11.gif 9KB
login_06.gif 5KB
kabg.gif 5KB
login_10.gif 4KB
Car_icon_02.gif 4KB
login_03.gif 4KB
Car_icon_03.gif 3KB
spinner.gif 3KB
login_07.gif 3KB
loading32.gif 3KB
menu_top.gif 3KB
loading.gif 2KB
login_08.gif 2KB
login_09.gif 2KB
Car_icon_01.gif 2KB
menubg.gif 2KB
img.gif 2KB
img.gif 2KB
img.gif 2KB
img.gif 2KB
me03.gif 1KB
globe.gif 1KB
book.gif 1KB
reg.gif 1KB
trash.gif 1KB
question.gif 1KB
共 595 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
pk_xz123456
- 粉丝: 2859
- 资源: 4045
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 精选毕设项目-IT书单.zip
- 精选毕设项目-kindle图书商城小程序.zip
- 精选毕设项目-V2EX社区小程序.zip
- 精选毕设项目-爱卡汽车.zip
- 精选毕设项目-包裹转运物流小程序.zip
- 精选毕设项目-奥多停车小程序.zip
- 精选毕设项目-百思不得姐.zip
- 精选毕设项目-兵马俑小程序(含语音画册与实时导览).zip
- 精选毕设项目-宝可梦图鉴(游戏小程序).zip
- 精选毕设项目-茶铺门店小程序.zip
- 精选毕设项目-滴滴拼车.zip
- 精选毕设项目-地图定位.zip
- 精选毕设项目-滴滴作业.zip
- 精选毕设项目-电梯品牌商城.zip
- 精选毕设项目-东航旅行.zip
- 精选毕设项目-多肉植物图鉴.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功