大家好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。

💞当前专栏:Java毕业设计

精彩专栏推荐👇🏻👇🏻👇🏻

🎀 Python毕业设计
🌎微信小程序毕业设计

开发环境

开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7
数据库工具:Navicat12
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

源码下载地址:

https://download.csdn.net/download/m0_46388260/89976030

论文目录

【如需全文或源码请按文末获取联系】

在这里插入图片描述
在这里插入图片描述

一、项目简介

包括管理员和学生两个角色:
管理员关键功能包含个人中心、高校信息管理、学生管理、志愿填报管理、在线留言、系统管理等进行管理。
用户可以对个人中心、修改密码、志愿填报、我的收藏等进行操作。

二、系统设计

2.1软件功能模块设计

系统总体结构图如下所示:
在这里插入图片描述

2.2数据库设计

根据系统需求,将“用户、高校、志愿填报、高校信息、学生、配置文件、”等作为实体,它们的局部E-R图,如图4-3所示:
在这里插入图片描述

三、系统项目部分截图

3.1前台功能实现

系统首页界面如图5-1所示:
在这里插入图片描述
系统注册页面如图5-2所示:
在这里插入图片描述
高校信息:在高校信息页面的输入栏中输入省进行查询,可以查看到高校详细信息,并进行填报操作;高校信息页面如图5-3所示:
在这里插入图片描述

志愿填报:在志愿填报页面的输入栏中输入省或学校名进行查询志愿填报详细信息,并根据需要进行删除操作;志愿填报页面如图5-5所示:
在这里插入图片描述

3.2管理员模块实现

在这里插入图片描述

管理员进入主页面,主要功能包括对个人中心、高校信息管理、学生管理、志愿填报管理、在线留言、系统管理等进行操作。管理员主页面如图5-7所示:
在这里插入图片描述

四、部分核心代码

package com.controller;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
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 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.utils.UserBasedCollaborativeFiltering;
import com.service.ZhiyuantianbaoService;
import com.entity.ZhiyuantianbaoEntity;

import com.entity.GaoxiaoEntity;
import com.entity.view.GaoxiaoView;

import com.service.GaoxiaoService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.MapUtils;
import com.utils.CommonUtil;
import java.io.IOException;

/**
 * 高校
 * 后端接口
 * @author 
 * @email 
 * @date 2024-01-12 10:57:51
 */
@RestController
@RequestMapping("/gaoxiao")
public class GaoxiaoController {
    @Autowired
    private GaoxiaoService gaoxiaoService;



    @Autowired
    private ZhiyuantianbaoService zhiyuantianbaoService;

    



    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,GaoxiaoEntity gaoxiao,
		HttpServletRequest request){
        EntityWrapper<GaoxiaoEntity> ew = new EntityWrapper<GaoxiaoEntity>();

		PageUtils page = gaoxiaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gaoxiao), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,GaoxiaoEntity gaoxiao, 
		HttpServletRequest request){
        EntityWrapper<GaoxiaoEntity> ew = new EntityWrapper<GaoxiaoEntity>();

		PageUtils page = gaoxiaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gaoxiao), params), params));
        return R.ok().put("data", page);
    }



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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(GaoxiaoEntity gaoxiao){
        EntityWrapper< GaoxiaoEntity> ew = new EntityWrapper< GaoxiaoEntity>();
 		ew.allEq(MPUtil.allEQMapPre( gaoxiao, "gaoxiao")); 
		GaoxiaoView gaoxiaoView =  gaoxiaoService.selectView(ew);
		return R.ok("查询高校成功").put("data", gaoxiaoView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        GaoxiaoEntity gaoxiao = gaoxiaoService.selectById(id);
        return R.ok().put("data", gaoxiao);
    }

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



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody GaoxiaoEntity gaoxiao, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(gaoxiao);
        gaoxiaoService.insert(gaoxiao);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody GaoxiaoEntity gaoxiao, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(gaoxiao);
        gaoxiaoService.insert(gaoxiao);
        return R.ok();
    }





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



    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        gaoxiaoService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,GaoxiaoEntity gaoxiao, HttpServletRequest request,String pre){
        EntityWrapper<GaoxiaoEntity> ew = new EntityWrapper<GaoxiaoEntity>();
        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", "clicktime");
        params.put("order", "desc");
		PageUtils page = gaoxiaoService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gaoxiao), params), params));
        return R.ok().put("data", page);
    }


    /**
     * 协同算法(基于用户的协同算法)
     */
    @RequestMapping("/autoSort2")
    public R autoSort2(@RequestParam Map<String, Object> params,GaoxiaoEntity gaoxiao, HttpServletRequest request){
        String userName = (String)request.getSession().getAttribute("username");
        Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
        List<ZhiyuantianbaoEntity> zhiyuantianbaoList = zhiyuantianbaoService.selectList(new EntityWrapper<ZhiyuantianbaoEntity>());
        Map<String, Map<String, Double>> ratings = new HashMap<>();
        if(zhiyuantianbaoList!=null && zhiyuantianbaoList.size()>0) {
            for(ZhiyuantianbaoEntity zhiyuantianbao : zhiyuantianbaoList) {
                Map<String, Double> userRatings = null;
                if(ratings.containsKey(zhiyuantianbao.getXueshengxuehao().toString())) {
                    userRatings = ratings.get(zhiyuantianbao.getXueshengxuehao().toString());
                } else {
                    userRatings = new HashMap<>();
                    ratings.put(zhiyuantianbao.getXueshengxuehao().toString(), userRatings);
                }
                if(userRatings.containsKey(zhiyuantianbao.getZhuanye().toString())) {
                    userRatings.put(zhiyuantianbao.getZhuanye().toString(), userRatings.get(zhiyuantianbao.getZhuanye().toString())+1.0);
                } else {
                    userRatings.put(zhiyuantianbao.getZhuanye().toString(), 1.0);
                }

            }
        }
        // 创建协同过滤对象
        UserBasedCollaborativeFiltering filter = new UserBasedCollaborativeFiltering(ratings);

        // 为指定用户推荐物品
        String targetUser = userName;
        int numRecommendations = limit;
        List<String> recommendations = filter.recommendItems(targetUser, numRecommendations);

        // 输出推荐结果
        System.out.println("Recommendations for " + targetUser + ":");
        for (String item : recommendations) {
            System.out.println(item);
        }

        EntityWrapper<GaoxiaoEntity> ew = new EntityWrapper<GaoxiaoEntity>();
        ew.in("zhuanye", String.join(",", recommendations));
        if(recommendations!=null && recommendations.size()>0) {
            ew.last("order by FIELD(zhuanye, "+"'"+String.join("','", recommendations)+"'"+")");
        }

        PageUtils page = gaoxiaoService.queryPage(params, ew);
        List<GaoxiaoEntity> pageList = (List<GaoxiaoEntity>)page.getList();
        if(pageList.size()<limit) {
            int toAddNum = limit-pageList.size();
            ew = new EntityWrapper<GaoxiaoEntity>();
            ew.notIn("zhuanye", recommendations);
            ew.orderBy("id", false);
            ew.last("limit "+toAddNum);
            pageList.addAll(gaoxiaoService.selectList(ew));
        } else if(pageList.size()>limit) {
            pageList = pageList.subList(0, limit);
        }
        page.setList(pageList);

        return R.ok().put("data", page);
    }








}

获取源码或论文

如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐