package com.wymessi.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
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.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.druid.util.StringUtils;
import com.wymessi.exception.CustomException;
import com.wymessi.param.GenerateApplyParam;
import com.wymessi.param.ProjectListParam;
import com.wymessi.po.Allocate;
import com.wymessi.po.Group;
import com.wymessi.po.Project;
import com.wymessi.po.SysUser;
import com.wymessi.service.AllocateService;
import com.wymessi.service.GroupService;
import com.wymessi.service.ProjectService;
import com.wymessi.service.UserService;
import com.wymessi.utils.CustomDateUtils;
import com.wymessi.utils.Md5Utils;
import com.wymessi.utils.Result;
import com.wymessi.utils.UUIDUtils;
@Controller
@RequestMapping("/project")
public class ProjectController {
@Autowired
private ProjectService projectService;
@Autowired
private UserService userService;
@Autowired
private GroupService groupService;
@Autowired
private AllocateService allocateService;
/**
* 项目申请页面
*
* @return
* @throws Exception
*/
@RequestMapping("/uploadPage")
public String uploadPage(HttpSession session) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
session.setAttribute("token", UUIDUtils.generateUUIDString());
return "applicant/upload";
}
/**
* 用户管理页面
*
* @return
* @throws Exception
*/
@RequestMapping("/userPage")
public String userPage(HttpSession session, HttpServletRequest request) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
String role = request.getParameter("role");
String path = null;
switch (role) {
case "1":
path = "system/userManage/applicant";
break;
case "2":
path = "system/userManage/expert";
break;
case "3":
path = "system/userManage/system";
break;
default:
break;
}
return path;
}
/**
* 添加用户页面
*
* @return
* @throws Exception
*/
@RequestMapping("/addUserPage")
public String addUserPage(HttpSession session, Model model, String roleId) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
model.addAttribute("roleId", roleId);
session.setAttribute("token", UUIDUtils.generateUUIDString());
return "system/userManage/addUser";
}
/**
* 添加用户
*
* @return
* @throws Exception
*/
@RequestMapping("/addUser")
public String addUser(HttpSession session, Model model, String role, SysUser user, String token) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
String path = null;
switch (role) {
case "1":
path = "system/userManage/applicant";
break;
case "2":
path = "system/userManage/expert";
break;
case "3":
path = "system/userManage/system";
break;
default:
break;
}
if (session.getAttribute("token") == null) {
model.addAttribute("message", "请勿重复提交表单");
return path;
}
if (session.getAttribute("token").equals(token)) {
String md5Password = Md5Utils.md5(user.getPassword()); // 密码采用MD5加密
user.setPassword(md5Password);
userService.register(user);
model.addAttribute("message", "添加成功");
session.removeAttribute("token");
}
return path;
}
/**
* 项目分配管理页面
*
* @return
* @throws Exception
*/
@RequestMapping("/allocateManagePage")
public String allocateManagePage(HttpSession session) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
return "system/allocateManage/allocateManage";
}
/**
* 项目分配页面
*
* @return
* @throws Exception
*/
@RequestMapping("/allocatePage")
public String allocatePage(Model model, HttpSession session,Long id) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
session.setAttribute("groupId", id);
return "system/allocateManage/allocate";
}
/**
* 项目管理页面
*
* @return
* @throws Exception
*/
@RequestMapping("/managePage")
public String managePage(HttpSession session, HttpServletRequest request) throws Exception {
if (session.getAttribute("user") == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
return "system/projectManage/manage";
}
/**
* 处理上传请求
*
* @param model
* @param file
* @param session
* @param project
* @param tagsinput
* @param token 防止表单重复重复
* 领域标签用逗号隔开
* @return
*/
@RequestMapping("/upload")
public String upload(Model model, MultipartFile file, HttpSession session, Project project, String tagsinput, String token) {
SysUser user = (SysUser) session.getAttribute("user");
if (user == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
if (session.getAttribute("token") == null) {
model.addAttribute("message", "请勿重复提交表单");
return "applicant/upload";
}
if (session.getAttribute("token").equals(token)) {
// 生成申请记录
GenerateApplyParam param = new GenerateApplyParam();
param.setModel(model);
param.setFile(file);
param.setProject(project);
param.setSysUser(user);
param.setTagsinput(tagsinput);
projectService.generateApply(param);
session.removeAttribute("token");
}
return "applicant/upload";
}
/**
* 删除项目申请记录
* @param session
* @param id
*/
@RequestMapping("/delete")
public void delete(HttpSession session, Long id) {
SysUser user = (SysUser) session.getAttribute("user");
if (user == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
// 删除记录
projectService.deleteById(id);
}
/**
* 更新申请记录接口
*
* @param model
* @param session
* @param project
* @return
*/
@ResponseBody
@RequestMapping("/update")
public Result<String> update(Model model, HttpSession session, Project project) {
SysUser user = (SysUser) session.getAttribute("user");
if (user == null) {
throw new CustomException("未登录,请先登录", "/prs/");
}
Result<String> result = new Result<String>();
Project p = projectService.getProjectById(project.getId());
if (p == null) {
result.setData("该申请记录不存在,请刷新页面重新查看");
return result;
}
p.setProjectName(project.getProjectName());
p.setDescription(project.getDescription());
// 更新申请记录
p.setLastUpdateTime(new Date());
int rows = projectService.update(p); // 返回影响的行数
if (rows > 0) {
result.setData("修改成功");
} else {
result.setData("修改失败");
}
return result;
}
/**
* 查询项目申请记录接口,以json的形式返回
*
* @param session
* @param request
* @return
*/
@ResponseBody
@RequestMapping("/projects.json")
public Map<String, Object>
没有合适的资源?快使用搜索试试~ 我知道了~
基于springboot+mybatis+thymleaf的科研项目评审系统(源码+资源),适合个人学习,毕设,课设.zip
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共303个文件
gif:75个
java:67个
html:25个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 53 浏览量
2023-08-09
22:23:15
上传
评论
收藏 2.24MB ZIP 举报
温馨提示
用Java写的项目,项目真实可靠,可用作本科毕业设计,欢迎大家下载学习。用Java写的项目,项目真实可靠,可用作本科毕业设计,欢迎大家下载学习。用Java写的项目,项目真实可靠,可用作本科毕业设计,欢迎大家下载学习。用Java写的项目,项目真实可靠,可用作本科毕业设计,欢迎大家下载学习。用Java写的项目,项目真实可靠,可用作本科毕业设计,欢迎大家下载学习。
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
共 303 条
- 1
- 2
- 3
- 4
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/2e5877b4fb644fb3a0267656bb6912ba_java_cjkl.jpg!1)
c++服务器开发
- 粉丝: 3045
- 资源: 4461
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 高分毕设-基于Python+OpenCV人脸识别考勤打卡系统源代码(95分以上).zip
- opencv项目实战:使用OpenCV实现哈哈镜效果(包含源码+说明文档+教程.zip)
- 微软运行库2024.exe
- Axure RP 9是一款专业的快速原型设计工具,安装即用
- 基于JSP+Servlet+Tomcat9.0+IDEA+Mysql实现的Javaweb图书管理系统
- Toon Boom Storyboard Pro 是一款专业的故事板制作软件,专为动画制作和影视前期制作而设计
- Serif Affinity Designer 是一款专业的矢量图形设计软件,旨在提供强大的创意工具和无与伦比的性能
- dbeaver exe安装脚本
- 基于Python+OpenCV人脸识别考勤管理系统+源代码(高分毕业设计).zip
- Photoshop 900个矢量和Photoshop画笔
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)