基于SpringBoot的电子招标投标管理系统

news2024/10/6 12:27:01

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SpringBoot
前端:HTML、Vue
数据库:MySQL5.7

数据库管理工具:Navicat 12
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1前台首页

3.2后台管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

基于SpringBoot的电子招标投标管理系统利用网络沟通、计算机信息存储管理,有着与传统的方式所无法替代的优点。比如计算检索速度特别快、可靠性特别高、存储容量特别大、保密性特别好、可保存时间特别长、成本特别低等。在工作效率上,能够得到极大地提高,延伸至服务水平也会有好的收获,有了网络,基于SpringBoot的电子招标投标管理系统的各方面的管理更加科学和系统,更加规范和简便。


二、系统功能

基于SpringBoot的电子招标投标管理系统主要包括三大功能模块,即管理员、责任单位和供应商。

(1)管理员模块:责任单位管理、供应商管理、招标分类管理、招标项目管理、在线投标管理、结果公示管理、中标公示管理、市场监督管理、帮助中心管理、新闻资讯管理、管理员管理、系统管理。 

(2)责任单位:首页、个人中心、招标项目管理、在线投标管理、结果公示管理、中标公告管理。

(3)供应商:在线投标管理、中标公告管理等。



三、系统项目截图

3.1前台首页

前台有招标项目、结果公示、中标公告、市场监督、帮助中心、新闻资讯、业界资讯、个人中心、后台管理等相关功能模块。

 招标项目中用户可以查看目前正在招标的项目

个人中心可以查看自己的个人信息,没有账号的可以在前台的注册页面进行注册

 责任单位可以在后台发布招标项目。

发布招标项目完成以后可以对项目进行公示或者发布公告通知等操作。

3.2后台管理

管理员后台有责任单位管理、供应商管理、招标分类管理、招标项目管理、在线投标管理、结果公示管理、中标公示管理、市场监督管理、帮助中心管理、新闻资讯管理、管理员管理、系统管理。

管理员可以查看并且管理所以的招标项目。


 

 

四、核心代码

4.1登录相关


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

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

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

4.2文件上传

package com.controller;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
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 org.springframework.web.multipart.MultipartFile;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;

/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		File path = new File(ResourceUtils.getURL("classpath:static").getPath());
		if(!path.exists()) {
		    path = new File("");
		}
		File upload = new File(path.getAbsolutePath(),"/upload/");
		if(!upload.exists()) {
		    upload.mkdirs();
		}
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(upload.getAbsolutePath()+"/"+fileName);
		file.transferTo(dest);
		FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public ResponseEntity<byte[]> download(@RequestParam String fileName) {
		try {
			File path = new File(ResourceUtils.getURL("classpath:static").getPath());
			if(!path.exists()) {
			    path = new File("");
			}
			File upload = new File(path.getAbsolutePath(),"/upload/");
			if(!upload.exists()) {
			    upload.mkdirs();
			}
			File file = new File(upload.getAbsolutePath()+"/"+fileName);
			if(file.exists()){
				/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
					getResponse().sendError(403);
				}*/
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

4.3封装

package com.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回数据
 */
public class R extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	
	public R() {
		put("code", 0);
	}
	
	public static R error() {
		return error(500, "未知异常,请联系管理员");
	}
	
	public static R error(String msg) {
		return error(500, msg);
	}
	
	public static R error(int code, String msg) {
		R r = new R();
		r.put("code", code);
		r.put("msg", msg);
		return r;
	}

	public static R ok(String msg) {
		R r = new R();
		r.put("msg", msg);
		return r;
	}
	
	public static R ok(Map<String, Object> map) {
		R r = new R();
		r.putAll(map);
		return r;
	}
	
	public static R ok() {
		return new R();
	}

	public R put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}

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

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

相关文章

Android BottomSheetDialogFragment 使用详解,设置圆角、固定高度、默认全屏等

转载请标明出处&#xff1a;http://blog.csdn.net/zhaoyanjun6/article/details/127967304 本文出自【赵彦军的博客】 文章目录效果BottomSheetBottomSheetDialogBottomSheetDialogFragment圆角效果去掉背景蒙版设置蒙版透明度点击 dialog 外部区域&#xff0c;dialog 不消失禁…

STC51单片机37——定时器流水灯

// 12MHz晶振 #include "reg52.h" #include "intrins.h" #define time (65536-50000) // 单次定时50ms unsigned char cn; unsigned char temp; unsigned char dir; void main(void) { cn20; //20*50ms1s temp0x80; dir0; TMOD 0x…

Vue简单示例——weex

weex的生命周期&#xff1a; 因为我们的Weex和Vue是绑定在一起的&#xff0c;所以我们讨论关于生命周期时&#xff0c;说的实际上是在Weex中可以使用的Vuex的生命周期&#xff0c;也就是Weex对于Vue生命周期的支持&#xff0c;好消息&#xff0c;Weex支持大部分的Vue中的生命周…

基于Vue+ElementUI+MySQL+Express的学生管理系统(3)

3.搭建学生考试信息的前端页面 1.在E:\vue\shiyan9目录下用cmd打开命令窗口。输入命令vue init webpack score-manage&#xff0c;创建一个基于webpack模板的项目。 图15 创建一个新的vue的脚手架的项目 2.执行cd score-manage&#xff0c;进入目录包下。下载依赖包。命令如下…

Pytorch 图像增强 实现翻转裁剪色调等 附代码(全)

目录前言1. 裁剪1.1 中心裁剪1.2 随机裁剪1.3 随机尺寸裁剪2. 翻转2.1 水平翻转2.2 垂直翻转2.3 随机旋转3. 色调3.1 灰度变换3.2 色彩抖动3.3 随机翻转颜色3.4 随机调整锐度3.5 高斯模糊4. 边缘填充5. 仿射变换前言 下文中有使用到plt&#xff0c;不懂的可看我这篇文章&#…

doker中的Jenkins容器配置github

1、在Jenkins插件 管理中下载github plugin和ssh和git插件 2、在Jenkins->系统管理->系统配置->github下配置凭据认证&#xff0c;添加凭证页面类型选择secret text 3、添加凭证页面secret栏输入githu token&#xff0c;其他任意输入 4、github token获取&#xf…

FANUC机器人零点复归的报警原因分析和零点标定相关步骤

FANUC机器人零点复归的报警原因分析和零点标定相关步骤 FANUC机器人零点复归时需要将机器人的机械信息与位置信息同步,来定义机器人的物理位置。 机器人通过闭环伺服系统来控制机器人各运动轴,当用户通过示教器点动机器人时,经过主板分析此命令后,带动电机旋转,电机上的SP…

软件测试入门概念

满足用户期望或正式规定文档&#xff08;合同、标准、规范&#xff09;所具有的条件和权能&#xff0c;包含用户需求和软件需求。 用户需求&#xff1a; 五花八门的用户需求&#xff0c;该需求比较简略。 软件需求&#xff1a; 又叫功能需求&#xff0c;该需求会详细描述开发…

SLAM本质剖析-Boost之Geometry函数大全(二)

4. 点云处理 4.1 add_point 将一个点添加到另一个点 4.2 add_value 将相同的值添加到点的每个坐标 4.3 assign_point 用另一个点指定一个点 4.4 assign_value 为点的每个坐标指定相同的值 4.5 cross_product 计算两个向量的叉积 4.7 divide_point 将一点除以另一点…

Python用27行代码绘制一幅满天星

前言 大家早好、午好、晚好吖 ❤ ~ 每一个孩子都像星空中的一颗星星&#xff0c;散发着自己所特有的光芒照亮着整个夜空。 今天就带大家用27行Python代码绘制一幅满天星吧。 全局设置 在绘制满天星的过程中要运用到turtle工具&#xff0c;它是Python的标准库&#xff0c;也可…

堆排序+TOPK问题

文章目录一.堆排序1.使用向上还是向下调整建堆好&#xff1f;(1)向上调整算法建堆的时间复杂度1. 完整过程(2)向下调整算法建堆的时间复杂度1.完整过程(3)总结2. 排升序(1) 建小堆(2) 建大堆3. 堆排序时间复杂度统计4.完整代码二 、 TOPK问题1. 概念2.两种方法第一种缺陷第二种…

【论文阅读】(2017)The late acceptance Hill-Climbing heuristic

文章目录一、摘要二、Late Acceptance Hill Climbing三、LAHC技术性能的研究3.1 Benchmark problems3.2 Experimental software3.3 Experiments四、LAHC性能评估4.1 评估方法4.2 LAHC不同变体的性能4.3 LAHC与其他技术的比较4.4 LAHC的规模独立性五、Conclusions and future wo…

Salesforce架构师常见问题(上)

Salesforce架构师需要花费大量时间来绘制、讨论、建立和设计稳健的端到端解决方案。架构师角色不仅仅是处理解决方案这么简单&#xff0c;还需要在企业级组织中与多个业务部门打交道。 因此&#xff0c;Salesforce架构师面试需要从以下3个方面准备&#xff1a; Part.1 分享工…

快速理解 JVM 内存模型 对象组成 对象内存分配

快速理解 JVM 内存模型 & 对象组成 & 对象内存分配 JVM 内存模型 JVM 内存模型分为首先在线程纬度可以分为两部分 一部分是 线程共享&#xff1a; 堆、元空间 堆 &#xff1a; 大多数 new 的对象都存在于堆内&#xff0c;也是 GC 主要回收的空间&#xff0c;占据 J…

涨薪跳槽利器,清华大咖总结的 Java 核心突击讲,一应俱全

前言 今天在这里分享一位读者粉丝的经历&#xff1a; 本人双非本科&#xff0c;没拿什么过奖&#xff0c;现在毕业也有三年时间了&#xff0c;大四感觉能力有点不足&#xff0c;进了一家小型的互联网公司实习&#xff1b;期间报名了个线上培训课程&#xff0c;一直在持续学习…

超详细Docker部署SpringBoot+Vue项目(三更博客项目部署)

文章目录1.项目部署规划2.前置工作2.1修改后端配置文件ip2.2修改前端Vue项目运行端口2.3修改前端对应的服务器ip2.4后端项目打包2.4.1解决打包问题2.4.2项目打包&#xff0c;本地运行jar包测试2.5前端项目打包2.6开放端口2.7配置安全组规则3.Docker安装4.拉取镜像5.编写Dockerf…

挂耳式蓝牙耳机哪家的好用,推荐几款实用的挂耳式耳机

时代在进步&#xff0c;而我们也顺势享受着进步过程中所产生的物件&#xff0c;就如骨传导和传统耳机&#xff0c;年轻人更多时候会偏向于骨传导耳机&#xff0c;毕竟骨传导的最大的特点就是佩戴舒适的同时&#xff0c;开放式耳道的设计能够更好的让中耳炎说拜拜。但近期市面上…

Hi,运维,你懂Java吗-No.3:java系统的启动

作为运维&#xff0c;你不一定要会写Java代码&#xff0c;但是一定要懂Java在生产跑起来之后的各种机制。 本文为《Hi&#xff0c;运维&#xff0c;你懂Java吗》系列文章 第三篇&#xff0c;敬请关注后续系列文章 欢迎关注 龙叔运维&#xff08;公众号&#xff09; 持续分享运…

浅谈一下:Java学习中不得不知道的:static (静态)成员

下面笔者&#xff0c;按照之前的Student进行简单的说明&#xff1a; class Student {private String name ;private int age ;private String classRoom ;//上课教室public Student(String name, int age) {this.name name;this.age age;}public void doClass() {System.out…

五、 通信协议

协议&#xff1a;约定&#xff0c;就好比我们来自不同的地方&#xff0c;如果都用各自的家乡话&#xff0c;那么肯定无法沟通&#xff0c;这时我们规定双方都说普通话&#xff0c;这样就可以沟通了&#xff0c;而这个规定就是“协议” 网络通信协议&#xff1a;速率、传输码率…