当前位置: 首页 > news >正文

springboot/ssm高校超市管理系统Java商品出入库供应商管理系统web源码wms

springboot/ssm高校超市管理系统Java商品出入库供应商管理系统web源码wms

基于springboot(可改ssm)+vue项目

开发语言:Java

框架:springboot/可改ssm + vue

JDK版本:JDK1.8(或11)

服务器:tomcat

数据库:mysql 5.7(或8.0)

数据库工具:Navicat/sqlyog

开发软件:eclipse/idea

依赖管理包:Maven

代码+数据库保证完整可用,可提供远程调试并指导运行服务~

可提供付费讲解以及修改服务,比如题目、界面、功能、框架等等...

千套代码,欢迎带题目咨询哦~~

package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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 org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {return R.error("用户名已存在。");}userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

http://www.lryc.cn/news/493490.html

相关文章:

  • 小程序-基于java+SpringBoot+Vue的微信小程序养老院系统设计与实现
  • 宠物电商对接美团闪购:实现快速配送与用户增值
  • Vue中使用<Transition>与<TransitionGroup>
  • Algorithms and Data Structures in C++ by Mohammed Yasir Eramangadan
  • 2024广东省职业技能大赛云计算——构建CICD 部署2048小游戏
  • React 条件渲染
  • Hadoop生态圈框架部署(九)- Hive部署
  • c语言的qsort函数理解与使用
  • Java 语言的起源发展与基本概念(JDK,JRE,JVM)
  • 03_变量
  • [论文阅读-综述]Supervised Speech Separation Based on Deep Learning: An Overview
  • 群控系统服务端开发模式-应用开发-邮箱配置功能开发
  • 【机器学习】——卷积与循环的交响曲:神经网络模型在现代科技中的协奏
  • android studio引用so库
  • 2024年信号处理与神经网络应用(SPNNA 2024)
  • wxWidgets-ImageView
  • 第1章-JVM和Java体系架构
  • windows 服务器角色
  • [OpenHarmony5.0][Docker][环境]OpenHarmony5.0 Docker编译环境镜像下载以及使用方式
  • C#中判断两个 List<T> 的内容是否相等
  • Linux环境下配置neo4j图数据库
  • Windows 11 搭建 Docker 桌面版详细教程
  • Pytest-Bdd-Playwright 系列教程(13):钩子(hooks)
  • dns 服务器简单介绍
  • Neo4j图形数据库-Cypher中常用指令
  • linux安全管理-防火墙配置
  • 什么是BIOS
  • c++视频图像处理
  • 音视频入门基础:MPEG2-TS专题(8)——TS Header中的适配域
  • 基于stm32单片机的教室节能系统设计