项目介绍
当下,正处于信息化的时代,许多行业顺应时代的变化,结合使用计算机技术向数字化、信息化建设迈进。传统的个人时间信息管理模式,采用人工登记的方式保存相关数据,这种以人力为主的管理模式已然落后。本人结合使用主流的程序开发技术,设计了一款基于web 的个人时间管理系统,可以较大地减少人力、财力的损耗,方便相关人员及时更新和保存信息。本系统主要使用B/S开发模式,在idea集成开发环境下,采用Java语言编码设计系统功能,MySQL数据库管理相关的系统数据信息,SSM框架设计和开发系统功能架构,最后通过使用Tomcat服务器,在浏览器中发布设计的系统,并且完成系统与数据库的交互工作。本文对系统的需求分析、可行性分析、技术支持、功能设计、数据库设计、功能测试等内容做了较为详细的介绍,并且在本文中也展示了系统主要的功能模块设计界面和操作界面,并对其做出了必要的解释说明,方便用户对系统进行操作和使用,以及后期的相关人员对系统进行更新和维护。通过设计基于web 的个人时间管理系统,可以极大地提高个人的工作效率,提升用户的使用体验。
4.1系统的总体功能设计
通过结合系统分析阶段的相关内容,对系统的整体功能设计进行规划。由此可知,本系统的使用者主要可以被分为管理员角色和用户角色两类。其中,管理员角色主要的功能需求有用户信息管理、安排列表管理、留言管理等模块,用户角色主要的功能需求有系统登录、查询安排列表信息、查询留言信息等模块。本系统的总体功能设计如图4-1所示。
开发环境
编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序/vue/爬虫/c#/asp.net
系统实现
5.1个人中心
通过设计的个人中心管理功能模块,管理用户可以对相关的个人信息进行管理,比如管理用户可以更新个人账号的密码信息,修改个人账号的用户名信息等,修改密码界面设计如图5-1所示,个人信息界面设计如图5-2所示。
图5-1修改密码界面
图5-2个人信息界面
5.2用户管理
通过设计的用户管理功能模块,管理用户可以对相关的用户信息进行管理,比如管理用户可以查看用户头像信息,更新用户手机号码,删除已经注销的用户信息记录等,用户管理界面设计如图5-3所示。
图5-3用户管理界面
5.3安排列表管理
通过设计的安排列表管理功能模块,管理用户可以对相关的安排列表信息进行管理,比如管理用户可以添加新的安排列表信息记录,更新安排列表完成状态,删除失效的安排列表信息记录等,安排列表管理界面设计如图5-4所示。
图5-4安排列表管理界面
5.4基础数据管理
通过设计的基础数据管理功能模块,管理用户可以对相关的安排类型、公告类型信息进行管理,比如管理用户可以添加新的安排类型、公告类型信息记录,更新安排类型、公告类型名称信息,删除失效的安排类型、公告类型信息记录等,安排类型管理界面设计如图5-5所示,公告类型管理界面设计如图5-6所示。
图5-5安排类型管理界面
图5-6公告类型管理界面
5.5公告信息管理
通过设计的公告信息管理功能模块,管理用户可以对相关的公告信息进行管理,比如管理用户可以添加新的公告信息记录,更新公告发布时间信息,删除失效的公告信息记录等,公告信息管理界面设计如图5-7所示。
图5-7公告信息管理界面
5.6留言版管理
通过设计的留言版管理功能模块,管理用户可以对相关的留言版信息进行管理,比如管理用户可以添加新的留言版信息记录,更新留言内容信息,删除失效的留言版信息记录等,留言版管理界面设计如图5-8所示。
图5-8留言版管理界面
核心代码
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 安排列表
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/anpailiebiao")
public class AnpailiebiaoController {
private static final Logger logger = LoggerFactory.getLogger(AnpailiebiaoController.class);
@Autowired
private AnpailiebiaoService anpailiebiaoService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YonghuService yonghuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = anpailiebiaoService.queryPage(params);
//字典表数据转换
List<AnpailiebiaoView> list =(List<AnpailiebiaoView>)page.getList();
for(AnpailiebiaoView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
AnpailiebiaoEntity anpailiebiao = anpailiebiaoService.selectById(id);
if(anpailiebiao !=null){
//entity转view
AnpailiebiaoView view = new AnpailiebiaoView();
BeanUtils.copyProperties( anpailiebiao , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(anpailiebiao.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("ve")
public R save(@RequestBody AnpailiebiaoEntity anpailiebiao, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,anpailiebiao:{}",this.getClass().getName(),anpailiebiao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
anpailiebiao.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<AnpailiebiaoEntity> queryWrapper = new EntityWrapper<AnpailiebiaoEntity>()
.eq("yonghu_id", anpailiebiao.getYonghuId())
.eq("anpailiebiao_name", anpailiebiao.getAnpailiebiaoName())
.eq("anpailiebiao_types", anpailiebiao.getAnpailiebiaoTypes())
.eq("wancheng_types", anpailiebiao.getWanchengTypes())
.eq("zhuangtai_types", anpailiebiao.getZhuangtaiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
AnpailiebiaoEntity anpailiebiaoEntity = anpailiebiaoService.selectOne(queryWrapper);
if(anpailiebiaoEntity==null){
anpailiebiao.setInsertTime(new Date());
anpailiebiao.setCreateTime(new Date());
Long fenzhong = ( anpailiebiao.getJieshuTime().getTime() - anpailiebiao.getKaishiTime().getTime()) / 1000 / 60;
anpailiebiao.setFenzhong(fenzhong.intValue());
anpailiebiao.setWanchengTypes(1);
anpailiebiao.setZhuangtaiTypes(1);
anpailiebiaoService.insert(anpailiebiao);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody AnpailiebiaoEntity anpailiebiao, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,anpailiebiao:{}",this.getClass().getName(),anpailiebiao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// anpailiebiao.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<AnpailiebiaoEntity> queryWrapper = new EntityWrapper<AnpailiebiaoEntity>()
.notIn("id",anpailiebiao.getId())
.andNew()
.eq("yonghu_id", anpailiebiao.getYonghuId())
.eq("anpailiebiao_name", anpailiebiao.getAnpailiebiaoName())
.eq("anpailiebiao_types", anpailiebiao.getAnpailiebiaoTypes())
.eq("wancheng_types", anpailiebiao.getWanchengTypes())
.eq("zhuangtai_types", anpailiebiao.getZhuangtaiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
AnpailiebiaoEntity anpailiebiaoEntity = anpailiebiaoService.selectOne(queryWrapper);
if(anpailiebiaoEntity==null){
Long fenzhong = ( anpailiebiao.getJieshuTime().getTime() - anpailiebiao.getKaishiTime().getTime()) / 1000 / 60;
anpailiebiao.setFenzhong(fenzhong.intValue());
anpailiebiaoService.updateById(anpailiebiao);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 完成
*/
@RequestMapping("/wancheng")
public R wancheng(@RequestBody Integer id){
logger.debug("wancheng方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
AnpailiebiaoEntity anpailiebiaoEntity = new AnpailiebiaoEntity();
anpailiebiaoEntity.setId(id);
anpailiebiaoEntity.setWanchengTypes(2);
anpailiebiaoService.updateById(anpailiebiaoEntity);//根据id更新
return R.ok();
}
/**
* 恢复
*/
@RequestMapping("/huifu")
public R huifu(@RequestBody AnpailiebiaoEntity anpailiebiao, HttpServletRequest request ){
logger.debug("huifu方法:,,Controller:{},,id:{}",this.getClass().getName(),anpailiebiao);
anpailiebiaoService.updateById(anpailiebiao);//根据id更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
anpailiebiaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<AnpailiebiaoEntity> anpailiebiaoList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
AnpailiebiaoEntity anpailiebiaoEntity = new AnpailiebiaoEntity();
// anpailiebiaoEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// anpailiebiaoEntity.setAnpailiebiaoName(data.get(0)); //安排名称 要改的
// anpailiebiaoEntity.setAnpailiebiaoTypes(Integer.valueOf(data.get(0))); //安排类型 要改的
// anpailiebiaoEntity.setAnpailiebiaoContent("");//照片
// anpailiebiaoEntity.setKaishiTime(new Date(data.get(0))); //开始时间 要改的
// anpailiebiaoEntity.setJieshuTime(new Date(data.get(0))); //结束时间 要改的
// anpailiebiaoEntity.setFenzhong(Integer.valueOf(data.get(0))); //分钟 要改的
// anpailiebiaoEntity.setWanchengTypes(Integer.valueOf(data.get(0))); //是否完成 要改的
// anpailiebiaoEntity.setZhuangtaiTypes(Integer.valueOf(data.get(0))); //状态 要改的
// anpailiebiaoEntity.setInsertTime(date);//时间
// anpailiebiaoEntity.setCreateTime(date);//时间
anpailiebiaoList.add(anpailiebiaoEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
anpailiebiaoService.insertBatch(anpailiebiaoList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
论文参考
目 录
摘要 I
Abstract II
1绪论 1
1.1研究背景与意义 1
1.1.1研究背景 1
1.1.2研究意义 1
1.2国内外研究现状 2
1.2.1国外研究现状 2
1.2.2国内研究现状 2
1.3研究内容与方法 2
1.3.1研究内容 2
1.3.2研究方法 3
1.4论文的组织结构 3
2相关技术介绍 5
2.1 B/S结构 5
2.2 Java语言 5
2.3 SSM框架 5
2.4 MySQL数据库 6
3系统分析 7
3.1系统的需求分析 7
3.2系统的可行性分析 7
3.2.1经济可行性 7
3.2.2技术可行性 7
3.2.3操作可行性 8
4系统设计 9
4.1系统的总体功能设计 9
4.2数据库设计 9
4.2.1概念设计 9
4.2.2逻辑设计 12
5系统实现 14
5.1个人中心 14
5.2用户管理 14
5.3安排列表管理 15
5.4基础数据管理 15
5.5公告信息管理 16
5.6留言版管理 16
6系统测试 17
6.1测试概述 17
6.2测试结果 17
7总结与展望 20
参考文献 21
致谢 22