素材巴巴 > 程序开发 >

基于javaweb SpringBoot的销售团队后台管理系统(java SpringBoot FreeMarker bootstrap echarts mysql)

程序开发 2023-09-05 22:33:19

项目介绍
该项目为后管系统,主要功能包括:

看板、业务机会管理、客户管理、联系人管理、我的日报、团队日报、主数据管理:组织架构管理;系统管理:用户管理、角色管理、菜单管理等;

环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;

6.是否Maven项目:是;

技术栈

  1. 后端:SpringBoot+mybatis

  2. 前端:FreeMarker+Angular+bootstrap+echarts+jQuery

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;

  1. 将项目中application-powerteam.yml配置文件中的数据库配置改为自己的配置;
  2. 前台访问路径:http://localhost:8080/
    登录账号:admin 登录密码:admin请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

                r.setCreateUser(u);}if(StringUtils.isNotBlank(r.getUpdateId())){User u  = userService.findUserById(r.getUpdateId());if(StringUtils.isBlank(u.getNickName())){u.setNickName(u.getLoginName());}r.setUpdateUser(u);}});return roles;}@RequestMapping("add")public String add(ModelMap modelMap){Map map =  new HashMap();map.put("parentId",null);map.put("isShow",false);List menuList = menuService.selectAllMenus(map);modelMap.put("menuList",menuList);return "admin/role/add";}
 
        if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");}if(user.getRoleLists() == null || user.getRoleLists().size() == 0){return  ResponseEntity.failure("用户角色至少选择一个");}User oldUser = userService.findUserById(user.getId());if(StringUtils.isNotBlank(user.getEmail())){if(!user.getEmail().equals(oldUser.getEmail())){if(userService.userCount(user.getEmail())>0){return ResponseEntity.failure("该邮箱已被使用");}}}if(StringUtils.isNotBlank(user.getLoginName())){if(!user.getLoginName().equals(oldUser.getLoginName())) {if (userService.userCount(user.getLoginName()) > 0) {return ResponseEntity.failure("该登录名已存在");}}}
 
    @PostMapping("delete")@ResponseBody@SysLog("删除系统用户数据(单个)")public ResponseEntity delete(@RequestParam(value = "id",required = false)String id){if(StringUtils.isBlank(id)){return ResponseEntity.failure("参数错误");}User user = userService.getById(id);if(user == null){return ResponseEntity.failure("用户不存在");}else if(user.getAdminUser()) {return ResponseEntity.failure("不能删除后台用户");}userService.deleteUser(user);return ResponseEntity.success("操作成功");}
 
        IPage rolePage = roleService.page(new Page<>(page,limit),roleWrapper);rolePageData.setCount(rolePage.getTotal());rolePageData.setData(setUserToRole(rolePage.getRecords()));return rolePageData;}private List setUserToRole(List roles){roles.forEach(r -> {if(StringUtils.isNotBlank(r.getCreateId())){User u = userService.findUserById(r.getCreateId());if(StringUtils.isBlank(u.getNickName())){u.setNickName(u.getLoginName());}r.setCreateUser(u);}if(StringUtils.isNotBlank(r.getUpdateId())){User u  = userService.findUserById(r.getUpdateId());if(StringUtils.isBlank(u.getNickName())){u.setNickName(u.getLoginName());}
 
        return "admin/user/add";}@RequiresPermissions("sys:user:add")@PostMapping("add")@ResponseBody@SysLog("保存新增系统用户数据")public ResponseEntity add(@RequestBody  User user){if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");}if(user.getRoleLists() == null || user.getRoleLists().size() == 0){return  ResponseEntity.failure("用户角色至少选择一个");}if(userService.userCount(user.getLoginName())>0){return ResponseEntity.failure("登录名称已经存在");}
 //        if(StringUtils.isNotBlank(user.getEmail())){
 //            if(userService.userCount(user.getEmail())>0){
 //                return ResponseEntity.failure("该邮箱已被使用");
 //            }
 
                               ServletRequest request){Map map = WebUtils.getParametersStartingWith(request, "s_");PageData rolePageData = new PageData<>();QueryWrapper roleWrapper = new QueryWrapper<>();roleWrapper.eq("del_flag",false);if(!map.isEmpty()){String keys = (String) map.get("key");if(StringUtils.isNotBlank(keys)) {roleWrapper.like("name", keys);}}IPage rolePage = roleService.page(new Page<>(page,limit),roleWrapper);rolePageData.setCount(rolePage.getTotal());rolePageData.setData(setUserToRole(rolePage.getRecords()));return rolePageData;}private List setUserToRole(List roles){roles.forEach(r -> {if(StringUtils.isNotBlank(r.getCreateId())){User u = userService.findUserById(r.getCreateId());if(StringUtils.isBlank(u.getNickName())){u.setNickName(u.getLoginName());}
 
        userService.saveUserRoles(user.getId(),user.getRoleLists());return ResponseEntity.success("操作成功");}@RequestMapping("edit")public String edit(String id,ModelMap modelMap){User user = userService.findUserById(id);String roleIds = "";if(user != null) {roleIds = user.getRoleLists().stream().map(role -> role.getId()).collect(Collectors.joining(","));}List roleList = roleService.selectAll();modelMap.put("localuser",user);modelMap.put("roleIds",roleIds);modelMap.put("roleList",roleList);return "admin/user/edit";}@RequiresPermissions("sys:user:edit")@PostMapping("edit")@ResponseBody@SysLog("保存系统用户编辑数据")public ResponseEntity edit(@RequestBody  User user){if(StringUtils.isBlank(user.getId())){
 
                userWrapper.eq("is_admin", "admin".equals(type) ? true : false);}String keys = (String) map.get("key");if(StringUtils.isNotBlank(keys)) {userWrapper.and(wrapper -> wrapper.like("login_name", keys).or().like("tel", keys).or().like("email", keys));}}IPage userPage = userService.page(new Page<>(page,limit),userWrapper);userPageData.setCount(userPage.getTotal());userPageData.setData(userPage.getRecords());return userPageData;}@RequestMapping("add")public String add(ModelMap modelMap){List roleList = roleService.selectAll();modelMap.put("roleList",roleList);return "admin/user/add";}@RequiresPermissions("sys:user:add")@PostMapping("add")@ResponseBody@SysLog("保存新增系统用户数据")
 
    @ResponseBody@SysLog("保存新增系统用户数据")public ResponseEntity add(@RequestBody  User user){if(StringUtils.isBlank(user.getLoginName())){return ResponseEntity.failure("登录名不能为空");}if(user.getRoleLists() == null || user.getRoleLists().size() == 0){return  ResponseEntity.failure("用户角色至少选择一个");}if(userService.userCount(user.getLoginName())>0){return ResponseEntity.failure("登录名称已经存在");}
 //        if(StringUtils.isNotBlank(user.getEmail())){
 //            if(userService.userCount(user.getEmail())>0){
 //                return ResponseEntity.failure("该邮箱已被使用");
 //            }
 //        }
 //        if(StringUtils.isNoneBlank(user.getTel())){
 //            if(userService.userCount(user.getTel())>0){
 //                return ResponseEntity.failure("该手机号已被绑定");
 //            }
 //        }//设置默认密码if(StringUtils.isBlank(user.getPassword())){user.setPassword(Constants.DEFAULT_PASSWORD);}userService.saveUser(user);
 
            if(!user.getPassword().equals(password)){return ResponseEntity.failure("旧密码错误");}user.setPassword(newPwd);Encodes.entryptPassword(user);userService.updateById(user);return ResponseEntity.success("操作成功");}else {//小程序修改密码User user = userService.findUserByLoginName(userName);byte[] hashPassword = Encodes.sha1(oldPwd.getBytes(), Encodes.SHA1, Encodes.decodeHex(user.getSalt()), Constants.HASH_INTERATIONS);String password = Encodes.encodeHex(hashPassword);if(!user.getPassword().equals(password)){return ResponseEntity.failure("旧密码错误");}user.setPassword(newPwd);Encodes.entryptPassword(user);userService.updateById(user);return ResponseEntity.success("操作成功");}}@SysLog("上传头像")@PostMapping("uploadFace")@ResponseBody
 


标签:

上一篇: vue-cli的安装、卸载和升级 下一篇:
素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。