SpringMVC+Vue项目网上办公自动化系统

末获取源码 

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

应用服务:Tomcat7/Tomcat8

使用框架ssm+vue

JDK版本:jdk1.8

前言介绍  

系统管理也都将通过计算机进行整体智能化操作,对于网上办公自动化系统所牵扯的管理及数据保存都是非常多的,例如管理员;首页、个人中心、员工管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理;员工;首页、个人中心、文件信息管理、会议记录管理、日程安排管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理;等,这给管理者的工作带来了巨大的挑战,面对大量的信息,传统的管理系统,都是通过笔记的方式进行详细信息的统计,后来出现电脑,通过电脑输入软件将纸质的信息统计到电脑上,这种方式比较传统,而且想要统计数据信息比较麻烦,还受时间和空间的影响,所以为此开发了网上办公自动化系统;为员工提供了方便管理平台,方便管理员查看及维护,并且可以通过需求进行内容的编辑及维护等;对于员工而言,可以随时进行查询所需信息,管理员可以足不出户就可以获取到系统的数据信息等,而且还能节省员工很多时间,所以开发网上办公自动化系统给管理者与用户带来了很大的方便,同时也方便管理员对员工信息进行处理。 

系统功能分析和描述 

使用网上办公自动化系统分别为管理员和员工两个权限子模块。

管理员所能使用的功能主要有首页、个人中心、员工管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理等。

员工可以实现首页、个人中心、文件信息管理、会议记录管理、日程安排管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理等。

系统UML用例分析 

管理员用例

管理员登录后可进行首页、个人中心、员工管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理,管理员的用例如图

 

员工用例

员工注册登录后可进行首页、个人中心、文件信息管理、会议记录管理、日程安排管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理,员工用例如图 

系统功能结构图

系统实现

管理员、用户登录功能是系统中一个非常重要的功能模块。这个函数模块需要做的第一件事是设计系统的安全性。不能说任何打开登录界面的人都可以进入系统。我们想控制管理。用户的账号和密码,只有拥有权限的用户才能通过这个登录界面进入系统管理界面,这是非常重要的。用户想要登录和使用系统首先进入登录用户名和登录密码,然后我们使用程序来检索,检索数据库中的用户名信息一致输入用户名密码,如果输入用户名信息让用户登录时,如果它不存在,给一个提示,非法登陆,所以这个功能模块是非常重要的。

员工功能模块

注册、登录,员工通过注册页面填写工号、密码、姓名、性别、联系电话、邮箱、身份证进行注册,信息无误进行登陆如图

 

员工登录进入后台网课课程管理系统可以查看首页、个人中心、文件信息管理、会议记录管理、日程安排管理、员工打卡管理、请假登记管理、工资信息管理、通告信息管理等内容。如图 

 

个人信息界面图 

 

文件信息管理:员工通过文件信息列表可以查看新增、详情、修改、删除等信息,如图

 

会议记录管理 

 

日程安排管理:员工通过日程安排列表可以新增填写工号、姓名、标题、时间、日程内容进行提交操作,如图

 

员工打卡管理

 

 

请假登记管理:员工通过请假登记列表可以新增填写工号、姓名、请假时间、请假天数、请假理由进行提交操作,管理员进行审核回复,如图

 

通告信息管理:员工通过通告信息查看公告标题、公告类型、发布人、发布时间、公告内容等信息,进行详情查看,如图

 

管理员功能模块

管理员登录成功后进入到系统操作界面,查看后台:首页、个人中心、员工打卡管理、请假登记管理、员工管理、工资信息管理、通告信息管理、资产报废管理、资产归还管理、资产事务管理等功能模块进行相对应操作。如图

 

个人中心:管理员通过密码修改列表可以获取原密码、新密码、确认密码等内容,可以进行修改或删除操作,如图

 

员工管理:管理员通过员工信息列表可以获取工号、姓名、性别、联系电话、邮箱、身份证、照片等信息,进行详情或删除操作,如图

 

员工打卡管理

  

请假登记管理:管理员通过请假登记列表可以获取工号、姓名、请假时间、请假天数等信息,可进行审核回复、详情查看,如图

工资信息管理:管理员通过工资信息列表可以新增员工工资,进行详情、修改或删除操作,如图

 

通告信息管理:管理员通过通告信息列表查看公告标题、公告类型、发布人、发布时间、公告内容等信息,进行详情、修改或删除操作,如图

 

部分核心代码: 

/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
		file.transferTo(dest);
		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 void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
		try {
			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
			if (file.exists()) {
				response.reset();
				response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");
				response.setHeader("Cache-Control", "no-cache");
				response.setHeader("Access-Control-Allow-Credentials", "true");
				response.setContentType("application/octet-stream; charset=UTF-8");
				IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}

员工相关controller:

/**
 * 员工
 * 后端接口
 * @author 
 * @email 
 * @date 2021-03-29 15:08:04
 */
@RestController
@RequestMapping("/yuangong")
public class YuangongController {
    @Autowired
    private YuangongService yuangongService;
    
	@Autowired
	private TokenService tokenService;
	
	/**
	 * 登录
	 */
	@IgnoreAuth
	@RequestMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", username));
		if(user==null || !user.getMima().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(), username,"yuangong",  "员工" );
		return R.ok().put("token", token);
	}
	
	/**
     * 注册
     */
	@IgnoreAuth
    @RequestMapping("/register")
    public R register(@RequestBody YuangongEntity yuangong){
    	//ValidatorUtils.validateEntity(yuangong);
    	YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
		if(user!=null) {
			return R.error("注册用户已存在");
		}
		Long uId = new Date().getTime();
		yuangong.setId(uId);
        yuangongService.insert(yuangong);
        return R.ok();
    }
	
	/**
	 * 退出
	 */
	@RequestMapping("/logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        YuangongEntity user = yuangongService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setMima("123456");
        yuangongService.updateById(user);
        return R.ok("密码已重置为:123456");
    }


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,YuangongEntity yuangong, 
		HttpServletRequest request){

        EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
		PageUtils page = yuangongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuangong), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,YuangongEntity yuangong, HttpServletRequest request){
        EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
		PageUtils page = yuangongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuangong), params), params));
        return R.ok().put("data", page);
    }

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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(YuangongEntity yuangong){
        EntityWrapper< YuangongEntity> ew = new EntityWrapper< YuangongEntity>();
 		ew.allEq(MPUtil.allEQMapPre( yuangong, "yuangong")); 
		YuangongView yuangongView =  yuangongService.selectView(ew);
		return R.ok("查询员工成功").put("data", yuangongView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        YuangongEntity yuangong = yuangongService.selectById(id);
        return R.ok().put("data", yuangong);
    }

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



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody YuangongEntity yuangong, HttpServletRequest request){
    	yuangong.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yuangong);
    	YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		yuangong.setId(new Date().getTime());
        yuangongService.insert(yuangong);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody YuangongEntity yuangong, HttpServletRequest request){
    	yuangong.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yuangong);
    	YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
		if(user!=null) {
			return R.error("用户已存在");
		}

		yuangong.setId(new Date().getTime());
        yuangongService.insert(yuangong);
        return R.ok();
    }

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

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        yuangongService.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<YuangongEntity> wrapper = new EntityWrapper<YuangongEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = yuangongService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}


 

 

猜你喜欢

转载自blog.csdn.net/m0_49113107/article/details/124789921