商务服务
【java毕业设计】高校物资采购管理系统源码(ssm+mysql+说明文档+LW).zip
2024-11-26 09:31
package com.controller;

【java毕业设计】高校物资采购管理系统源码(ssm+mysql+说明文档+LW).zip

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.GongyingshangEntity; import com.entity.view.GongyingshangView; import com.service.GongyingshangService; 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; @RestController @RequestMapping("/gongyingshang") public class GongyingshangController { @Autowired private GongyingshangService gongyingshangService; @Autowired private TokenService tokenService; @IgnoreAuth @RequestMapping(value = "/login") public R login(String username, String password, String captcha, HttpServletRequest request) { GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingbianhao", username)); if(user==null || !user.getMima().equals(password)) { return R.error("账号或密码不正确"); } String token = tokenService.generateToken(user.getId(), username,"gongyingshang", "供应商" ); return R.ok().put("token", token); } @IgnoreAuth @RequestMapping("/register") public R register(@RequestBody GongyingshangEntity gongyingshang){ //ValidatorUtils.validateEntity(gongyingshang); GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingbianhao", gongyingshang.getGongyingbianhao())); if(user!=null) { return R.error("注册用户已存在"); } Long uId = new Date().getTime(); gongyingshang.setId(uId); gongyingshangService.insert(gongyingshang); return R.ok(); } @RequestMapping("/logout") public R logout(HttpServletRequest request) { request.getSession().invalidate(); return R.ok("退出成功"); } @RequestMapping("/session") public R getCurrUser(HttpServletRequest request){ Long id = (Long)request.getSession().getAttribute("userId"); GongyingshangEntity user = gongyingshangService.selectById(id); return R.ok().put("data", user); } @IgnoreAuth @RequestMapping(value = "/resetPass") public R resetPass(String username, HttpServletRequest request){ GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingbianhao", username)); if(user==null) { return R.error("账号不存在"); } user.setMima("123456"); gongyingshangService.updateById(user); return R.ok("密码已重置为:123456"); } @RequestMapping("/page") public R page(@RequestParam Map<String, Object> params,GongyingshangEntity gongyingshang, HttpServletRequest request){ EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>(); PageUtils page = gongyingshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongyingshang), params), params)); request.setAttribute("data", page); return R.ok().put("data", page); } @IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params,GongyingshangEntity gongyingshang, HttpServletRequest request){ EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>(); PageUtils page = gongyingshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongyingshang), params), params)); request.setAttribute("data", page); return R.ok().put("data", page); } @RequestMapping("/lists") public R list( GongyingshangEntity gongyingshang){ EntityWrapper<GongyingshangEntity> ew = new EntityWrapper<GongyingshangEntity>(); ew.allEq(MPUtil.allEQMapPre( gongyingshang, "gongyingshang")); return R.ok().put("data", gongyingshangService.selectListView(ew)); } @RequestMapping("/query") public R query(GongyingshangEntity gongyingshang){ EntityWrapper< GongyingshangEntity> ew = new EntityWrapper< GongyingshangEntity>(); ew.allEq(MPUtil.allEQMapPre( gongyingshang, "gongyingshang")); GongyingshangView gongyingshangView = gongyingshangService.selectView(ew); return R.ok("查询供应商成功").put("data", gongyingshangView); } @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ GongyingshangEntity gongyingshang = gongyingshangService.selectById(id); return R.ok().put("data", gongyingshang); } @IgnoreAuth @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ GongyingshangEntity gongyingshang = gongyingshangService.selectById(id); return R.ok().put("data", gongyingshang); } @RequestMapping("/save") public R save(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){ gongyingshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(gongyingshang); GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingbianhao", gongyingshang.getGongyingbianhao())); if(user!=null) { return R.error("用户已存在"); } gongyingshang.setId(new Date().getTime()); gongyingshangService.insert(gongyingshang); return R.ok(); } @RequestMapping("/add") public R add(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){ gongyingshang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(gongyingshang); GongyingshangEntity user = gongyingshangService.selectOne(new EntityWrapper<GongyingshangEntity>().eq("gongyingbianhao", gongyingshang.getGongyingbianhao())); if(user!=null) { return R.error("用户已存在"); } gongyingshang.setId(new Date().getTime()); gongyingshangService.insert(gongyingshang); return R.ok(); } @RequestMapping("/update") public R update(@RequestBody GongyingshangEntity gongyingshang, HttpServletRequest request){ //ValidatorUtils.validateEntity(gongyingshang); gongyingshangService.updateById(gongyingshang);//全部更新 return R.ok(); }
    以上就是本篇文章【【java毕业设计】高校物资采购管理系统源码(ssm+mysql+说明文档+LW).zip】的全部内容了,欢迎阅览 ! 文章地址:http://www78564.xrbh.cn/news/28023.html 
     文章      相关文章      动态      同类文章      热门文章      栏目首页      网站地图      返回首页 迅博思语移动站 http://www78564.xrbh.cn/mobile/ , 查看更多   
最新文章
哈尔滨威尔特制衣厂
我是哈尔滨威尔特制衣厂的肖庭波,联系地址是哈尔滨服装城附近哈西商厦,我们公司是在黑龙江哈尔滨的个体私营公司,公司专注于服装
节到张家界武陵源必去地
节到张家界武陵源必去地长假想找个地方玩玩?张家界武陵源绝对是个好选取,这里风景绝美空气清新关键是人虽然多,但美景还是能让
超节点成WAIC焦点 未来国产GPU替代率或超80%
在人工智能产业蓬勃发展的当下,算力作为其核心驱动力,重要性不言而喻。然而,国产算力在前进的道路上却面临着诸多阻碍,发展现
原创樊振东上新闻联播了!加盟德甲真相曝光,背后战略价值惊人
央视《新闻联播》在体育强国专题报道中播放了网球选手郑钦文和乒乓球运动员樊振东的画面。 整个乒乓球项目只出现了樊振东一人,
山姆上新「周黑鸭风味鸭肉酱」,瑞幸推出乳酸菌美式和乳酸菌冰茶...|一周热闻
新产品1、20年来最大创新!百事在北美推出益生元可乐2、特别添加专利乳酸菌!瑞幸上新「乳酸菌美式」和「乳酸菌冰茶」3、美容成
多款新车与全域AI技术惊艳WAIC,吉利智能科技进入爆发期
原创|Jaden  编辑|Cong在正在举办的2025世界人工智能大会(WAIC 2025)上,集团携阶跃星辰联合参展,9X、10EM-P、A7和吉利银
云南施甸县:“善洲青苗课堂”守护青少年健康成长
中国青年报客户端讯(中青报·中青网记者 张文凌)今年暑假,共青团云南保山市施甸县委依托“返家乡”“三下乡”社会实践大学生
一年60万赴美留学值吗?这届留学生开始找“平替”
21世纪经济报道记者陈洁 实习生张星雨 广州、重庆报道从7月中旬开始,多省份陆续公布本科普通批,高校录取工作逐步推进。然而,
惠民贷延期还款会影响分期吗?2025最新解析指南,必看避坑省钱秘籍!
惠民贷延期还款会影响分期吗?2025最新解析指南,必看避坑省钱秘籍!惠民贷推迟还款是许多人应急时的救命稻草,但推迟会不会作用
舟山进口茶叶中文标签备案
,公司自有进出口权,酒类商品批发许可证、食品流通许可证、中国食品土畜牧进出口商会会员证、对外贸易经营者备案登记证、自理报