Java项目:(小程序)物业管理系统(spring+spring mvc+mybatis+layui+微信小程)

news/2024/7/20 3:44:00 标签: java, 小程序, spring, maven, layui

源码获取:博客首页 "资源" 里下载!

一、项目简述

本系统功能包括: 微信小程序物业管理系统,微信朝胞括以下几个模 块: 社区公告、报修、信息采集、生活缴费、二手置换 微信小程序后台管理界面可以增删改查社区公告、问卷、 问卷问题、问题选项等 在微信小程序前端,用户提交信息后,可在我的界面查看 提交的信息,管理员可以在微信小程序后台管理界面查看 所有用户提交的信息。

二、项目运行

环境配置: jdk8+tomcat8+mysql5.7+lntelliJ IDEA+maven( Eclispe ,sts myEclispe 都支持)

项目技术: spring+spring mvc+mybatis+layui等等。

商品信息控制层:

@Controller
public class GoodsController {
    @Autowired
    GoodsService goodsService;

    @ResponseBody
    @RequestMapping(value = "/findAllGoodsByPages",produces="application/json;charset=UTF-8")
    public String findAllGoodsByPages(@RequestParam("limit") String limit, @RequestParam("page") String page){
        int start = (Integer.parseInt(page) - 1)*Integer.parseInt(limit);
        int pageSize = Integer.parseInt(limit);
        List<Goods> goods = goodsService.findAllGoodsByPages(start,pageSize);
        List<Goods> goodsAll = goodsService.findAllGoods();
        Layui l = Layui.data(goodsAll.size(), goods);
        String result = JSON.toJSONString(l);
        System.out.println(result);
        return result;
    }

    @ResponseBody
    @RequestMapping(value = "/deleteGoodsById")
    public String deleteGoodsById(@RequestParam("goods_id") String goods_id){
        int n = goodsService.deleteGoodsById(goods_id);
        if(n>0){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/updateGoodsById")
    public String updateGoodsById(@RequestBody Map map){
        Date date = new Date();
        map.put("publish_time",date);
        System.out.println("map:"+map.toString());
        int n = goodsService.updateGoodsById(map);
        if(n>0){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/insertGoods")
    public String insertGoods(@RequestBody Map map){
        Date date = new Date();
        map.put("publish_time",date);
        String goods_id = RandNum.getGUID();
        map.put("goods_id",goods_id);
        System.out.println("map:"+map.toString());
        int n = goodsService.insertGoods(map);
        if(n>0){
            return "success";
        }
        return "failure";
    }
}

管理员控制层:

@Controller
public class AdminController {
    @Autowired
    AdminService adminService;

    @ResponseBody
    @RequestMapping("/login")
    public String findOneAdmin(String account, String pwd, HttpServletRequest request ){
        HttpSession session = request.getSession(true);//新建session对象
        Admin admin = adminService.findOneAdmin(account,pwd);
        session.setAttribute("admin",admin);
        if(admin!=null){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/findAllAccount",produces="application/json;charset=UTF-8")
    public String findAllAccount(){
        List<Admin> accounts = adminService.findAllAccount();
        String result = JSON.toJSONString(accounts);
        System.out.println(result);
        return result;
    }


    @ResponseBody
    @RequestMapping(value = "/updateAdminPwd" )
    public String updateAdminPwd(@RequestBody Map map, HttpServletRequest request){
        HttpSession session = request.getSession(true);//新建session对象
        Admin admin = (Admin) session.getAttribute("admin");  //将对应数据存入session中
        String account = admin.getAccount();
        System.out.println(map);
        String pwd = map.get("pwd").toString();
        System.out.println("pwd:"+pwd);
        int n = adminService.updateAdminPwd(pwd,account);
        if(n>0){
            return "success";
        }
        return "failure";
    }


}

调查管理控制层:

@Controller
public class SurveyController {
   @Autowired
   SurveyService surveyService;

    @ResponseBody
    @RequestMapping(value = "/findAllSurveyByPage",produces="application/json;charset=UTF-8")
    public String findAllSurveyByPage(@RequestParam("limit") String limit, @RequestParam("page") String page) {
        int start = (Integer.parseInt(page) - 1)*Integer.parseInt(limit);
        int pageSize = Integer.parseInt(limit);
        List<Survey> surveys = surveyService.findAllSurveyByPage(start,pageSize);
        List<Survey> surveyAll = surveyService.findAllSurvey();
        Layui l = Layui.data(surveyAll.size(), surveys);
        String result = JSON.toJSONString(l);
        return result;
    }

    @ResponseBody
    @RequestMapping(value = "/findAllSurvey",produces="application/json;charset=UTF-8")
    public String findAllSurvey() {
        List<Survey> surveys = surveyService.findAllSurvey();
        String result = JSON.toJSONString(surveys);
        return result;
    }

    @ResponseBody
    @RequestMapping(value = "/insertSurvey")
    public String insertSurvey(@RequestBody Map map) {
        int n = surveyService.insertSurvey(map);
        if(n>0){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/deleteSurveyById")
    public String deleteSurveyById(@RequestParam("id")String id) {
        int n = surveyService.deleteSurveyById(Integer.parseInt(id));
        if(n>0){
            return "success";
        }
        return "failure";
    }

    @ResponseBody
    @RequestMapping(value = "/updateSurveyById")
    public String updateSurveyById(@RequestBody Map map) {
        int n = surveyService.updateSurveyById(map);
        if(n>0){
            return "success";
        }
        return "failure";
    }

}

源码获取:博客首页 "资源" 里下载!


http://www.niftyadmin.cn/n/1554435.html

相关文章

Java项目:(小程序)全套商城系统(spring+spring mvc+mybatis+layui+微信小程)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 本系统功能包括: 商品模块: 商品添加、规格设置&#xff0c;商品上下架等 订单模块: 下单、购物车、支付&#xff0c;发货、收货、评 退款等 营销模块: 积分、优惠券、分销、砍价、拼团、秒 多…

红帽linux7.2安装教程,RedHat Linux 7.2中Nmon安装使用

前提在RedHat Linux 7.2安装时遇到一个问题&#xff0c;设置ip以后则ping不通&#xff0c;简单总结几步&#xff1a;1、设置ip 进入/etc/sysconfig/network-scripts目录下&#xff0c;修改文件名为ifcfg-eno16777736(或eth0文件)2、关闭防火墙&#xff0c;临时关闭service ipta…

Java项目:校园人力人事资源管理系统(java+Springboot+ssm+mysql+jsp+maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 校园人力资源管理系统&#xff1a;学校部门管理&#xff0c;教室管理&#xff0c;学历信息管理&#xff0c;职务&#xff0c;教师职称&#xff0c;奖励&#xff0c;学历&#xff0c;社会关系&#xff0c;工作…

linux java进程命令,linux 所有java进程命令

linux 所有java进程命令[2021-02-05 04:46:00] 简介:php去除nbsp的方法&#xff1a;首先创建一个PHP代码示例文件&#xff1b;然后通过“preg_replace("/(\s|\&nbsp\;| |\xc2\xa0)/", " ", strip_tags($val));”方法去除所有nbsp即可。推荐&#xff…

Java项目:化妆品商城系统(java+Springboot+ssm+mysql+jsp+maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 本系统主要实现的功能有&#xff1a; 网上商城系统&#xff0c;前台后台管理&#xff0c;用户注册&#xff0c;登录&#xff0c;上架展示&#xff0c;分组展示&#xff0c;搜索&#xff0c;收…

linux+windows+位+存储空间,浅谈linux空间与windows空间,看完你学会了么

如今的虚拟主机市场纷繁复杂&#xff0c;产品类型多种多样&#xff0c;如HostEase主机就有多种主机产品&#xff0c;最为常见的空间系统也分为linux空间与windows空间两种类型。对于网站新手站长来说&#xff0c;建站期间必然会有一连串的困扰&#xff0c;而最先产生的疑问无疑…

Java项目:在线书城书店系统(java+jdbc+Servlet+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一个基于Java的网上书店的设计与实现&#xff0c;归纳出了几个模块&#xff0c;首先是登录注册模块&#xff0c;购物车模块&#xff0c;订单模块&#xff0c;个人中心模块&#xff0c;用户管理模块&#xff…

Java项目:汽车出租租赁系统(java+jsp+SSM+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能包括&#xff1a; 车辆管理&#xff0c;出租管理&#xff0c;汽车入库&#xff0c;汽车出租&#xff0c;汽车归还&#xff0c; 客户管理&#xff0c;出租单管理&#xff0c;统计分析等等功…