JAVA项目Spring校园旧书交易交换平台

目录

一、前言

二、技术介绍

三、项目实现流程

四、论文流程参考

五、核心代码截图

六、源码获取


专注于大学生实战开发、讲解和毕业答疑等辅导,获取源码后台

一、前言

现代校园旧书交易交换平台应当摒弃传统的人工管理模式,转而采用计算机技术进行信息管理。因此,本次系统设计的校园旧书交易交换平台集成了文字与图像处理功能,旨在实现校园旧书的高效交易与交换,这也是此类平台的核心要素。经过数年的实践与总结,校园旧书交易交换平台正朝着更加深入的方向发展。鉴于此,优化与提升系统功能显得尤为迫切。随着科技的迅猛发展,校园旧书交易交换平台亦需不断完善,以解决工作流程繁琐、多样化、管理复杂,以及收缴费用与设备维护繁琐等问题。因此,我们应充分利用计算机技术来胜任校园旧书交易交换的工作,使平台更加准确、便捷、高效。

二、技术介绍

开发语言:Java

框架:ssm

技术:JSP

JDK版本:JDK1.8

服务器:tomcat7

数据库:mysql 5.7

数据库工具:Navicat11

开发软件:eclipse/myeclipse/idea

Maven包:Maven3.3.9

浏览器:谷歌浏览器

三、项目实现截图

管理员登录进入校园旧书交易交换平台可以查看主页、个人中心、学生管理、发布人管理、书籍分类管理、书籍信息管理、交易信息管理、交换信息管理、系统管理等信息进行详细操作。

书籍信息管理;在书籍信息管理页面中可以对书籍编号、书籍名称、书籍分类、图片、作者、出版社、新旧程度、交易方式、发布人账号、发布人姓名等内容进行查看,修改和删除等操作。

交换信息管理;在交换信息管理页面中可以对交换编号、书籍名称、书籍分类、图片、新旧程度、交换时间、学生账号、学生姓名、发布人账号、发布人姓名、是否审核、审核回复等内容进行查看,修改和删除等操作。

四、系统总体结构参考

五、核心代码截图

@RestController
@RequestMapping("/jiaohuanxinxi")
public class JiaohuanxinxiController {
    @Autowired
    private JiaohuanxinxiService jiaohuanxinxiService;



    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,JiaohuanxinxiEntity jiaohuanxinxi, 
      HttpServletRequest request){

      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("xuesheng")) {
         jiaohuanxinxi.setXueshengzhanghao((String)request.getSession().getAttribute("username"));
      }
      if(tableName.equals("faburen")) {
         jiaohuanxinxi.setFaburenzhanghao((String)request.getSession().getAttribute("username"));
      }
        EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       PageUtils page = jiaohuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaohuanxinxi), params), params));
      request.setAttribute("data", page);
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
   @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,JiaohuanxinxiEntity jiaohuanxinxi, 
      HttpServletRequest request){
        EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       PageUtils page = jiaohuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaohuanxinxi), params), params));
      request.setAttribute("data", page);
        return R.ok().put("data", page);
    }

   /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( JiaohuanxinxiEntity jiaohuanxinxi){
           EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       ew.allEq(MPUtil.allEQMapPre( jiaohuanxinxi, "jiaohuanxinxi")); 
        return R.ok().put("data", jiaohuanxinxiService.selectListView(ew));
    }

    /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(JiaohuanxinxiEntity jiaohuanxinxi){
        EntityWrapper< JiaohuanxinxiEntity> ew = new EntityWrapper< JiaohuanxinxiEntity>();
      ew.allEq(MPUtil.allEQMapPre( jiaohuanxinxi, "jiaohuanxinxi")); 
      JiaohuanxinxiView jiaohuanxinxiView =  jiaohuanxinxiService.selectView(ew);
      return R.ok("查询交换信息成功").put("data", jiaohuanxinxiView);
    }
   
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        JiaohuanxinxiEntity jiaohuanxinxi = jiaohuanxinxiService.selectById(id);
        return R.ok().put("data", jiaohuanxinxi);
    }

    /**
     * 前端详情
     */
   @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        JiaohuanxinxiEntity jiaohuanxinxi = jiaohuanxinxiService.selectById(id);
        return R.ok().put("data", jiaohuanxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
       jiaohuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(jiaohuanxinxi);

        jiaohuanxinxiService.insert(jiaohuanxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
       jiaohuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(jiaohuanxinxi);

        jiaohuanxinxiService.insert(jiaohuanxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(jiaohuanxinxi);
        jiaohuanxinxiService.updateById(jiaohuanxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        jiaohuanxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
   @RequestMapping("/remind/{columnName}/{type}")
   public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
                   @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
      map.put("column", columnName);
      map.put("type", type);
      
      if(type.equals("2")) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         Date remindStartDate = null;
         Date remindEndDate = null;
         if(map.get("remindstart")!=null) {
            Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
            c.setTime(new Date()); 
            c.add(Calendar.DAY_OF_MONTH,remindStart);
            remindStartDate = c.getTime();
            map.put("remindstart", sdf.format(remindStartDate));
         }
         if(map.get("remindend")!=null) {
            Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
            c.setTime(new Date());
            c.add(Calendar.DAY_OF_MONTH,remindEnd);
            remindEndDate = c.getTime();
            map.put("remindend", sdf.format(remindEndDate));
         }
      }
      
      Wrapper<JiaohuanxinxiEntity> wrapper = new EntityWrapper<JiaohuanxinxiEntity>();
      if(map.get("remindstart")!=null) {
         wrapper.ge(columnName, map.get("remindstart"));
      }
      if(map.get("remindend")!=null) {
         wrapper.le(columnName, map.get("remindend"));
      }

      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("xuesheng")) {
         wrapper.eq("xueshengzhanghao", (String)request.getSession().getAttribute("username"));
      }
      if(tableName.equals("faburen")) {
         wrapper.eq("faburenzhanghao", (String)request.getSession().getAttribute("username"));
      }

      int count = jiaohuanxinxiService.selectCount(wrapper);
      return R.ok().put("count", count);
   }
   
   





}
@RestController
@RequestMapping("/jiaohuanxinxi")
public class JiaohuanxinxiController {
    @Autowired
    private JiaohuanxinxiService jiaohuanxinxiService;



    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,JiaohuanxinxiEntity jiaohuanxinxi, 
      HttpServletRequest request){

      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("xuesheng")) {
         jiaohuanxinxi.setXueshengzhanghao((String)request.getSession().getAttribute("username"));
      }
      if(tableName.equals("faburen")) {
         jiaohuanxinxi.setFaburenzhanghao((String)request.getSession().getAttribute("username"));
      }
        EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       PageUtils page = jiaohuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaohuanxinxi), params), params));
      request.setAttribute("data", page);
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
   @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,JiaohuanxinxiEntity jiaohuanxinxi, 
      HttpServletRequest request){
        EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       PageUtils page = jiaohuanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaohuanxinxi), params), params));
      request.setAttribute("data", page);
        return R.ok().put("data", page);
    }

   /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( JiaohuanxinxiEntity jiaohuanxinxi){
           EntityWrapper<JiaohuanxinxiEntity> ew = new EntityWrapper<JiaohuanxinxiEntity>();
       ew.allEq(MPUtil.allEQMapPre( jiaohuanxinxi, "jiaohuanxinxi")); 
        return R.ok().put("data", jiaohuanxinxiService.selectListView(ew));
    }

    /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(JiaohuanxinxiEntity jiaohuanxinxi){
        EntityWrapper< JiaohuanxinxiEntity> ew = new EntityWrapper< JiaohuanxinxiEntity>();
      ew.allEq(MPUtil.allEQMapPre( jiaohuanxinxi, "jiaohuanxinxi")); 
      JiaohuanxinxiView jiaohuanxinxiView =  jiaohuanxinxiService.selectView(ew);
      return R.ok("查询交换信息成功").put("data", jiaohuanxinxiView);
    }
   
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        JiaohuanxinxiEntity jiaohuanxinxi = jiaohuanxinxiService.selectById(id);
        return R.ok().put("data", jiaohuanxinxi);
    }

    /**
     * 前端详情
     */
   @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        JiaohuanxinxiEntity jiaohuanxinxi = jiaohuanxinxiService.selectById(id);
        return R.ok().put("data", jiaohuanxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
       jiaohuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(jiaohuanxinxi);

        jiaohuanxinxiService.insert(jiaohuanxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
       jiaohuanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
       //ValidatorUtils.validateEntity(jiaohuanxinxi);

        jiaohuanxinxiService.insert(jiaohuanxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody JiaohuanxinxiEntity jiaohuanxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(jiaohuanxinxi);
        jiaohuanxinxiService.updateById(jiaohuanxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        jiaohuanxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
   @RequestMapping("/remind/{columnName}/{type}")
   public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
                   @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
      map.put("column", columnName);
      map.put("type", type);
      
      if(type.equals("2")) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar c = Calendar.getInstance();
         Date remindStartDate = null;
         Date remindEndDate = null;
         if(map.get("remindstart")!=null) {
            Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
            c.setTime(new Date()); 
            c.add(Calendar.DAY_OF_MONTH,remindStart);
            remindStartDate = c.getTime();
            map.put("remindstart", sdf.format(remindStartDate));
         }
         if(map.get("remindend")!=null) {
            Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
            c.setTime(new Date());
            c.add(Calendar.DAY_OF_MONTH,remindEnd);
            remindEndDate = c.getTime();
            map.put("remindend", sdf.format(remindEndDate));
         }
      }
      
      Wrapper<JiaohuanxinxiEntity> wrapper = new EntityWrapper<JiaohuanxinxiEntity>();
      if(map.get("remindstart")!=null) {
         wrapper.ge(columnName, map.get("remindstart"));
      }
      if(map.get("remindend")!=null) {
         wrapper.le(columnName, map.get("remindend"));
      }

      String tableName = request.getSession().getAttribute("tableName").toString();
      if(tableName.equals("xuesheng")) {
         wrapper.eq("xueshengzhanghao", (String)request.getSession().getAttribute("username"));
      }
      if(tableName.equals("faburen")) {
         wrapper.eq("faburenzhanghao", (String)request.getSession().getAttribute("username"));
      }

      int count = jiaohuanxinxiService.selectCount(wrapper);
      return R.ok().put("count", count);
   }
}

六、源码获取

感谢大家收藏点赞评论,获取源码后台私

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值