作者主页:Java毕设网
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
一、相关文档
该影城管理系统的开发和设计根据用户的实际情况出发,对系统的需求进行了详细的分析,然后进行系统的整体设计,最后通过测试使得系统设计的更加完整,可以实现系统中所有的功能,在开始编写论文之前亲自到图书馆借阅Spring Boot书籍,MYSQL数据库书籍等编程书籍,然后针对开发的影城管理系统 ,去网上查找了很多别人做好的系统,参照他们的设计结果,来对自己的系统进行更加详细的系统的设计,将系统中所有的功能结果一一列举出来,然后进行需求分析,最后对所有的功能模块进行编码,最后完成系统的整体测试,实现系统的正常运行[6]。
这次编写的论文包含了6个部分的内容,具体内容如下:
第一部分绪论:文章主要从课题背景以及研究现状综合阐述了开发此系统的必要性。
第二部分相关技术:系统开发用到的各种技术都大致做出了简介。
第三部分系统分析:对系统的可行性分析以及对所有功能需求进行详细的分析,来查看该系统是否具有开发的可能。
第四部分系统设计:功能模块设计和数据库设计这两部分内容都有专门的表格和图片表示。
第五部分系统实现:进行系统主要功能模块的界面展示。
第六部分系统测试:测试系统的每一个功能是否能够正常运行,是否可以满足用户的需求。
本影城管理系统主要包括二大功能模块,即用户功能模块和管理员功能模块。
(1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员功能来管理后台系统。主要功能有:首页、个人中心、用户管理、电影类型管理、放映厅管理、电影信息管理、购票统计管理、系统管理、订单管理等功能。管理员用例图如图3-1所示。
(2)用户前台:首页、电影信息、电影资讯、个人中心、后台管理、在线客服等功能,用户前台如图3-2所示。
二、项目介绍
角色:管理员、用户
本影城管理系统主要包括二大功能模块,即用户功能模块和管理员功能模块。
(1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员功能来管理后台系统。主要功能有:首页、个人中心、用户管理、电影类型管理、放映厅管理、电影信息管理、购票统计管理、系统管理、订单管理等功能。
(2)用户前台:首页、电影信息、电影资讯、个人中心、后台管理、在线客服等功能,
三、环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
四、技术栈
1.后端:SpringBoot+Mybaits
2.前端:Vue +ELementUI
五、使用说明
项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入前台项目地址:http://localhost:8080/springboot9cd99/front/index.html
后管项目地址:http://localhost:8080/springboot9cd99/admin/dist/index.html#/login
六、运行截图
前台页面
后台页面
七、相关代码
文件管理控制器
/**
* 上传文件映射表
*/
@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);
/**
* 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开
* 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,
* 并且项目路径不能存在中文、空格等特殊字符
*/
// FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\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);
}
}
招聘信息管理控制器
/**
* 应聘信息
* 后端接口
* @author
* @email
* @date 2022-05-03 18:24:13
*/
@RestController
@RequestMapping("/yingpinxinxi")
public class YingpinxinxiController {
@Autowired
private YingpinxinxiService yingpinxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,YingpinxinxiEntity yingpinxinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("qiye")) {
yingpinxinxi.setQiyezhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("xuesheng")) {
yingpinxinxi.setXueshengzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<YingpinxinxiEntity> ew = new EntityWrapper<YingpinxinxiEntity>();
PageUtils page = yingpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,YingpinxinxiEntity yingpinxinxi,
HttpServletRequest request){
EntityWrapper<YingpinxinxiEntity> ew = new EntityWrapper<YingpinxinxiEntity>();
PageUtils page = yingpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yingpinxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( YingpinxinxiEntity yingpinxinxi){
EntityWrapper<YingpinxinxiEntity> ew = new EntityWrapper<YingpinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( yingpinxinxi, "yingpinxinxi"));
return R.ok().put("data", yingpinxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(YingpinxinxiEntity yingpinxinxi){
EntityWrapper< YingpinxinxiEntity> ew = new EntityWrapper< YingpinxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( yingpinxinxi, "yingpinxinxi"));
YingpinxinxiView yingpinxinxiView = yingpinxinxiService.selectView(ew);
return R.ok("查询应聘信息成功").put("data", yingpinxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YingpinxinxiEntity yingpinxinxi = yingpinxinxiService.selectById(id);
return R.ok().put("data", yingpinxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YingpinxinxiEntity yingpinxinxi = yingpinxinxiService.selectById(id);
return R.ok().put("data", yingpinxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YingpinxinxiEntity yingpinxinxi, HttpServletRequest request){
yingpinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yingpinxinxi);
yingpinxinxiService.insert(yingpinxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YingpinxinxiEntity yingpinxinxi, HttpServletRequest request){
yingpinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yingpinxinxi);
yingpinxinxiService.insert(yingpinxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody YingpinxinxiEntity yingpinxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(yingpinxinxi);
yingpinxinxiService.updateById(yingpinxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yingpinxinxiService.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<YingpinxinxiEntity> wrapper = new EntityWrapper<YingpinxinxiEntity>();
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("qiye")) {
wrapper.eq("qiyezhanghao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("xuesheng")) {
wrapper.eq("xueshengzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = yingpinxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}