Java毕设项目——网上宠物店管理系统(java+SSM+Maven+Mysql+Jsp)
文末獲取源碼?
開發語言:Java
框架:SSM
技術:Jsp
JDK版本:JDK1.8
服務器:tomcat7
數據庫:mysql 5.7/8.0
數據庫工具:Navicat11
開發軟件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
瀏覽器:谷歌瀏覽器
一、前言介紹??
隨著我國經濟的快速發展,人民生活水平的不斷提高,寵物逐漸成為許多寵物愛好者的一種生活方式。
寵物的品種也越來越多樣化,寵物不僅能給生活帶來樂趣還可以成為空巢老人,獨生子女很好的精神陪伴,養寵物是許多小伙伴的選擇,寵物通常是寵物店購買的,帶給它們一個溫暖的家。
本論文系統地描繪了整個網上寵物店管理系統的設計與實現,主要實現的功能有以下幾點:(1)管理員;個人中心、用戶管理、培養師管理、寵物種類管理、寵物信息管理、食品類型管理、寵物糧食管理、用品類型管理、寵物用品管理、寵物疫苗管理、寵物疫苗預約管理、寵物美容管理、美容預約管理、寵物培養管理、培養訂單管理、系統管理、訂單管理。(2)前臺首頁;首頁、寵物信息、寵物糧食、寵物用品、寵物疫苗、寵物美容、寵物培養、個人中心、后臺管理、購物車。其具有簡單的接口,方便的應用,強大的互動,完全基于互聯網的特點。
現代社會的網絡和信息技術不斷提高,人們的生活水平達到另一個新的發展。但是由于工作和生活越來越忙,再讓用戶去寵物管理中心,顯然是不太合理的。一個充分利用碎片化時間,簡化去實體店過程的程序,正是我們所需要的。這篇文章研究了基于SSM框架的網上寵物店系統的開發和實現,從需求分析、總體設計到具體實現,最終完成了整個在線寵物管理系統,從而方便了用戶和提高了管理員的管理水平。
二、系統需求分析
寵物管理系統需要滿足的需求有以下幾個:
1.信息獲取方便,用戶可在網頁上快速瀏覽到新的信息。
2.寵物領養管理,符合用戶需要的寵物可以在線支付。
3.查看寵物詳情,單獨查看某一個寵物的詳細信息,獲取好評等。
4.修改用戶信息,可以修改用戶密碼或者用戶名等一些個性化操作。
5.管理員功能,管理員可以對用戶信息進行管理。
6.系統安全,操作簡便,不過于復雜。
7.系統可以穩定運行,不存在卡頓等問題造成用戶反感。
三、系統展示
?
寵物信息
寵物疫苗?寵物美容?
管理員功能模塊
?
寵物信息管理
寵物疫苗預約管理
四、部分核心代碼?
?寵物信息
/*** 寵物信息* 后端接口* @author * @email * @date 2022-05-07 12:53:35*/ @RestController @RequestMapping("/chongwuxinxi") public class ChongwuxinxiController {@Autowiredprivate ChongwuxinxiService chongwuxinxiService;@Autowiredprivate StoreupService storeupService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( ChongwuxinxiEntity chongwuxinxi){EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi")); return R.ok().put("data", chongwuxinxiService.selectListView(ew));}/*** 查詢*/@RequestMapping("/query")public R query(ChongwuxinxiEntity chongwuxinxi){EntityWrapper< ChongwuxinxiEntity> ew = new EntityWrapper< ChongwuxinxiEntity>();ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi")); ChongwuxinxiView chongwuxinxiView = chongwuxinxiService.selectView(ew);return R.ok("查詢寵物信息成功").put("data", chongwuxinxiView);}/*** 后端詳情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);chongwuxinxi.setClicktime(new Date());chongwuxinxiService.updateById(chongwuxinxi);return R.ok().put("data", chongwuxinxi);}/*** 前端詳情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);chongwuxinxi.setClicktime(new Date());chongwuxinxiService.updateById(chongwuxinxi);return R.ok().put("data", chongwuxinxi);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(chongwuxinxi);chongwuxinxiService.insert(chongwuxinxi);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(chongwuxinxi);chongwuxinxiService.insert(chongwuxinxi);return R.ok();}/*** 修改*/@RequestMapping("/update")@Transactionalpublic R update(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){//ValidatorUtils.validateEntity(chongwuxinxi);chongwuxinxiService.updateById(chongwuxinxi);//全部更新return R.ok();}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){chongwuxinxiService.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<ChongwuxinxiEntity> wrapper = new EntityWrapper<ChongwuxinxiEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = chongwuxinxiService.selectCount(wrapper);return R.ok().put("count", count);}/*** 前端智能排序*/@IgnoreAuth@RequestMapping("/autoSort")public R autoSort(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request,String pre){EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();Map<String, Object> newMap = new HashMap<String, Object>();Map<String, Object> param = new HashMap<String, Object>();Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();while (it.hasNext()) {Map.Entry<String, Object> entry = it.next();String key = entry.getKey();String newKey = entry.getKey();if (pre.endsWith(".")) {newMap.put(pre + newKey, entry.getValue());} else if (StringUtils.isEmpty(pre)) {newMap.put(newKey, entry.getValue());} else {newMap.put(pre + "." + newKey, entry.getValue());}}params.put("sort", "clicktime");params.put("order", "desc");PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));return R.ok().put("data", page);}}用戶登錄
@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", username));if(user==null || !user.getMima().equals(password)) {return R.error("賬號或密碼不正確");}String token = tokenService.generateToken(user.getId(), username,"yonghu", "用戶" );return R.ok().put("token", token);}?用戶注冊
@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody YonghuEntity yonghu){//ValidatorUtils.validateEntity(yonghu);YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", yonghu.getZhanghao()));if(user!=null) {return R.error("注冊用戶已存在");}Long uId = new Date().getTime();yonghu.setId(uId);yonghuService.insert(yonghu);return R.ok();}上傳文件?
/*** 上傳文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {if (file.isEmpty()) {throw new EIException("上傳文件不能為空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);String fileName = new Date().getTime()+"."+fileExt;File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);file.transferTo(dest);/*** 如果使用idea或者eclipse重啟項目,發現之前上傳的圖片或者文件丟失,將下面一行代碼注釋打開* 請將以下的"D:\\ssmpiv99\\src\\main\\webapp\\upload"替換成你本地項目的upload路徑,* 并且項目路徑不能存在中文、空格等特殊字符*///FileUtils.copyFile(dest, new File("D:\\ssmpiv99\\src\\main\\webapp\\upload"+"/"+fileName)); /**修改了路徑以后請將該行最前面的//注釋去掉**/if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}?
總結
以上是生活随笔為你收集整理的Java毕设项目——网上宠物店管理系统(java+SSM+Maven+Mysql+Jsp)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LabVIEW Arduino RS-4
- 下一篇: 抽象代数学习笔记二《群:群的例子》