——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven仓库管理系统(java+ssm+jsp+js+jquery+layui+mysql)
1 2 3 4 5 6 7 8 9 10 管理员 admin 123456 员工 员工工号1 123456 员工工号2 123456 员工工号3 123456 员工工号4 123456 员工工号5 123456 员工工号6 123456
项目介绍
基于SSM的仓库管理系统设计与实现
角色:管理员、员工
管理员:管理员登录系统后,可以对个人中心、员工管理、厂商信息管理、司机信息管理、门店信息管理、仓库信息管理、货物信息管理、货物入库管理、货物出库管理等功能
员工:员工登录到仓库管理系统后,可以对个人中心、厂商信息管理、司机信息管理、门店信息管理、仓库信息管理、货物信息管理、货物入库管理、货物出库管理等功能
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目; 6.数据库:MySql 5.7/8.0等版本均可;
技术栈
后端:SSM(Spring+SpringMVC+Mybatis) 前端:JSP+CSS+JS+JQUERY+Layui
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目; 3. 将项目中db.xml配置文件中的数据库配置改为自己的配置,然后运行;
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 @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); } @IgnoreAuth @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()); YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("yuangonggonghao" , yuangong.getYuangonggonghao())); if (user!=null ) { return R.error("用户已存在" ); } yuangong.setId(new Date().getTime()); yuangongService.insert(yuangong); return R.ok(); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 */ @RequestMapping("users") @RestController public class UserController { @Autowired private UserService userService; @Autowired private 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) { 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")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 String tableName = request.getSession().getAttribute("tableName" ).toString(); if (tableName.equals("yuangong" )) { ew.eq("yuangonggonghao" , (String)request.getSession().getAttribute("username" )); } List<Map<String, Object>> result = huowuchukuService.selectTimeStatValue(params, ew); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd" ); for (Map<String, Object> m : result) { for (String k : m.keySet()) { if (m.get(k) instanceof Date) { m.put(k, sdf.format((Date)m.get(k))); } } } return R.ok().put("data" , result); } @RequestMapping("/group/{columnName}") public R group (@PathVariable("columnName") String columnName,HttpServletRequest request) { Map<String, Object> params = new HashMap<String, Object>(); params.put("column" , columnName); EntityWrapper<HuowuchukuEntity> ew = new EntityWrapper<HuowuchukuEntity>(); String tableName = request.getSession().getAttribute("tableName" ).toString(); if (tableName.equals("yuangong" )) { ew.eq("yuangonggonghao" , (String)request.getSession().getAttribute("username" )); } List<Map<String, Object>> result = huowuchukuService.selectGroup(params, ew); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd" ); for (Map<String, Object> m : result) { for (String k : m.keySet()) { if (m.get(k) instanceof Date) { m.put(k, sdf.format((Date)m.get(k))); } } } return R.ok().put("data" , result); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 public R list ( CangkuxinxiEntity cangkuxinxi) { EntityWrapper<CangkuxinxiEntity> ew = new EntityWrapper<CangkuxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( cangkuxinxi, "cangkuxinxi" )); return R.ok().put("data" , cangkuxinxiService.selectListView(ew)); } @RequestMapping("/query") public R query (CangkuxinxiEntity cangkuxinxi) { EntityWrapper< CangkuxinxiEntity> ew = new EntityWrapper< CangkuxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( cangkuxinxi, "cangkuxinxi" )); CangkuxinxiView cangkuxinxiView = cangkuxinxiService.selectView(ew); return R.ok("查询仓库信息成功" ).put("data" , cangkuxinxiView); } @RequestMapping("/info/{id}") public R info (@PathVariable("id") Long id) { CangkuxinxiEntity cangkuxinxi = cangkuxinxiService.selectById(id); return R.ok().put("data" , cangkuxinxi); } @IgnoreAuth @RequestMapping("/detail/{id}") public R detail (@PathVariable("id") Long id) { CangkuxinxiEntity cangkuxinxi = cangkuxinxiService.selectById(id); return R.ok().put("data" , cangkuxinxi); } @RequestMapping("/save") public R save (@RequestBody CangkuxinxiEntity cangkuxinxi, HttpServletRequest request) { cangkuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000 )).longValue());
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 @RequestMapping("/delete") public R delete (@RequestBody Long[] ids) { huowuxinxiService.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 remindEndDate = null ; if (map.get("remindstart" )!=null ) { Integer remindStart = Integer.parseInt(map.get("remindstart" ).toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart); remindStartDate = c.getTime(); map.put("remindstart" , sdf.format(remindStartDate)); } if (map.get("remindend" )!=null ) { Integer remindEnd = Integer.parseInt(map.get("remindend" ).toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindEnd); remindEndDate = c.getTime(); map.put("remindend" , sdf.format(remindEndDate)); } } Wrapper<HuowuxinxiEntity> wrapper = new EntityWrapper<HuowuxinxiEntity>(); if (map.get("remindstart" )!=null ) { wrapper.ge(columnName, map.get("remindstart" )); } if (map.get("remindend" )!=null ) { wrapper.le(columnName, map.get("remindend" )); }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=560023051907201ai https://javayms.pages.dev?id=560023051907201ai