基于SSM的宠物领养收养救助系统的设计与实现
精彩专栏推荐订阅:在 下方专栏
作者主页:计算机毕设木哥
文章目录 一、项目介绍1.1背景及意义:1.2功能介绍: 二、开发环境三、项目展示四、代码展示五、论文参考一、项目介绍
1.1背景及意义:
随着互联网的普及和计算机技术的发展,人们的生活方式发生了巨大变化。其中一个明显的趋势是线上领养宠物的兴起。许多动物救助组织通过网络平台发布待领养的宠物信息,而许多有意领养的人也通过这些平台寻找合适的宠物。然而,当前市场上的宠物领养系统存在一些问题,如信息不透明、搜索功能不完善、用户交互体验差等。这使得寻找合适的宠物变得困难,也影响了动物救助组织的工作效率。因此,我们团队决定开发一款全新的宠物领养系统,以解决这些问题。
当前市场上的宠物领养系统存在一些问题,如信息不透明、搜索功能不完善、用户交互体验差等,这些问题不仅影响了有意领养宠物的人的体验,也影响了动物救助组织的工作效率。因此,开发一款全新的宠物领养系统,可以帮助有意领养宠物的人更方便快捷地找到合适的宠物,同时也可以帮助动物救助组织更高效地进行领养匹配和管理工作。
1.2功能介绍:
本项目旨在开发一款全新的宠物领养系统,以解决当前市场上存在的一些问题。该系统将具备完善的功能,包括用户管理、新闻管理、地区管理、犬种管理、犬龄管理、领养信息管理、领养管理、宠物动态管理、宠物评论管理、私聊管理、宠物信息管理、管理员帐号管理和系统管理等功能。这些功能将使得有意领养宠物的人可以更方便快捷地找到合适的宠物,同时也可以帮助动物救助组织更高效地进行领养匹配和管理工作。
该项目的目标是为有意领养宠物的人和动物救助组织提供一个更加便捷、高效的平台,同时提高动物救助组织的领养成功率。未来,我们将继续优化系统的性能和功能,增加更多的人性化设计,为更多的宠物爱好者提供更好的服务。
二、开发环境
开发语言:Java数据库:MySQL系统架构:B/S后端:SSM前端:HTML工具:IDEA或者Eclipse,JDK1.8,Maven三、项目展示
注册登录页面:
首页模块:
管理员模块:
四、代码展示
package com.controller; import java.io.File; import java.math.BigDecimal; import java.net.URL; import java.text.SimpleDateFormat; import com.alibaba.fastjson.JSONObject; import java.util.*; import org.springframework.beans.BeanUtils; import javax.servlet.http.HttpServletRequest; import org.springframework.web.context.ContextLoader; import javax.servlet.ServletContext; import com.service.TokenService; import com.utils.*; import java.lang.reflect.InvocationTargetException; import com.service.DictionaryService; import org.apache.commons.lang3.StringUtils; import com.annotation.IgnoreAuth; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.entity.*; import com.entity.view.*; import com.service.*; import com.utils.PageUtils; import com.utils.R; import com.alibaba.fastjson.*; /** * 宠物领养审核 * 后端接口 * @author * @email */ @RestController @Controller @RequestMapping("/chongwulingyangshenhe") public class ChongwulingyangshenheController { private static final Logger logger = LoggerFactory.getLogger(ChongwulingyangshenheController.class); @Autowired private ChongwulingyangshenheService chongwulingyangshenheService; @Autowired private TokenService tokenService; @Autowired private DictionaryService dictionaryService; //级联表service @Autowired private ChongwulingyangService chongwulingyangService; @Autowired private YonghuService yonghuService; /** * 后端列表 */ @RequestMapping("/page") public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){ logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params)); String role = String.valueOf(request.getSession().getAttribute("role")); if(StringUtil.isEmpty(role)) return R.error(511,"权限为空"); else if("用户".equals(role)) params.put("yonghuId",request.getSession().getAttribute("userId")); if(params.get("orderBy")==null || params.get("orderBy")==""){ params.put("orderBy","id"); } PageUtils page = chongwulingyangshenheService.queryPage(params); //字典表数据转换 List<ChongwulingyangshenheView> list =(List<ChongwulingyangshenheView>)page.getList(); for(ChongwulingyangshenheView c:list){ //修改对应字典表字段 dictionaryService.dictionaryConvert(c, request); } return R.ok().put("data", page); } /** * 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id); ChongwulingyangshenheEntity chongwulingyangshenhe = chongwulingyangshenheService.selectById(id); if(chongwulingyangshenhe !=null){ //entity转view ChongwulingyangshenheView view = new ChongwulingyangshenheView(); BeanUtils.copyProperties( chongwulingyangshenhe , view );//把实体数据重构到view中 //级联表 ChongwulingyangEntity chongwulingyang = chongwulingyangService.selectById(chongwulingyangshenhe.getChongwulingyangId()); if(chongwulingyang != null){ BeanUtils.copyProperties( chongwulingyang , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段 view.setChongwulingyangId(chongwulingyang.getId()); } //级联表 YonghuEntity yonghu = yonghuService.selectById(chongwulingyangshenhe.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段 view.setYonghuId(yonghu.getId()); } //修改对应字典表字段 dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view); }else { return R.error(511,"查不到数据"); } } /** * 后端保存 */ @RequestMapping("/save") public R save(@RequestBody ChongwulingyangshenheEntity chongwulingyangshenhe, HttpServletRequest request){ logger.debug("save方法:,,Controller:{},,chongwulingyangshenhe:{}",this.getClass().getName(),chongwulingyangshenhe.toString()); String role = String.valueOf(request.getSession().getAttribute("role")); if(StringUtil.isEmpty(role)) return R.error(511,"权限为空"); else if("用户".equals(role)) chongwulingyangshenhe.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")))); Wrapper<ChongwulingyangshenheEntity> queryWrapper = new EntityWrapper<ChongwulingyangshenheEntity>() .eq("chongwulingyang_id", chongwulingyangshenhe.getChongwulingyangId()) .eq("yonghu_id", chongwulingyangshenhe.getYonghuId()) .eq("chongwurenlingshenhe_text", chongwulingyangshenhe.getChongwurenlingshenheText()) .eq("chongwulingyangshenhe_yesno_types", chongwulingyangshenhe.getChongwulingyangshenheYesnoTypes()) ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); ChongwulingyangshenheEntity chongwulingyangshenheEntity = chongwulingyangshenheService.selectOne(queryWrapper); if(chongwulingyangshenheEntity==null){ chongwulingyangshenhe.setChongwulingyangshenheYesnoTypes(1); chongwulingyangshenhe.setCreateTime(new Date()); chongwulingyangshenheService.insert(chongwulingyangshenhe); return R.ok(); }else { return R.error(511,"表中有相同数据"); } } /** * 后端修改 */ @RequestMapping("/update") public R update(@RequestBody ChongwulingyangshenheEntity chongwulingyangshenhe, HttpServletRequest request){ logger.debug("update方法:,,Controller:{},,chongwulingyangshenhe:{}",this.getClass().getName(),chongwulingyangshenhe.toString()); //根据字段查询是否有相同数据 Wrapper<ChongwulingyangshenheEntity> queryWrapper = new EntityWrapper<ChongwulingyangshenheEntity>() .notIn("id",chongwulingyangshenhe.getId()) .andNew() .eq("chongwulingyang_id", chongwulingyangshenhe.getChongwulingyangId()) .eq("yonghu_id", chongwulingyangshenhe.getYonghuId()) .eq("chongwurenlingshenhe_text", chongwulingyangshenhe.getChongwurenlingshenheText()) .eq("chongwulingyangshenhe_yesno_types", chongwulingyangshenhe.getChongwulingyangshenheYesnoTypes()) ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); ChongwulingyangshenheEntity chongwulingyangshenheEntity = chongwulingyangshenheService.selectOne(queryWrapper); if(chongwulingyangshenheEntity==null){ // String role = String.valueOf(request.getSession().getAttribute("role")); // if("".equals(role)){ // chongwulingyangshenhe.set // } if(chongwulingyangshenhe.getChongwulingyangshenheYesnoTypes() == 2){ ChongwulingyangEntity chongwulingyangEntity = new ChongwulingyangEntity(); chongwulingyangEntity.setId(chongwulingyangshenhe.getChongwulingyangId()); chongwulingyangEntity.setJieshuTypes(1); chongwulingyangService.updateById(chongwulingyangEntity); } chongwulingyangshenheService.updateById(chongwulingyangshenhe);//根据id更新 return R.ok(); }else { return R.error(511,"表中有相同数据"); } } /** * 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Integer[] ids){ logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString()); chongwulingyangshenheService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } /** * 批量上传 */ @RequestMapping("/batchInsert") public R save( String fileName){ logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName); try { List<ChongwulingyangshenheEntity> chongwulingyangshenheList = new ArrayList<>();//上传的东西 Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段 Date date = new Date(); int lastIndexOf = fileName.lastIndexOf("."); if(lastIndexOf == -1){ return R.error(511,"该文件没有后缀"); }else{ String suffix = fileName.substring(lastIndexOf); if(!".xls".equals(suffix)){ return R.error(511,"只支持后缀为xls的excel文件"); }else{ URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径 File file = new File(resource.getFile()); if(!file.exists()){ return R.error(511,"找不到上传文件,请联系管理员"); }else{ List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件 dataList.remove(0);//删除第一行,因为第一行是提示 for(List<String> data:dataList){ //循环 ChongwulingyangshenheEntity chongwulingyangshenheEntity = new ChongwulingyangshenheEntity(); // chongwulingyangshenheEntity.setChongwulingyangId(Integer.valueOf(data.get(0))); //宠物领养 要改的 // chongwulingyangshenheEntity.setYonghuId(Integer.valueOf(data.get(0))); //领养用户 要改的 // chongwulingyangshenheEntity.setChongwurenlingshenheText(data.get(0)); //认领理由 要改的 // chongwulingyangshenheEntity.setChongwulingyangshenheYesnoTypes(Integer.valueOf(data.get(0))); //申请状态 要改的 // chongwulingyangshenheEntity.setCreateTime(date);//时间 chongwulingyangshenheList.add(chongwulingyangshenheEntity); //把要查询是否重复的字段放入map中 } //查询是否重复 chongwulingyangshenheService.insertBatch(chongwulingyangshenheList); return R.ok(); } } } }catch (Exception e){ return R.error(511,"批量插入数据异常,请联系管理员"); } } /** * 前端列表 */ @IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){ logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params)); // 没有指定排序字段就默认id倒序 if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){ params.put("orderBy","id"); } PageUtils page = chongwulingyangshenheService.queryPage(params); //字典表数据转换 List<ChongwulingyangshenheView> list =(List<ChongwulingyangshenheView>)page.getList(); for(ChongwulingyangshenheView c:list) dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段 return R.ok().put("data", page); } /** * 前端详情 */ @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id, HttpServletRequest request){ logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id); ChongwulingyangshenheEntity chongwulingyangshenhe = chongwulingyangshenheService.selectById(id); if(chongwulingyangshenhe !=null){ //entity转view ChongwulingyangshenheView view = new ChongwulingyangshenheView(); BeanUtils.copyProperties( chongwulingyangshenhe , view );//把实体数据重构到view中 //级联表 ChongwulingyangEntity chongwulingyang = chongwulingyangService.selectById(chongwulingyangshenhe.getChongwulingyangId()); if(chongwulingyang != null){ BeanUtils.copyProperties( chongwulingyang , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段 view.setChongwulingyangId(chongwulingyang.getId()); } //级联表 YonghuEntity yonghu = yonghuService.selectById(chongwulingyangshenhe.getYonghuId()); if(yonghu != null){ BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段 view.setYonghuId(yonghu.getId()); } //修改对应字典表字段 dictionaryService.dictionaryConvert(view, request); return R.ok().put("data", view); }else { return R.error(511,"查不到数据"); } } /** * 前端保存 */ @RequestMapping("/add") public R add(@RequestBody ChongwulingyangshenheEntity chongwulingyangshenhe, HttpServletRequest request){ logger.debug("add方法:,,Controller:{},,chongwulingyangshenhe:{}",this.getClass().getName(),chongwulingyangshenhe.toString()); Wrapper<ChongwulingyangshenheEntity> queryWrapper = new EntityWrapper<ChongwulingyangshenheEntity>() .eq("chongwulingyang_id", chongwulingyangshenhe.getChongwulingyangId()) .eq("yonghu_id", chongwulingyangshenhe.getYonghuId()) .eq("chongwurenlingshenhe_text", chongwulingyangshenhe.getChongwurenlingshenheText()) .eq("chongwulingyangshenhe_yesno_types", chongwulingyangshenhe.getChongwulingyangshenheYesnoTypes()) ; logger.info("sql语句:"+queryWrapper.getSqlSegment()); ChongwulingyangshenheEntity chongwulingyangshenheEntity = chongwulingyangshenheService.selectOne(queryWrapper); if(chongwulingyangshenheEntity==null){ chongwulingyangshenhe.setChongwulingyangshenheYesnoTypes(1); chongwulingyangshenhe.setCreateTime(new Date()); // String role = String.valueOf(request.getSession().getAttribute("role")); // if("".equals(role)){ // chongwulingyangshenhe.set // } chongwulingyangshenheService.insert(chongwulingyangshenhe); return R.ok(); }else { return R.error(511,"表中有相同数据"); } } } 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
五、论文参考
相关知识
基于SSM框架实现宠物领养系统的设计与实现
基于SSM的宠物店销售系统设计与实现
毕业设计:基于java的宠物领养系统设计与实现
基于SSM的有宠在线宠物商城系统设计与实现
基于Java+SpringBoot+Vue宠物领养救助平台设计和实现
基于SSH技术的宠物救助系统的设计与实现
基于SSM的宠物领养系统的设计与实现
基于ssm宠物寄养管理系统的设计与实现
基于SSM技术的宠物寄存系统设计与实现
基于SSM实现宠物领养网站平台管理系统
网址: 基于SSM的宠物领养收养救助系统的设计与实现 https://www.mcbbbk.com/newsview205207.html
上一篇: 上海宠物领养救助站救助的狗猫从何 |
下一篇: 基于springboot+boo |
推荐分享

- 1我的狗老公李淑敏33——如何 5096
- 2南京宠物粮食薄荷饼宠物食品包 4363
- 3家养水獭多少钱一只正常 3825
- 4豆柴犬为什么不建议养?可爱的 3668
- 5自制狗狗辅食:棉花面纱犬的美 3615
- 6狗交配为什么会锁住?从狗狗生 3601
- 7广州哪里卖宠物猫狗的选择性多 3535
- 8湖南隆飞尔动物药业有限公司宠 3477
- 9黄金蟒的价格 3396
- 10益和 MATCHWELL 狗 3352