package com.controller;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WuyeguanliEntity;
import com.entity.view.WuyeguanliView;
import com.service.WuyeguanliService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 物业管理
* 后端接口
* @author
* @email
* @date 2023-02-25 16:19:37
*/
@RestController
@RequestMapping("/wuyeguanli")
public class WuyeguanliController {
@Autowired
private WuyeguanliService wuyeguanliService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
WuyeguanliEntity u = wuyeguanliService.selectOne(new EntityWrapper<WuyeguanliEntity>().eq("zhanghao", username));
if(u==null || !u.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(u.getId(), username,"wuyeguanli", "物业管理" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody WuyeguanliEntity wuyeguanli){
//ValidatorUtils.validateEntity(wuyeguanli);
WuyeguanliEntity u = wuyeguanliService.selectOne(new EntityWrapper<WuyeguanliEntity>().eq("zhanghao", wuyeguanli.getZhanghao()));
if(u!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
wuyeguanli.setId(uId);
wuyeguanliService.insert(wuyeguanli);
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");
WuyeguanliEntity u = wuyeguanliService.selectById(id);
return R.ok().put("data", u);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
WuyeguanliEntity u = wuyeguanliService.selectOne(new EntityWrapper<WuyeguanliEntity>().eq("zhanghao", username));
if(u==null) {
return R.error("账号不存在");
}
u.setMima("123456");
wuyeguanliService.updateById(u);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WuyeguanliEntity wuyeguanli,
HttpServletRequest request){
EntityWrapper<WuyeguanliEntity> ew = new EntityWrapper<WuyeguanliEntity>();
PageUtils page = wuyeguanliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wuyeguanli), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WuyeguanliEntity wuyeguanli,
HttpServletRequest request){
EntityWrapper<WuyeguanliEntity> ew = new EntityWrapper<WuyeguanliEntity>();
PageUtils page = wuyeguanliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wuyeguanli), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( WuyeguanliEntity wuyeguanli){
EntityWrapper<WuyeguanliEntity> ew = new EntityWrapper<WuyeguanliEntity>();
ew.allEq(MPUtil.allEQMapPre( wuyeguanli, "wuyeguanli"));
return R.ok().put("data", wuyeguanliService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(WuyeguanliEntity wuyeguanli){
EntityWrapper< WuyeguanliEntity> ew = new EntityWrapper< WuyeguanliEntity>();
ew.allEq(MPUtil.allEQMapPre( wuyeguanli, "wuyeguanli"));
WuyeguanliView wuyeguanliView = wuyeguanliService.selectView(ew);
return R.ok("查询物业管理成功").put("data", wuyeguanliView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WuyeguanliEntity wuyeguanli = wuyeguanliService.selectById(id);
return R.ok().put("data", wuyeguanli);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WuyeguanliEntity wuyeguanli = wuyeguanliService.selectById(id);
return R.ok().put("data", wuyeguanli);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WuyeguanliEntity wuyeguanli, HttpServletRequest request){
wuyeguanli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wuyeguanli);
WuyeguanliEntity u = wuyeguanliService.selectOne(new EntityWrapper<WuyeguanliEntity>().eq("zhanghao", wuyeguanli.getZhanghao()));
if(u!=null) {
return R.error("用户已存在");
}
wuyeguanli.setId(new Date().getTime());
wuyeguanliService.insert(wuyeguanli);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody WuyeguanliEntity wuyeguanli, HttpServletRequest request){
wuyeguanli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wuyeguanli);
WuyeguanliEntity u = wuyeguanliService.selectOne(new EntityWrapper<WuyeguanliEntity>().eq("zhanghao", wuyeguanli.getZhanghao()));
if(u!=null) {
return R.error("用户已存在");
}
wuyeguanli.setId(new Date().getTime());
wuyeguanliService.insert(wuyeguanli);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody WuyeguanliEntity wuyeguanli, HttpServletRequest request){
//ValidatorUtils.validateEntity(wuyeguanli);
wuyeguanliService.updateById(wuyeguanli);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wuyeguanliService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVaria
没有合适的资源?快使用搜索试试~ 我知道了~
物业-物业系统-物业系统源码-物业管理系统-物业管理系统java代码-基于Web的物业系统设计与实现-物业系统设计与实现-代码
共523个文件
java:179个
svg:161个
vue:62个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 159 浏览量
2024-03-20
17:18:45
上传
评论
收藏 10.88MB ZIP 举报
温馨提示
物业-物业系统-物业系统源码-物业管理系统-物业管理系统java代码-物业系统设计与实现-基于springboot的物业系统-基于Web的物业系统设计与实现-物业网站-物业网站代码-物业平台-物业平台代码-物业项目-物业项目代码-物业代码 1、技术栈:java,springboot,vue,ajax,maven,mysql,MyBatisPlus等 开发语言:Java 框架:SpringBoot JDK版本:JDK1.8 数据库:mysql 5.7 数据库工具:SQLyog/Navicat 开发软件:eclipse/myeclipse/idea Maven包:Maven 浏览器:谷歌浏览器 2、系统的实现 用户信息 图片素材 视频素材 摘 要 I 目 录 III 第1章 绪论 1 1.1选题动因 1 1.2背景与意义 1 第2章 相关技术介绍 3 2.1 MySQL数据库 3 2.2 Vue前端技术 3 2.3 B/S架构模式 4 2.4 ElementUI介绍 4 第3章 系统分析 5 3.1 可行性分析 5 3.1.1技术可行性 5 3.1.2经济可行性 5 3.1.3运行
资源推荐
资源详情
资源评论
收起资源包目录
物业-物业系统-物业系统源码-物业管理系统-物业管理系统java代码-基于Web的物业系统设计与实现-物业系统设计与实现-代码
(523个子文件)
update-password.vue.bak 3KB
main.js.bak 2KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 2KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.1f75990f.css 371KB
chunk-vendors.1f0a25b2.css 37KB
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-4.css 61B
canvas-bg-5.css 61B
canvas-bg-3.css 61B
1677313338420.doc 10KB
1677313304738.doc 10KB
必读推荐.docx 15KB
.factorypath 15KB
.gitignore 364B
index.html 968B
index.html 602B
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
WuyeguanliController.java 9KB
WeixiuyuanController.java 9KB
YezhuController.java 9KB
TingchexinxiController.java 8KB
WeixiuchuliController.java 8KB
BaoxiuxinxiController.java 8KB
TousuchuliController.java 8KB
TousuxinxiController.java 8KB
XiaoqugonggaoController.java 8KB
BaiduUtil.java 8KB
CommonController.java 7KB
FuwupingjiaController.java 7KB
JiaofeixinxiController.java 7KB
CheweixinxiController.java 7KB
FangchanxinxiController.java 7KB
HuodongxinxiController.java 7KB
XiaoquxinxiController.java 7KB
TousufenleiController.java 7KB
TingcheweiController.java 7KB
FangchanxinxiEntity.java 5KB
UsersController.java 5KB
MPUtil.java 5KB
MavenWrapperDownloader.java 5KB
FuwupingjiaEntity.java 5KB
JiaofeixinxiEntity.java 4KB
CommonUtil.java 4KB
TingchexinxiEntity.java 4KB
FileController.java 4KB
WeixiuchuliEntity.java 4KB
FangchanxinxiModel.java 4KB
FangchanxinxiVO.java 4KB
BaoxiuxinxiEntity.java 4KB
TousuxinxiEntity.java 4KB
CheweixinxiEntity.java 4KB
XiaoquxinxiEntity.java 4KB
TousuchuliEntity.java 3KB
YezhuEntity.java 3KB
FuwupingjiaModel.java 3KB
WuyeguanliEntity.java 3KB
WeixiuyuanEntity.java 3KB
FuwupingjiaVO.java 3KB
AuthorizationInterceptor.java 3KB
HuodongxinxiEntity.java 3KB
JiaofeixinxiModel.java 3KB
TingcheweiEntity.java 3KB
ConfigController.java 3KB
XiaoqugonggaoEntity.java 3KB
JiaofeixinxiVO.java 3KB
TingchexinxiModel.java 3KB
WeixiuchuliModel.java 3KB
TingchexinxiVO.java 3KB
WeixiuchuliVO.java 3KB
TousuxinxiModel.java 3KB
BaoxiuxinxiModel.java 3KB
Query.java 3KB
TousuxinxiVO.java 3KB
BaoxiuxinxiVO.java 3KB
CheweixinxiModel.java 2KB
TokenServiceImpl.java 2KB
CheweixinxiVO.java 2KB
TousuchuliModel.java 2KB
YezhuModel.java 2KB
XiaoquxinxiModel.java 2KB
WuyeguanliModel.java 2KB
WeixiuyuanModel.java 2KB
TousuchuliVO.java 2KB
YezhuVO.java 2KB
XiaoquxinxiVO.java 2KB
WuyeguanliVO.java 2KB
TokenEntity.java 2KB
WeixiuyuanVO.java 2KB
TousufenleiEntity.java 2KB
共 523 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
十五喵
- 粉丝: 5737
- 资源: 2587
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功