栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

基于javaweb+jsp的财务预算管理系统(SSM+Jsp+Mysql+Layui+Maven)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

基于javaweb+jsp的财务预算管理系统(SSM+Jsp+Mysql+Layui+Maven)

一、项目简述

功能包括:实现公司对项目的管理。
二、项目运行

环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:
JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等




适用

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

        request.getSession().removeAttribute(Config.CURRENT_USERNAME);
        return "login";
    }
    @RequestMapping("/getAllRoles")
    public @ResponseBody Result getAllRoles(){
        try {
            List roles = userInfoService.getAllRoles();
            if (roles.size()>0){
                return ResultUtil.success(roles);
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/role/add")
    public @ResponseBody Result addRole(Role role){
        try {
            int num = userInfoService.addRole(role);
    private void delCookieUser(HttpServletRequest request, HttpServletResponse response){
        UserInfo user = getSessionUser(request.getSession());
        Cookie cookie = new Cookie(Config.CURRENT_USERNAME,user.getUsername()+"_"+user.getId());
        cookie.setMaxAge(-1);
        response.addCookie(cookie);
    }
    
    public UserInfo setSessionUserInfo(UserInfo userInfo, HttpSession session){
        List privileges = privilegeService.getPrivilegeByRoleid(userInfo.getRoleid());
        userInfo.setPrivileges(privileges);
        session.setAttribute(Config.CURRENT_USERNAME,userInfo);
        return userInfo;
    }
    public UserInfo getUserInfo(UserInfo userInfo){
       return userInfoService.getUserInfo(userInfo);
    }
}
数据图形控制层:
@RestController
@RequestMapping("/bills")
public class BillController {
    @Resource
        bill.setType(type);
        bill = getHouseBill(bill,session);
        System.out.println(bill);
        PageModel model = new PageModel<>(pageNo,bill);
        model.setPageSize(pageSize);
        return billService.findByWhere(model);
    }
    @RequestMapping("/getBillsByUserid/{userid}/{pageNo}/{pageSize}/{year}/{month}")
    public Result getBillsByUserid(@PathVariable Integer userid, @PathVariable int pageNo, @PathVariable int pageSize, @PathVariable int year, @PathVariable int month){
        Bill bill = new Bill();
        bill.setUserid(userid);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        bill.setStartTime(year+"-0"+month+"-01");
        try {
            Date date = sdf.parse(year+"-0"+(month+1)+"-01");
            date.setDate(date.getDate()-1);
            bill.setEndTime(sdf.format(date));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        PageModel model = new PageModel<>(pageNo,bill);
        model.setPageSize(pageSize);
        Result result = billService.findByWhere(model);
        List> r = billService.getMonthlyInfo(model);
            int num = userInfoService.updateRole(role);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/role/del/{roleid}")
    public @ResponseBody Result deleteRole(@PathVariable String roleid){
        try {
            privilegeService.delPrivilegesWenDelRole(roleid);
    public Result getBillsByWhere(Bill bill,@PathVariable String type, @PathVariable int pageNo, @PathVariable int pageSize, HttpSession session){
        if("-1".equals(bill.getPayway())){
            bill.setPayway(null);
        }
        bill.setType(type);
        bill = getHouseBill(bill,session);
        System.out.println(bill);
        PageModel model = new PageModel<>(pageNo,bill);
        model.setPageSize(pageSize);
        return billService.findByWhere(model);
    }
    @RequestMapping("/getBillsByUserid/{userid}/{pageNo}/{pageSize}/{year}/{month}")
    public Result getBillsByUserid(@PathVariable Integer userid, @PathVariable int pageNo, @PathVariable int pageSize, @PathVariable int year, @PathVariable int month){
        Bill bill = new Bill();
        bill.setUserid(userid);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    @RequestMapping("/user/add")
    public @ResponseBody Result addUser(UserInfo userInfo){
        System.out.println(userInfo);
        try {
            int num = userInfoService.add(userInfo);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
        response.addCookie(cookie);
    }
    
    public UserInfo setSessionUserInfo(UserInfo userInfo, HttpSession session){
        List privileges = privilegeService.getPrivilegeByRoleid(userInfo.getRoleid());
        userInfo.setPrivileges(privileges);
        session.setAttribute(Config.CURRENT_USERNAME,userInfo);
        return userInfo;
    }
    @RequestMapping("/user/add")
    public @ResponseBody Result addUser(UserInfo userInfo){
        System.out.println(userInfo);
        try {
            int num = userInfoService.add(userInfo);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/user/update")
    public @ResponseBody Result updateUser(UserInfo userInfo){
        try {
            int num = userInfoService.update(userInfo);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        try {
            int num = userInfoService.update(userInfo);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/user/del/{id}")
    public @ResponseBody Result deleteUser(@PathVariable String id){
        try {
            int num = userInfoService.delete(id);
            if(num>0){
                return ResultUtil.success();
            }else {
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/getSessionUser")
     * @param session
     * @return
     */
    public UserInfo setSessionUserInfo(UserInfo userInfo, HttpSession session){
        List privileges = privilegeService.getPrivilegeByRoleid(userInfo.getRoleid());
        userInfo.setPrivileges(privileges);
        session.setAttribute(Config.CURRENT_USERNAME,userInfo);
        return userInfo;
    }
    public UserInfo getUserInfo(UserInfo userInfo){
       return userInfoService.getUserInfo(userInfo);
    }
}
数据图形控制层:
@RestController
@RequestMapping("/bills")
public class BillController {
    @Resource
    private BillService billService;
    /**
     * 适用于统计图
            if(num>0){
                return ResultUtil.success();
            }else {
                privilegeService.addDefaultPrivilegesWhenAddRole(roleid);
                return ResultUtil.unSuccess();
            }
        }catch (Exception e){
            return ResultUtil.error(e);
        }
    }
    @RequestMapping("/getRole/{id}")
    public @ResponseBody Result getRoleById(@PathVariable String id){
        try {
            Role role = userInfoService.getRoleById(id);
            if(role != null){
                return ResultUtil.success(role);
            }else {
                return ResultUtil.unSuccess();
            }

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/888994.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号