• 大小: 13.13MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-02
  • 语言: JavaScript
  • 标签: ssm  

资源简介

此系统采用SSM框架,严格按照MVC设计模式,后台管理员对拍卖商品进行管理后,前台用户通过条件查询各类竞拍商品并在规定时间内对商品在线竞拍,至拍卖结束日期后竞价记录最高者则竞拍成功。主要功能模块:商品信息发布管理、竞价管理、商品查询管理、商品信息修改、商品下架管理等 所用技术:Springmvc + MyBatis + Spring + JavaScript + Oracle

资源截图

代码片段和文件信息

package cn.auction.controller;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import com.github.pagehelper.PageInfo;

import cn.auction.pojo.Auction;
import cn.auction.pojo.AuctionCustom;
import cn.auction.pojo.Auctionrecord;
import cn.auction.pojo.Auctionuser;
import cn.auction.pojo.QueryExample;
import cn.auction.service.AuctionService;

@Controller
@RequestMapping(“/auction“)
public class AuctionController {

public static final int PAGESIZE = 3;
@Autowired
private AuctionService auctionService;

@RequestMapping(“/queryAuctions“)
public ModelAndView queryAuctions(
@RequestParam(value=“pageNo“defaultValue=“1“required=false) int pageNo
@ModelAttribute(“query“) QueryExample qe) {
//数据回显
//@ModelAttribute(“query“) QueryExample qe  没有写这个注解默认是queryExample自己会保存在request域中
ModelAndView modelAndView = new ModelAndView();
List auctionList = auctionService.findAuctionByPage(pageNo PAGESIZEqe);
//获取分页的一些基本数据,例如总页数什么的
PageInfo pageInfo = new PageInfo(auctionList);

modelAndView.addobject(“auctionList“ auctionList);
modelAndView.addobject(“pageInfo“ pageInfo);
modelAndView.setViewName(“index“);
return modelAndView;
}

@RequestMapping(“/publishAuctions“)
public String publishAuctions(Auction auctionMultipartFile picHttpSession session) {
try {
if(!pic.isEmpty()) {
//得到存放的目录
String path = session.getServletContext().getRealPath(“pic“);
//文件名
String filename = pic.getOriginalFilename();
File targetFile = new File(path filename);
//pic另存到tomcat的目录
pic.transferTo(targetFile);
auction.setAuctionpic(filename);
} else {
auction.setAuctionpic(“111“);
}
} catch (IOException e) {
e.printStackTrace();
}
auctionService.addAuction(auction);
return “redirect:/auction/queryAuctions“;
}

@RequestMapping(“/queryAuctionDetail/{auctionid}“)
public ModelAndView queryAuctionDetail(@PathVariable int auctionid) {
ModelAndView modelAndView = new ModelAndView();
Auction auction = auctionService.findAuction(auctionid);
modelAndView.addobject(“auction“ auction);
modelAndView.setViewName(“updateAuction“);
return modelAndView;
}

@RequestMapping(“/updateAuction“)
public String updateAuction(Auction auctionMultipartFile picHttpSession session) {
try {
if(!pic.

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-24 20:37  MyAuction\
     文件        1209  2017-08-24 20:39  MyAuction\.classpath
     文件        1542  2017-08-23 17:47  MyAuction\.project
     目录           0  2017-08-24 20:37  MyAuction\.settings\
     文件         522  2017-08-21 09:10  MyAuction\.settings\.jsdtscope
     文件          79  2017-08-23 17:47  MyAuction\.settings\com.genuitec.eclipse.migration.prefs
     文件         364  2017-08-21 09:10  MyAuction\.settings\org.eclipse.jdt.core.prefs
     文件         565  2017-08-21 09:22  MyAuction\.settings\org.eclipse.wst.common.component
     文件         172  2017-08-23 17:47  MyAuction\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         462  2017-08-23 17:47  MyAuction\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-08-21 09:10  MyAuction\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-08-21 09:10  MyAuction\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          66  2017-08-23 17:47  MyAuction\.tern-project
     目录           0  2017-08-24 20:37  MyAuction\config\
     文件         372  2017-08-22 13:59  MyAuction\config\CustomValidationMessages.properties
     文件         135  2017-08-11 11:00  MyAuction\config\db.properties
     文件         421  2017-08-11 09:25  MyAuction\config\log4j.properties
     目录           0  2017-08-24 20:37  MyAuction\config\mybatis\
     文件         689  2017-08-22 14:09  MyAuction\config\mybatis\SqlMapConfig.xml
     目录           0  2017-08-24 20:37  MyAuction\config\spring\
     文件        1839  2017-08-21 09:24  MyAuction\config\spring\applicationContext-dao.xml
     文件        1109  2017-08-21 09:24  MyAuction\config\spring\applicationContext-service.xml
     文件        1794  2017-08-22 15:31  MyAuction\config\spring\applicationContext-transaction.xml
     文件        3613  2017-08-22 15:10  MyAuction\config\spring\springmvc.xml
     目录           0  2017-08-24 20:37  MyAuction\src\
     目录           0  2017-08-24 20:37  MyAuction\src\cn\
     目录           0  2017-08-24 20:37  MyAuction\src\cn\auction\
     目录           0  2017-08-24 20:37  MyAuction\src\cn\auction\controller\
     文件        5472  2017-08-24 10:09  MyAuction\src\cn\auction\controller\AuctionController.java
     文件         539  2017-08-22 16:15  MyAuction\src\cn\auction\controller\DateConverter.java
     文件        2513  2017-08-22 14:18  MyAuction\src\cn\auction\controller\UserController.java
............此处省略150个文件信息

评论

共有 条评论