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.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.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.YuangongEntity;
import com.entity.view.YuangongView;
import com.service.YuangongService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 员工
* 后端接口
* @author
* @email
* @date 2021-04-27 11:11:19
*/
@RestController
@RequestMapping("/yuangong")
public class YuangongController {
@Autowired
private YuangongService yuangongService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"yuangong", "员工" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody YuangongEntity yuangong){
//ValidatorUtils.validateEntity(yuangong);
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
yuangong.setId(uId);
yuangongService.insert(yuangong);
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");
YuangongEntity user = yuangongService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
yuangongService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,YuangongEntity yuangong,
HttpServletRequest request){
EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
PageUtils page = yuangongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuangong), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,YuangongEntity yuangong,
HttpServletRequest request){
EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
PageUtils page = yuangongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuangong), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( YuangongEntity yuangong){
EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
ew.allEq(MPUtil.allEQMapPre( yuangong, "yuangong"));
return R.ok().put("data", yuangongService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(YuangongEntity yuangong){
EntityWrapper< YuangongEntity> ew = new EntityWrapper< YuangongEntity>();
ew.allEq(MPUtil.allEQMapPre( yuangong, "yuangong"));
YuangongView yuangongView = yuangongService.selectView(ew);
return R.ok("查询员工成功").put("data", yuangongView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YuangongEntity yuangong = yuangongService.selectById(id);
return R.ok().put("data", yuangong);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YuangongEntity yuangong = yuangongService.selectById(id);
return R.ok().put("data", yuangong);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YuangongEntity yuangong, HttpServletRequest request){
yuangong.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yuangong);
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yuangong.setId(new Date().getTime());
yuangongService.insert(yuangong);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YuangongEntity yuangong, HttpServletRequest request){
yuangong.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yuangong);
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("gonghao", yuangong.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yuangong.setId(new Date().getTime());
yuangongService.insert(yuangong);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YuangongEntity yuangong, HttpServletRequest request){
//ValidatorUtils.validateEntity(yuangong);
yuangongService.updateById(yuangong);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yuangongService.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;
Date re
没有合适的资源?快使用搜索试试~ 我知道了~
智能物流-java-基于springBoot智能物流管理系统设计与实现(毕业论文)
共421个文件
svg:161个
java:106个
vue:42个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 73 浏览量
2024-10-22
15:32:01
上传
评论
收藏 8.79MB RAR 举报
温馨提示
管理员模块的实现 顾客信息管理 智能物流管理系统的系统管理员可以管理顾客信息,可以对顾客信息信息添加修改删除以及查询操作 员工信息管理 系统管理员可以查看对员工信息信息进行添加,修改,删除以及查询操作 店主模块的实现 员工信息管理 店主可以对员工信息信息进行修改,删除以及查询操作 门店信息管理 店主可以对门店信息信息进行修改操作,还可以对门店信息信息进行查询 员工模块的实现 门店信息管理 员工登录可以查看门店信息 订单信息管理 员工登录后可以对订单信息进行审核操作。
资源推荐
资源详情
资源评论
收起资源包目录
智能物流-java-基于springBoot智能物流管理系统设计与实现(毕业论文) (421个子文件)
update-password.vue.bak 3KB
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.926a58a8.css 250KB
chunk-vendors.0fdd4e14.css 37KB
.factorypath 15KB
.gitignore 364B
index.html 924B
index.html 552B
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
YuangongController.java 9KB
DianzhuController.java 9KB
GukeController.java 8KB
CommonController.java 8KB
GongzuorizhiController.java 8KB
MendianyuangongController.java 7KB
MendianxinxiController.java 7KB
DingdanxinxiController.java 7KB
BumenfenleiController.java 6KB
GongzuorizhiEntity.java 6KB
MPUtil.java 5KB
UserController.java 5KB
DingdanxinxiEntity.java 5KB
MavenWrapperDownloader.java 5KB
GongzuorizhiModel.java 5KB
GongzuorizhiVO.java 5KB
MendianyuangongEntity.java 5KB
MendianxinxiEntity.java 4KB
YuangongEntity.java 4KB
GukeEntity.java 4KB
DianzhuEntity.java 4KB
DingdanxinxiModel.java 4KB
DingdanxinxiVO.java 4KB
BaiduUtil.java 4KB
FileController.java 4KB
MendianyuangongModel.java 3KB
AuthorizationInterceptor.java 3KB
MendianyuangongVO.java 3KB
MendianxinxiModel.java 3KB
MendianxinxiVO.java 3KB
ConfigController.java 3KB
YuangongModel.java 3KB
YuangongVO.java 3KB
GukeModel.java 3KB
GukeVO.java 3KB
DianzhuModel.java 3KB
Query.java 3KB
DianzhuVO.java 3KB
TokenServiceImpl.java 2KB
TokenEntity.java 2KB
MendianyuangongServiceImpl.java 2KB
BumenfenleiEntity.java 2KB
MendianxinxiServiceImpl.java 2KB
DingdanxinxiServiceImpl.java 2KB
GongzuorizhiServiceImpl.java 2KB
PageUtils.java 2KB
BumenfenleiServiceImpl.java 2KB
YuangongServiceImpl.java 2KB
DianzhuServiceImpl.java 2KB
GukeServiceImpl.java 2KB
InterceptorConfig.java 1KB
UserServiceImpl.java 1KB
CommonServiceImpl.java 1KB
UserEntity.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
MendianyuangongService.java 1KB
SQLFilter.java 1KB
MendianyuangongDao.java 1KB
DingdanxinxiService.java 1KB
MendianxinxiService.java 1KB
GongzuorizhiService.java 1KB
BumenfenleiService.java 1KB
HttpClientUtils.java 1013B
MendianxinxiDao.java 1004B
GongzuorizhiDao.java 1004B
DingdanxinxiDao.java 1004B
BumenfenleiDao.java 989B
YuangongService.java 978B
MendianyuangongView.java 973B
DianzhuService.java 964B
DingdanxinxiView.java 946B
MendianxinxiView.java 946B
GongzuorizhiView.java 946B
YuangongDao.java 938B
BumenfenleiView.java 937B
DianzhuDao.java 923B
GukeService.java 922B
YuangongView.java 904B
ConfigServiceImpl.java 895B
DianzhuView.java 895B
R.java 884B
共 421 条
- 1
- 2
- 3
- 4
- 5
资源评论
创作小达人
- 粉丝: 2105
- 资源: 509
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 现场评定检查表——建筑外墙、屋面保温和建筑外墙装饰.docx
- 现场评定检查表--气体灭火系统.docx
- 消防第三方技术服务模拟验收抽查记录表.doc
- 现场评定检查表——总平面布局.docx
- 消防验收过程服务--现场记录表.doc
- 消防第三方技术服务现场交底监督记录表.doc
- 向日葵被控端绿色精简运行版
- 学生心理档案表.docx
- 验收确认单表格.docx
- 阳宅净宅表文.docx
- 医疗废弃物建设项目环境风险简单分析表.docx
- 原材料检测报告.docx
- 造林补助实施方案小班一览表、造林补助(新增部分)分行政村(国有林场)任务落实情况表.xls
- 造林补助(新增部分)分行政村(国有林场)任务落实情况表.docx
- 肢体残疾标准.docx
- 职工工伤与职业病致残等级分级表十级.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功