当前位置:网站首页>Ssm+ wechat applet to realize property management system
Ssm+ wechat applet to realize property management system
2022-07-02 17:36:00 【Programming compass】
Item number :BS-XCX-003
ssm Wechat applet property management system , There is a website background management system
Project description
Wechat applet property management system , The wechat applet includes the following modules :
Community announcements 、 Application for repair 、 information acquisition 、 Living expenses 、 Second hand replacement
Wechat applet background management interface can add, delete, modify and check community announcements 、 questionnaire 、 Questionnaire questions 、 Questions, options, etc
At the front end of wechat applet , After the user submits the information , You can view the submitted information in my interface , The administrator can view the information submitted by all users in the background management interface of wechat applet .
Running environment
jdk8+tomcat8+mysql5.7+IntelliJ IDEA+maven
Project technology ( Required )
spring+spring mvc+mybatis+layui
Here are the functions of the system :
Property management backstage address
http://localhost:8080/SheQu/
Login account admin 123
Community announcement management
Commodity management
Online questionnaire management
Topic management
Option management
Data query generated by applet side
Maintenance query
Commodity order query
Small program side page function display
Announcement management
Repair management
questionnaire
Living expenses
Online shopping
my
Project core code :
package com.shequ.controller;
import com.alibaba.fastjson.JSON;
import com.shequ.pojo.Admin;
import com.shequ.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;
@Controller
public class AdminController {
@Autowired
AdminService adminService;
@ResponseBody
@RequestMapping("/login")
public String findOneAdmin(String account, String pwd, HttpServletRequest request ){
HttpSession session = request.getSession(true);// newly build session object
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);// newly build session object
Admin admin = (Admin) session.getAttribute("admin"); // Store the corresponding data in session in
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";
}
}
package com.shequ.controller;
import com.alibaba.fastjson.JSON;
import com.shequ.mapper.ChoiceMapper;
import com.shequ.pojo.Choice;
import com.shequ.pojo.Pay;
import com.shequ.pojo.Sur_Que;
import com.shequ.service.ChoiceService;
import com.shequ.service.Sur_QueService;
import com.shequ.util.Layui;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class ChoiceController {
@Autowired
ChoiceService choiceService;
@ResponseBody
@RequestMapping(value = "/findAllChoiceByPage",produces="application/json;charset=UTF-8")
public String findAllChoiceByPage(@RequestParam("limit") String limit, @RequestParam("page") String page) {
int start = (Integer.parseInt(page) - 1)*Integer.parseInt(limit);
int pageSize = Integer.parseInt(limit);
List<Choice> choices = choiceService.findAllChoiceByPage(start,pageSize);
List<Choice> choicesAll = choiceService.findAllChoice();
Layui l = Layui.data(choicesAll.size(), choices);
String result = JSON.toJSONString(l);
return result;
}
@ResponseBody
@RequestMapping(value = "/deleteChoiceById")
public String deleteChoiceById(@RequestParam("id")String id) {
int n = choiceService.deleteChoiceById(Integer.parseInt(id));
if(n>0){
return "success";
}
return "failure";
}
@ResponseBody
@RequestMapping(value = "/insertChoice")
public String insertChoice(@RequestBody Map map) {
int n = choiceService.insertChoice(map);
if(n>0){
return "success";
}
return "failure";
}
@ResponseBody
@RequestMapping(value = "/updateChoiceById")
public String updateChoiceById(@RequestBody Map map) {
int n = choiceService.updateChoiceById(map);
if(n>0){
return "success";
}
return "failure";
}
@ResponseBody
@RequestMapping(value = "/findAllUserSurQueAndOptByPage",produces="application/json;charset=UTF-8")
public String findAllUserSurQueAndOptByPage(@RequestParam("limit") String limit, @RequestParam("page") String page) {
int start = (Integer.parseInt(page) - 1)*Integer.parseInt(limit);
int pageSize = Integer.parseInt(limit);
List<Choice> choices = choiceService.findAllUserSurQueAndOptByPage(start,pageSize);
List<Choice> choiceAll = choiceService.findAllChoice();
Layui l = Layui.data(choiceAll.size(), choices);
String result = JSON.toJSONString(l);
return result;
}
}
package com.shequ.controller;
import com.shequ.util.MyTool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Controller
public class CommonController {
private final Logger log = LoggerFactory.getLogger(CommonController.class);
@RequestMapping("/{pageName}")
public String pathAll(@PathVariable(value="pageName") String pageName){
return pageName;
}
@RequestMapping("/loginOut")
public String loginOut(HttpSession httpSession) {
httpSession.removeAttribute("user");
return "redirect:/";
}
@RequestMapping(value = "/uploadAvatar", method = RequestMethod.POST)
public @ResponseBody Object uploadAvatar(@RequestParam("photo") MultipartFile file, HttpServletRequest request)
throws IllegalStateException, IOException {
Map<String, Object> map = new HashMap<String, Object>();
String name = file.getOriginalFilename();
String imgAbsolutePath = MyTool.SaveImg(file, MyTool.getImg(), name);
map.put("code", 0);
map.put("message", " Upload successful ");
map.put("data", name);
return map;
}
@RequestMapping(value = "/uploadImg", method = RequestMethod.POST)
public @ResponseBody Object uploadImg(@RequestParam("photo") MultipartFile file, HttpServletRequest request)
throws IllegalStateException, IOException {
Map<String, Object> map = new HashMap<String, Object>();
String name = file.getOriginalFilename();
String imgAbsolutePath = MyTool.SaveImg(file, MyTool.getImg(), name);
map.put("code", 0);
map.put("message", " Upload successful ");
map.put("data", name);
return map;
}
@RequestMapping(value = "/uploadContent", method = RequestMethod.POST)
public @ResponseBody Object uploadContent(@RequestParam("file") MultipartFile file, HttpServletRequest request)
throws IllegalStateException, IOException {
Map<String, Object> map = new HashMap<String, Object>();
String name = file.getOriginalFilename();
String imgAbsolutePath = MyTool.SaveImg(file, MyTool.getXmlFile(), name);
map.put("code", 0);
map.put("message", " Upload successful ");
map.put("data", name);
return map;
}
}
package com.shequ.controller;
import com.alibaba.fastjson.JSON;
import com.shequ.pojo.Message;
import com.shequ.service.MessageService;
import com.shequ.util.Layui;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Controller
public class MessageController {
@Autowired
MessageService messageService;
@ResponseBody
@RequestMapping(value = "/findAllMessageByPage",produces="application/json;charset=UTF-8")
public String findAllMessageByPage(@RequestParam("limit") String limit, @RequestParam("page") String page){
int start = (Integer.parseInt(page) - 1)*Integer.parseInt(limit);
int pageSize = Integer.parseInt(limit);
List<Message> message = messageService.findAllMessageByPage(start,pageSize);
List<Message> messageAll = messageService.findAllMessage();
Layui l = Layui.data(messageAll.size(), message);
String result = JSON.toJSONString(l);
return result;
}
@ResponseBody
@RequestMapping(value = "/insertMessage")
public String insertMessage(@RequestBody Map map){
Date date = new Date();
map.put("time",date);
System.out.println("map:"+map.toString());
int n = messageService.insertMessage(map);
if(n>0){
return "success";
}
return "failure";
}
@ResponseBody
@RequestMapping(value = "/deleteNotices")
public String deleteNotices(@RequestParam("id") int id){
int n = messageService.deleteNotices(id);
if(n>0){
return "success";
}
return "failure";
}
@ResponseBody
@RequestMapping(value = "/updateMessage")
public String updateMessage(@RequestBody Map map){
Date date = new Date();
map.put("time",date);
System.out.println("map:"+map.toString());
int n = messageService.updateMessage(map);
if(n>0){
return "success";
}
return "failure";
}
}
package com.shequ.controller;
import com.alibaba.fastjson.JSON;
import com.shequ.pojo.Message;
import com.shequ.pojo.Survey;
import com.shequ.service.SurveyService;
import com.shequ.util.Layui;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
@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";
}
}
边栏推荐
- SAP commerce Cloud Architecture Overview
- Experience home office, feel the completion of the project | community essay solicitation
- Use of nexttile function in MATLAB
- Connect Porsche and 3PL EDI cases
- executescalar mysql_ ExecuteScalar()
- Ocio V2 reverse LUT
- Introduce the scrollintoview() method attribute in detail
- Navigateur Chrome pour un accès rapide au stackoverflow
- 选择 SAP Spartacus 作为 SAP Commerce Cloud Storefront 实现框架的五个理由
- 一年頂十年
猜你喜欢
Experience home office, feel the completion of the project | community essay solicitation
Baobab's gem IPO was terminated: Tang Guangyu once planned to raise 1.8 billion to control 47% of the equity
Sword finger offer 22 The penultimate node in the linked list
Smart trash can (V) - light up OLED
The construction of scalable distributed database cluster and the partition design of oneproxy sub database
Microservice architecture practice: Construction of highly available distributed file system fastdfs architecture
After meeting a full stack developer from Tencent, I saw what it means to be proficient in MySQL tuning
[非线性控制理论]7_High gain and High Frequency
easyswoole3.2重启不成功
【目标跟踪】|SiamFC
随机推荐
例题 非线性整数规划
泡椒凤爪制作教程
After meeting a full stack developer from Tencent, I saw what it means to be proficient in MySQL tuning
常用SQL语句(完整范例)
求简单微分方程
链表求和[dummy+尾插法+函数处理链表引用常见坑位]
Introduction to Hisilicon hi3798mv100 set top box chip [easy to understand]
Common SQL statements (complete example)
CEPH principle
Niuke JS2 file extension
SAP Commerce Cloud 架构概述
Sword finger offer 27 Image of binary tree
线性规划例题 投资的收益与风险
PCL knowledge points - voxelized grid method for down sampling of point clouds
深度之眼(二)——矩阵及其基本运算
AtCoder Beginner Contest 237 VP补题
[非线性控制理论]8_三种鲁棒控制器的比较
SSB threshold_ SSB modulation "suggestions collection"
One year is worth ten years
Vscode + eslint configuration