基于ssm校园短期闲置资源置换平台源码和论文

news2024/10/6 14:37:46

idea 数据库mysql5.7+ 数据库链接工具:navcat,小海豚等 环境: jdk8 tomcat8.5

开发技术 ssm

基于ssm校园短期闲置资源置换平台源码和论文755

摘要

校园短期闲置资源置换平台是校园短期闲置资源置换必不可少的一个部分。在校园短期闲置资源置换的整个过程中,校园短期闲置资源置换平台担负着最重要的角色。为满足如今日益复杂的管理需求,各类校园短期闲置资源置换管理程序也在不断改进。本课题所设计的校园短期闲置资源置换平台,使用java技术进行开发,它的优点代码不能从浏览器查看,保密性非常好,比其他的系统更具安全性。java还容易修改和调试,毕竟商家是在不断发展过程中,难免有更多需求,这点很重要。而且,本系统对校园短期闲置资源置换的管理,是为了满足更深层次的需求。除了上述优势外,本系统还具有查询迅速,搜索资料方便,可靠性强等特点。

关键词:校园短期闲置资源置换;java;可靠性

演示视频:

基于ssm校园短期闲置资源置换平台源码和论文

Absract

Campus short-term idle resources replacement platform is an indispensable part of campus short-term idle resources replacement. In the whole process of campus short-term idle resources replacement, the campus short-term idle resources replacement platform plays the most important role. In order to meet today's increasingly complex management needs, all kinds of campus short-term idle resources replacement management procedures are constantly improved. The campus short-term idle resources replacement platform designed by this topic is developed using Java technology. Its advantages of code can not be viewed from the browser, confidentiality is very good, more secure than other systems. Java is also easy to modify and debug, which is important as businesses continue to evolve and have more requirements. Moreover, the system of campus short-term idle resources replacement management, is to meet the deeper needs. In addition to the advantages mentioned above, the system also has the characteristics of quick inquiry, convenient data search and strong reliability.

Key words: campus short-term idle resources replacement; Java; reliability

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.ZhihuanshangpinEntity;
import com.entity.view.ZhihuanshangpinView;

import com.service.ZhihuanshangpinService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 置换商品
 * 后端接口
 * @author 
 * @email 
 * @date 2022-04-25 17:05:25
 */
@RestController
@RequestMapping("/zhihuanshangpin")
public class ZhihuanshangpinController {
    @Autowired
    private ZhihuanshangpinService zhihuanshangpinService;


    @Autowired
    private StoreupService storeupService;

    


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

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("zhihuanzhanghu")) {
			zhihuanshangpin.setZhihuanzhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<ZhihuanshangpinEntity> ew = new EntityWrapper<ZhihuanshangpinEntity>();
		PageUtils page = zhihuanshangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhihuanshangpin), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ZhihuanshangpinEntity zhihuanshangpin, 
		HttpServletRequest request){
        EntityWrapper<ZhihuanshangpinEntity> ew = new EntityWrapper<ZhihuanshangpinEntity>();
		PageUtils page = zhihuanshangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhihuanshangpin), params), params));
        return R.ok().put("data", page);
    }

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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ZhihuanshangpinEntity zhihuanshangpin){
        EntityWrapper< ZhihuanshangpinEntity> ew = new EntityWrapper< ZhihuanshangpinEntity>();
 		ew.allEq(MPUtil.allEQMapPre( zhihuanshangpin, "zhihuanshangpin")); 
		ZhihuanshangpinView zhihuanshangpinView =  zhihuanshangpinService.selectView(ew);
		return R.ok("查询置换商品成功").put("data", zhihuanshangpinView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ZhihuanshangpinEntity zhihuanshangpin = zhihuanshangpinService.selectById(id);
		zhihuanshangpin.setClicknum(zhihuanshangpin.getClicknum()+1);
		zhihuanshangpin.setClicktime(new Date());
		zhihuanshangpinService.updateById(zhihuanshangpin);
        return R.ok().put("data", zhihuanshangpin);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ZhihuanshangpinEntity zhihuanshangpin = zhihuanshangpinService.selectById(id);
		zhihuanshangpin.setClicknum(zhihuanshangpin.getClicknum()+1);
		zhihuanshangpin.setClicktime(new Date());
		zhihuanshangpinService.updateById(zhihuanshangpin);
        return R.ok().put("data", zhihuanshangpin);
    }
    



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

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

        zhihuanshangpinService.insert(zhihuanshangpin);
        return R.ok();
    }

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

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        zhihuanshangpinService.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<ZhihuanshangpinEntity> wrapper = new EntityWrapper<ZhihuanshangpinEntity>();
		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("zhihuanzhanghu")) {
			wrapper.eq("zhihuanzhanghao", (String)request.getSession().getAttribute("username"));
		}

		int count = zhihuanshangpinService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,ZhihuanshangpinEntity zhihuanshangpin, HttpServletRequest request,String pre){
        EntityWrapper<ZhihuanshangpinEntity> ew = new EntityWrapper<ZhihuanshangpinEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        
        params.put("order", "desc");
		PageUtils page = zhihuanshangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhihuanshangpin), params), params));
        return R.ok().put("data", page);
    }


    /**
     * 协同算法(按收藏推荐)
     */
    @RequestMapping("/autoSort2")
    public R autoSort2(@RequestParam Map<String, Object> params,ZhihuanshangpinEntity zhihuanshangpin, HttpServletRequest request){
        String userId = request.getSession().getAttribute("userId").toString();
        String inteltypeColumn = "shangpinfenlei";
        List<StoreupEntity> storeups = storeupService.selectList(new EntityWrapper<StoreupEntity>().eq("type", 1).eq("userid", userId).eq("tablename", "zhihuanshangpin").orderBy("addtime", false));
        List<String> inteltypes = new ArrayList<String>();
        Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
        List<ZhihuanshangpinEntity> zhihuanshangpinList = new ArrayList<ZhihuanshangpinEntity>();
        //去重
        if(storeups!=null && storeups.size()>0) {
            for(StoreupEntity s : storeups) {
                zhihuanshangpinList.addAll(zhihuanshangpinService.selectList(new EntityWrapper<ZhihuanshangpinEntity>().eq(inteltypeColumn, s.getInteltype())));
            }
        }
        EntityWrapper<ZhihuanshangpinEntity> ew = new EntityWrapper<ZhihuanshangpinEntity>();
        params.put("sort", "id");
        params.put("order", "desc");
        PageUtils page = zhihuanshangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zhihuanshangpin), params), params));
        List<ZhihuanshangpinEntity> pageList = (List<ZhihuanshangpinEntity>)page.getList();
        if(zhihuanshangpinList.size()<limit) {
            int toAddNum = (limit-zhihuanshangpinList.size())<=pageList.size()?(limit-zhihuanshangpinList.size()):pageList.size();
            for(ZhihuanshangpinEntity o1 : pageList) {
                boolean addFlag = true;
                for(ZhihuanshangpinEntity o2 : zhihuanshangpinList) {
                    if(o1.getId().intValue()==o2.getId().intValue()) {
                        addFlag = false;
                        break;
                    }
                }
                if(addFlag) {
                    zhihuanshangpinList.add(o1);
                    if(--toAddNum==0) break;
                }
            }
        } else if(zhihuanshangpinList.size()>limit) {
            zhihuanshangpinList = zhihuanshangpinList.subList(0, limit);
        }
        page.setList(zhihuanshangpinList);
        return R.ok().put("data", page);
    }





}

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1297207.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

07-2 Python模块和命名空间

1. 模块 概念&#xff1a;其实就是一个Python文件&#xff0c;正常文件有的变量&#xff0c;函数&#xff0c;类&#xff0c;模块都有 功能:模块可以被其它程序引入&#xff0c;以使用该模块中的函数等功能。 示例&#xff1a;test-module.py调用mymodule.py模块中的now_time…

Ubuntu编译文件安装SNMP服务

net-snmp源码下载 http://www.net-snmp.org/download.html 编译步骤 指定参数编译 ./configure --prefix/root/snmpd --with-default-snmp-version"2" --with-logfile"/var/log/snmpd.log" --with-persistent-directory"/var/net-snmp" --wi…

CSS3技巧36:让内容垂直居中的三种方式

让内容垂直居中&#xff0c;是一个很重要的应用情景&#xff0c;在很多场合都会需要。这也是面试的时候&#xff0c;一些考官喜欢拿来初面的小题目。 这里&#xff0c;小结下让内容垂直居中的三种方式。 当然&#xff0c;读者如果有更好的方法&#xff0c;也可以提出来。 基本…

scikit-learn实现线性回归

要学习scikit-learn,我们必须要到scikit-clearn的官网中去查看公式和原理 scikit-learn 官网 scikit-learn 中文社区 进入官网一以后我们找到回归&#xff0c;然后再有监督学习中找到线性模型 scikit-learn实现简单的线性回归 公式&#xff1a; L2范数是指向量中每个元素的平…

已通过考试和认证注册以及后续计划表

已通过考试和认证注册以及后续计划表 软考 - 计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试信息系统集成及服务项目管理人员工程类考试计划你关注的证书样子 软考 - 计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试 高级 信息系统项目管理师&…

vite+vue3实现动态路由

在做这个动态路由的时候踩了很多坑&#xff0c;其中大部分是粗心了 动态菜单主要是导入的方式 import.meta.glob 参考&#xff1a;功能 | Vite 官方中文文档 1、多层路由渲染&#xff08;用3层路由做demo&#xff09; 拿到接口的数据是后台直接处理好的结构&#xff0c;但是…

3_CSS层叠样式表基础

第3章-CSS层叠样式表基础 学习目标(Objective) 掌握标签选择器的使用掌握类选择器的使用了解id选择器和通配符选择器掌握font属性和color属性的应用 1.HTML的局限性 如果要改变下高度或者变一个颜色&#xff0c;就需要大量重复操作 总结&#xff1a; HTML满足不了设计者的需…

OpenCL学习笔记(三)手动编译开发库(win10+mingw64)

前言 有的小伙伴仍然在使用mingw编译器&#xff0c;这时只能重新编译opencl的sdk库。本文档简单记录下win10下&#xff0c;使用mingw11.20编译的过程&#xff0c;有需要的小伙伴可以参考下 一、安装所需软件 1.安装git&#xff0c;教程比较多&#xff0c;不再重复 2.安装cm…

放大镜是否可以会聚光线?为什么?

放大镜是否可以会聚光线&#xff1f;为什么&#xff1f; 实验日期&#xff1a;2019年8月24日 操作用具&#xff1a;放大镜&#xff0c;手电筒&#xff0c;一张白纸 猜 测&#xff1a;放大镜可以会聚光线&#xff0c;因为放大镜是凸透镜&#xff0c;凸透镜可以会聚光线。 实…

C#-快速剖析文件和流,并使用

目录 一、概述 二、文件系统 1、检查驱动器信息 2、Path 3、文件和文件夹 三、流 1、FileStream 2、StreamWriter与StreamReader 3、BinaryWriter与BinaryReader 一、概述 文件&#xff0c;具有永久存储及特定顺序的字节组成的一个有序、具有名称的集合&#xff1b; …

Nacos 2.3.0 正式发布,堪称最强!

2023年12月7日&#xff0c;Nacos 2.3.0&#xff0c;正式发布了它的最新版本。经过一个多月社区的精心测试与优化&#xff0c;新版本在功能和性能上均有显著提升。 Nacos 2.3.0的发布&#xff0c;可以说是一场关于配置管理的小型革命。它不仅仅是一个版本的迭代&#xff0c;更是…

Mybatis XML 多表查询

这篇需结合 <<Mybatis XML 配置文件>>那一篇博客一起看 工作中尽量避免使用多表查询,尤其是对性能要求非常高的项目 我们之前建了个用户表(代码在Mybatis XML配置文件那篇博客里),这次再建一个文章表,代码如下 : -- 创建⽂章表 DROP TABLE IF EXISTS articleinf…

armbian系统安装和卸载snmp服务(SNMPV2操作版本)

文章目录 说明基知干净卸载snmp服务并清除配置文件安装SNMPSNMPV2远程连接配置基本设备信息查询问题Errors were encountered while processing: snmpdCannot adopt OID…… 说明 由于各位小伙伴&#xff0c;可能在安装过程中出现意外或者其他情况&#xff0c;本文先说明卸载步…

金融专题 | 对复杂的金融工具进行设计、定价和对冲分析

金融行业使用 Financial Instruments Toolbox™ 执行现金流建模和收益率曲线拟合分析、计算价格和敏感度、查看价格演变&#xff0c;并使用普通股权和固定收益建模方法执行对冲分析。 借助该工具箱&#xff0c;您可以创建新的金融工具类型&#xff0c;使用参数拟合模型和息票剥…

预训练--微调

预训练–微调 一个很简单的道理&#xff0c;如果我们的模型是再ImageNet下训练的&#xff0c;那么这个模型一定是会比较复杂的&#xff0c;意思就是这个模型可以识别到很多种类别的即泛化能力很强&#xff0c;但是如果要它精确的识别是否某种类别&#xff0c;它的表现可能就不…

html、css类名命名思路整理

开发页面时&#xff0c;老是遇到起名问题&#xff0c;越想越头疼&#xff0c;严重影响开发进度&#xff0c;都是在想名字&#xff0c;现在做一下梳理&#xff0c;统一一下思想&#xff0c;希望以后能减少这块的痛苦。 命名规则 [功能名称]__[组成部分名称]--[样式名称] 思路…

小红书自动点赞工具,其成功分享与引流攻略从入门到精通

先来看实操成果&#xff0c;↑↑需要的同学可看我名字↖↖↖↖↖&#xff0c;或评论888无偿分享 一、小红书引流的优势 小红书作为一个社交电商平台&#xff0c;具有巨大的引流潜力。其独特的UGC&#xff08;用户生成内容&#xff09;模式使得用户可以轻松地分享自己的购物心得…

python主流开发工具排名,python开发工具有哪些

本篇文章给大家谈谈python的开发工具软件有哪些&#xff0c;以及python主流开发工具排名&#xff0c;希望对各位有所帮助&#xff0c;不要忘了收藏本站喔。 python中用到哪些软件 一、Python代码编辑器1、sublime Textsublime Text是一款非常流行的代码编辑器&#xff0c;支持P…

Python渗透测试——一、数据包的编辑工具——Scapy

Python渗透测试 一、Scapy简介二、Scapy中的分层结构三、Scapy中的常用函数四、在Scapy 中发送和接收数据包五、Scapy 中的抓包函数 一、Scapy简介 提到数据包(这里泛指帧、段和报文等)的构造&#xff0c;我们首先需要了解协议和分层这两个概念。在“互联世界的规则一协议”中…

概率论之 证明 正态分布的上a 分位点的对称的性质

公式(Z(a) -Z(1-a)) 表示正态分布的上(a)分位点与下(1-a)分位点在分布曲线上关于均值的对称性。 左侧 (Z(a))&#xff1a; 这是分布曲线上累积概率为(a)的那个点。也就是说&#xff0c;这是一个使得这个点及其左侧的面积占据整个曲线下方(a)的位置。 右侧 (Z(1-a))&#xff1…