package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
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.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.GongrenxinxiEntity;
import com.entity.view.GongrenxinxiView;
import com.service.GongrenxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 工人信息
* 后端接口
* @author
* @email
* @date 2020-04-28 22:02:53
*/
@RestController
@RequestMapping("/gongrenxinxi")
public class GongrenxinxiController {
@Autowired
private GongrenxinxiService gongrenxinxiService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
GongrenxinxiEntity user = gongrenxinxiService.selectOne(new EntityWrapper<GongrenxinxiEntity>().eq("gonghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"gongrenxinxi", "工人信息");
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody GongrenxinxiEntity gongrenxinxi){
//ValidatorUtils.validateEntity(gongrenxinxi);
GongrenxinxiEntity user = gongrenxinxiService.selectOne(new EntityWrapper<GongrenxinxiEntity>().eq("gonghao", gongrenxinxi.getGonghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
gongrenxinxi.setId(new Date().getTime());
gongrenxinxiService.insert(gongrenxinxi);
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");
GongrenxinxiEntity user = gongrenxinxiService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
GongrenxinxiEntity user = gongrenxinxiService.selectOne(new EntityWrapper<GongrenxinxiEntity>().eq("gonghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
gongrenxinxiService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,GongrenxinxiEntity gongrenxinxi, HttpServletRequest request){
EntityWrapper<GongrenxinxiEntity> ew = new EntityWrapper<GongrenxinxiEntity>();
PageUtils page = gongrenxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongrenxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,GongrenxinxiEntity gongrenxinxi, HttpServletRequest request){
EntityWrapper<GongrenxinxiEntity> ew = new EntityWrapper<GongrenxinxiEntity>();
PageUtils page = gongrenxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongrenxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( GongrenxinxiEntity gongrenxinxi){
EntityWrapper<GongrenxinxiEntity> ew = new EntityWrapper<GongrenxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( gongrenxinxi, "gongrenxinxi"));
return R.ok().put("data", gongrenxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(GongrenxinxiEntity gongrenxinxi){
EntityWrapper< GongrenxinxiEntity> ew = new EntityWrapper< GongrenxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( gongrenxinxi, "gongrenxinxi"));
GongrenxinxiView gongrenxinxiView = gongrenxinxiService.selectView(ew);
return R.ok("查询工人信息成功").put("data", gongrenxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
GongrenxinxiEntity gongrenxinxi = gongrenxinxiService.selectById(id);
return R.ok().put("data", gongrenxinxi);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
GongrenxinxiEntity gongrenxinxi = gongrenxinxiService.selectById(id);
return R.ok().put("data", gongrenxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongrenxinxiEntity gongrenxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(gongrenxinxi);
GongrenxinxiEntity user = gongrenxinxiService.selectOne(new EntityWrapper<GongrenxinxiEntity>().eq("gonghao", gongrenxinxi.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
gongrenxinxi.setId(new Date().getTime());
gongrenxinxiService.insert(gongrenxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody GongrenxinxiEntity gongrenxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(gongrenxinxi);
GongrenxinxiEntity user = gongrenxinxiService.selectOne(new EntityWrapper<GongrenxinxiEntity>().eq("gonghao", gongrenxinxi.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
gongrenxinxi.setId(new Date().getTime());
gongrenxinxiService.insert(gongrenxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody GongrenxinxiEntity gongrenxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(gongrenxinxi);
gongrenxinxiService.updateById(gongrenxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
gongrenxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
没有合适的资源?快使用搜索试试~ 我知道了~
java智慧工地管理系统的设计毕业设计程序
共409个文件
java:110个
class:110个
vue:74个
需积分: 44 43 下载量 70 浏览量
2020-07-30
19:25:49
上传
评论 8
收藏 1.62MB ZIP 举报
温馨提示
采用java技术构建的一个管理系统。整个开发过程首先对系统进行需求分析,得出系统的主要功能。接着对系统进行总体设计和详细设计。总体设计主要包括系统功能设计、系统总体结构设计、系统数据结构设计和系统安全设计等;详细设计主要包括系统数据库访问的实现,主要功能模块的具体实现,模块实现关键代码等。最后对系统进行功能测试,并对测试结果进行分析总结。 包括程序毕设程序源代码一份,数据库一份,完美运行。配置环境里面有说明。
资源推荐
资源详情
资源评论
收起资源包目录
java智慧工地管理系统的设计毕业设计程序 (409个子文件)
CommonController.class 10KB
GongrenxinxiController.class 10KB
QingjiaxinxiController.class 8KB
PaigongxinxiController.class 8KB
KaoqinxinxiController.class 8KB
CigongxinxiController.class 8KB
DakaxinxiController.class 8KB
AnquanshengchanController.class 7KB
ShigongjinduController.class 7KB
ZijinguanliController.class 7KB
UserController.class 6KB
PageUtils.class 6KB
FileController.class 4KB
QingjiaxinxiEntity.class 4KB
CigongxinxiEntity.class 4KB
MPUtil.class 4KB
AnquanshengchanServiceImpl.class 4KB
KaoqinxinxiEntity.class 4KB
PaigongxinxiEntity.class 4KB
QingjiaxinxiServiceImpl.class 4KB
GongrenxinxiServiceImpl.class 4KB
ShigongjinduServiceImpl.class 4KB
PaigongxinxiServiceImpl.class 4KB
ZijinguanliServiceImpl.class 4KB
CigongxinxiServiceImpl.class 4KB
KaoqinxinxiServiceImpl.class 4KB
GongrenxinxiEntity.class 4KB
DakaxinxiServiceImpl.class 4KB
ShigongjinduEntity.class 4KB
ZijinguanliEntity.class 4KB
ConfigController.class 4KB
DakaxinxiEntity.class 4KB
AuthorizationInterceptor.class 3KB
AnquanshengchanEntity.class 3KB
Query.class 3KB
TokenEntity.class 3KB
QingjiaxinxiModel.class 2KB
QingjiaxinxiVO.class 2KB
CommonServiceImpl.class 2KB
CigongxinxiModel.class 2KB
CigongxinxiVO.class 2KB
KaoqinxinxiModel.class 2KB
KaoqinxinxiVO.class 2KB
TokenServiceImpl.class 2KB
PaigongxinxiModel.class 2KB
PaigongxinxiVO.class 2KB
ShigongjinduModel.class 2KB
ZijinguanliModel.class 2KB
ShigongjinduVO.class 2KB
ZijinguanliVO.class 2KB
R.class 2KB
DakaxinxiModel.class 2KB
DakaxinxiVO.class 2KB
UserServiceImpl.class 2KB
UserEntity.class 2KB
ValidatorUtils.class 2KB
SpringContextUtils.class 2KB
AnquanshengchanService.class 2KB
AnquanshengchanDao.class 2KB
QingjiaxinxiService.class 2KB
GongrenxinxiService.class 2KB
PaigongxinxiService.class 2KB
ShigongjinduService.class 2KB
CigongxinxiService.class 2KB
KaoqinxinxiService.class 2KB
ZijinguanliService.class 2KB
GongrenxinxiModel.class 2KB
GongrenxinxiVO.class 2KB
QingjiaxinxiDao.class 2KB
ShigongjinduDao.class 2KB
PaigongxinxiDao.class 2KB
GongrenxinxiDao.class 2KB
DakaxinxiService.class 2KB
KaoqinxinxiDao.class 2KB
ZijinguanliDao.class 2KB
CigongxinxiDao.class 2KB
DakaxinxiDao.class 2KB
ConfigServiceImpl.class 2KB
TypeEnum.class 1KB
AnquanshengchanModel.class 1KB
JQPageInfo.class 1KB
EIException.class 1KB
AnquanshengchanVO.class 1KB
ConfigEntity.class 1KB
SQLFilter.class 1KB
AnquanshengchanView.class 1KB
ShigongjinduView.class 1KB
GongrenxinxiView.class 1KB
QingjiaxinxiView.class 1KB
PaigongxinxiView.class 1KB
KaoqinxinxiView.class 1KB
CigongxinxiView.class 1KB
ZijinguanliView.class 1KB
BaiduUtil.class 1KB
DakaxinxiView.class 1KB
TokenService.class 1KB
CommonDao.class 924B
TokenDao.class 907B
UserDao.class 900B
MyMetaObjectHandler.class 900B
共 409 条
- 1
- 2
- 3
- 4
- 5
资源评论
普通网友
- 粉丝: 85
- 资源: 107
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功