🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
🍅 文末获取源码联系👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
目录
1.技术选型
2.数据库表结构
3.开发工具
4.功能
4.1【角色】
4.2【前台功能模块】
4.3【后台功能模块】
5.项目演示截图
5.1 首页
5.2 生活照料
5.3 个人中心
5.4 土地
5.5 医疗人员功能
5.6 医疗保健管理
5.7 健康档案
5.8 土地管理
6.数据库文件设计
7.核心代码
7.1 活动预约Controller
7.2 活动预约Service
7.3 活动预约ServiceImpl
7.4 活动预约DAO
8.参考文档
1.技术选型
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
2.数据库表结构
15张
3.开发工具
idea、navicat
4.功能
4.1【角色】
管理员、医疗人员、老人
4.2【前台功能模块】
- 登录注册
- 首页
- 文娱活动
- 生活照料
- 土地
- 个人中心(个人中心、生活照料订单、土地承包)
4.3【后台功能模块】
- 登录
- 首页
- 个人中心
- 管理员管理
- 老人管理
- 医疗人员管理
- 乡村志愿者管理
- 文娱活动管理
- 活动报名管理
- 医疗保健管理
- 健康档案管理
- 生活照料管理
- 土地管理
- 基础数据管理
- 轮播图管理
5.项目演示截图
5.1 首页
5.2 生活照料
5.3 个人中心
5.4 土地
5.5 医疗人员功能
5.6 医疗保健管理
5.7 健康档案
5.8 土地管理
6.数据库文件设计
CREATE TABLE `baojian` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',`yiliao_id` int(11) DEFAULT NULL COMMENT '医疗人员',`laoren_id` int(11) DEFAULT NULL COMMENT '老人',`baojian_name` varchar(200) DEFAULT NULL COMMENT '医疗保健名称 Search111 ',`baojian_uuid_number` varchar(200) DEFAULT NULL COMMENT '医疗保健编号',`baojian_photo` varchar(200) DEFAULT NULL COMMENT '医疗保健照片',`baojian_address` varchar(200) DEFAULT NULL COMMENT '医疗保健地点',`baojian_types` int(11) DEFAULT NULL COMMENT '医疗保健类型 Search111',`baojian_content` longtext COMMENT '注意事项 ',`baojian_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 ',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='医疗保健';CREATE TABLE `config` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`name` varchar(100) NOT NULL COMMENT '配置参数名称',`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';CREATE TABLE `dictionary` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',`code_index` int(11) DEFAULT NULL COMMENT '编码',`index_name` varchar(200) DEFAULT NULL COMMENT '编码名字 Search111 ',`super_id` int(11) DEFAULT NULL COMMENT '父字段id',`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='字典';CREATE TABLE `huodong` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',`huodong_name` varchar(200) DEFAULT NULL COMMENT '文娱活动名称 Search111 ',`huodong_uuid_number` varchar(200) DEFAULT NULL COMMENT '文娱活动编号',`huodong_photo` varchar(200) DEFAULT NULL COMMENT '文娱活动照片',`huodong_address` varchar(200) DEFAULT NULL COMMENT '文娱活动地点',`huodong_types` int(11) DEFAULT NULL COMMENT '文娱活动类型 Search111',`huodong_content` longtext COMMENT '文娱活动结束 ',`huodong_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='文娱活动';CREATE TABLE `jiankang` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',`yiliao_id` int(11) DEFAULT NULL COMMENT '医疗人员',`laoren_id` int(11) DEFAULT NULL COMMENT '老人',`jiankang_name` varchar(200) DEFAULT NULL COMMENT '健康档案名称 Search111 ',`jiankang_uuid_number` varchar(200) DEFAULT NULL COMMENT '健康档案编号',`jiankang_photo` varchar(200) DEFAULT NULL COMMENT '健康档案照片',`jiankang_address` varchar(200) DEFAULT NULL COMMENT '健康档案地点',`jiankang_types` int(11) DEFAULT NULL COMMENT '身体情况 Search111',`jiankang_content` longtext COMMENT '注意事项 ',`jiankang_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 ',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='健康档案';CREATE TABLE `laoren` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',`username` varchar(200) DEFAULT NULL COMMENT '账户 ',`password` varchar(200) DEFAULT NULL COMMENT '密码 ',`laoren_name` varchar(200) DEFAULT NULL COMMENT '老人名称 Search111 ',`laoren_phone` varchar(200) DEFAULT NULL COMMENT '联系方式',`laoren_email` varchar(200) DEFAULT NULL COMMENT '邮箱',`sex_types` int(11) DEFAULT NULL COMMENT '性别',`new_money` decimal(10,2) DEFAULT NULL COMMENT '余额',`laoren_content` longtext COMMENT '老人介绍 ',`laoren_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 ',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='老人';CREATE TABLE `shenghuo_order` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',`shenghuo_order_uuid_number` varchar(200) DEFAULT NULL COMMENT '订单编号 Search111 ',`shenghuo_id` int(11) DEFAULT NULL COMMENT '生活照料',`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',`shenghuo_order_types` int(11) DEFAULT NULL COMMENT '订单类型 Search111 ',`insert_time` timestamp NULL DEFAULT NULL COMMENT '订单创建时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='生活照料订单';CREATE TABLE `token` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`userid` bigint(20) NOT NULL COMMENT '儿童id',`username` varchar(100) NOT NULL COMMENT '儿童名',`tablename` varchar(100) DEFAULT NULL COMMENT '表名',`role` varchar(100) DEFAULT NULL COMMENT '角色',`token` varchar(200) NOT NULL COMMENT '密码',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',`expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='token表';CREATE TABLE `tudi` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',`laoren_id` int(11) DEFAULT NULL COMMENT '商家',`tudi_name` varchar(200) DEFAULT NULL COMMENT '土地名称 Search111 ',`tudi_uuid_number` varchar(200) DEFAULT NULL COMMENT '土地编号',`tudi_photo` varchar(200) DEFAULT NULL COMMENT '土地照片',`tudi_address` varchar(200) DEFAULT NULL COMMENT '土地地点',`tudi_types` int(11) DEFAULT NULL COMMENT '土地类型 Search111',`tudi_kucun_number` int(11) DEFAULT NULL COMMENT '多少亩',`tudi_new_money` decimal(10,2) DEFAULT NULL COMMENT '价格/年 ',`tudi_content` longtext COMMENT '土地介绍 ',`tudi_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='土地';CREATE TABLE `tudi_order` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',`tudi_order_uuid_number` varchar(200) DEFAULT NULL COMMENT '订单编号 Search111 ',`tudi_id` int(11) DEFAULT NULL COMMENT '土地',`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',`buy_number` int(11) DEFAULT NULL COMMENT '亩',`tudi_order_types` int(11) DEFAULT NULL COMMENT '订单类型 Search111 ',`insert_time` timestamp NULL DEFAULT NULL COMMENT '订单创建时间',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='土地承包';CREATE TABLE `users` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',`username` varchar(100) NOT NULL COMMENT '儿童名',`password` varchar(100) NOT NULL COMMENT '密码',`role` varchar(100) DEFAULT '管理员' COMMENT '角色',`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';CREATE TABLE `yonghu` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',`username` varchar(200) DEFAULT NULL COMMENT '账户',`password` varchar(200) DEFAULT NULL COMMENT '密码',`yonghu_name` varchar(200) DEFAULT NULL COMMENT '志愿者姓名 Search111 ',`yonghu_phone` varchar(200) DEFAULT NULL COMMENT '志愿者手机号',`yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '志愿者身份证号',`yonghu_photo` varchar(200) DEFAULT NULL COMMENT '志愿者头像',`new_money` decimal(10,2) DEFAULT NULL COMMENT '余额 ',`sex_types` int(11) DEFAULT NULL COMMENT '性别',`yonghu_email` varchar(200) DEFAULT NULL COMMENT '志愿者邮箱',`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='乡村志愿者';
7.核心代码
7.1 活动预约Controller
package com.controller;/*** 活动报名* 后端接口* @author 计算机编程-吉哥* @email
*/
@RestController
@Controller
@RequestMapping("/huodongYuyue")
public class HuodongYuyueController {private static final Logger logger = LoggerFactory.getLogger(HuodongYuyueController.class);private static final String TABLE_NAME = "huodongYuyue";@Autowiredprivate HuodongYuyueService huodongYuyueService;@Autowiredprivate TokenService tokenService;@Autowiredprivate BaojianService baojianService;//医疗保健@Autowiredprivate DictionaryService dictionaryService;//字典@Autowiredprivate HuodongService huodongService;//文娱活动@Autowiredprivate JiankangService jiankangService;//健康档案@Autowiredprivate LaorenService laorenService;//老人@Autowiredprivate ShenghuoService shenghuoService;//生活照料@Autowiredprivate ShenghuoOrderService shenghuoOrderService;//生活照料订单@Autowiredprivate TudiService tudiService;//土地@Autowiredprivate TudiOrderService tudiOrderService;//土地承包@Autowiredprivate YiliaoService yiliaoService;//医疗人员@Autowiredprivate YonghuService yonghuService;//乡村志愿者@Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/@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(false)return R.error(511,"永不会进入");else if("乡村志愿者".equals(role))params.put("yonghuId",request.getSession().getAttribute("userId"));else if("老人".equals(role))params.put("laorenId",request.getSession().getAttribute("userId"));else if("医疗人员".equals(role))params.put("yiliaoId",request.getSession().getAttribute("userId"));CommonUtil.checkMap(params);PageUtils page = huodongYuyueService.queryPage(params);//字典表数据转换List<HuodongYuyueView> list =(List<HuodongYuyueView>)page.getList();for(HuodongYuyueView 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);HuodongYuyueEntity huodongYuyue = huodongYuyueService.selectById(id);if(huodongYuyue !=null){//entity转viewHuodongYuyueView view = new HuodongYuyueView();BeanUtils.copyProperties( huodongYuyue , view );//把实体数据重构到view中//级联表 文娱活动//级联表HuodongEntity huodong = huodongService.selectById(huodongYuyue.getHuodongId());if(huodong != null){BeanUtils.copyProperties( huodong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "laorenId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setHuodongId(huodong.getId());}//级联表 老人//级联表LaorenEntity laoren = laorenService.selectById(huodongYuyue.getLaorenId());if(laoren != null){BeanUtils.copyProperties( laoren , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "laorenId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setLaorenId(laoren.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody HuodongYuyueEntity huodongYuyue, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,huodongYuyue:{}",this.getClass().getName(),huodongYuyue.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("老人".equals(role))huodongYuyue.setLaorenId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<HuodongYuyueEntity> queryWrapper = new EntityWrapper<HuodongYuyueEntity>().eq("huodong_id", huodongYuyue.getHuodongId()).eq("laoren_id", huodongYuyue.getLaorenId()).in("huodong_yuyue_yesno_types", new Integer[]{1,2});logger.info("sql语句:"+queryWrapper.getSqlSegment());HuodongYuyueEntity huodongYuyueEntity = huodongYuyueService.selectOne(queryWrapper);if(huodongYuyueEntity==null){huodongYuyue.setHuodongYuyueYesnoTypes(1);huodongYuyue.setInsertTime(new Date());huodongYuyue.setCreateTime(new Date());huodongYuyueService.insert(huodongYuyue);return R.ok();}else {if(huodongYuyueEntity.getHuodongYuyueYesnoTypes()==1)return R.error(511,"有相同的待审核的数据");else if(huodongYuyueEntity.getHuodongYuyueYesnoTypes()==2)return R.error(511,"有相同的审核通过的数据");elsereturn R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody HuodongYuyueEntity huodongYuyue, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,huodongYuyue:{}",this.getClass().getName(),huodongYuyue.toString());HuodongYuyueEntity oldHuodongYuyueEntity = huodongYuyueService.selectById(huodongYuyue.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
huodongYuyue.setLaorenId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));huodongYuyueService.updateById(huodongYuyue);//根据id更新return R.ok();}/*** 审核*/@RequestMapping("/shenhe")public R shenhe(@RequestBody HuodongYuyueEntity huodongYuyueEntity, HttpServletRequest request){logger.debug("shenhe方法:,,Controller:{},,huodongYuyueEntity:{}",this.getClass().getName(),huodongYuyueEntity.toString());HuodongYuyueEntity oldHuodongYuyue = huodongYuyueService.selectById(huodongYuyueEntity.getId());//查询原先数据huodongYuyueEntity.setHuodongYuyueShenheTime(new Date());//审核时间huodongYuyueService.updateById(huodongYuyueEntity);//审核return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids, HttpServletRequest request){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());List<HuodongYuyueEntity> oldHuodongYuyueList =huodongYuyueService.selectBatchIds(Arrays.asList(ids));//要删除的数据huodongYuyueService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<HuodongYuyueEntity> huodongYuyueList = 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){//循环HuodongYuyueEntity huodongYuyueEntity = new HuodongYuyueEntity();huodongYuyueList.add(huodongYuyueEntity);//把要查询是否重复的字段放入map中//报名编号if(seachFields.containsKey("huodongYuyueUuidNumber")){List<String> huodongYuyueUuidNumber = seachFields.get("huodongYuyueUuidNumber");huodongYuyueUuidNumber.add(data.get(0));//要改的}else{List<String> huodongYuyueUuidNumber = new ArrayList<>();huodongYuyueUuidNumber.add(data.get(0));//要改的seachFields.put("huodongYuyueUuidNumber",huodongYuyueUuidNumber);}}//查询是否重复//报名编号List<HuodongYuyueEntity> huodongYuyueEntities_huodongYuyueUuidNumber = huodongYuyueService.selectList(new EntityWrapper<HuodongYuyueEntity>().in("huodong_yuyue_uuid_number", seachFields.get("huodongYuyueUuidNumber")));if(huodongYuyueEntities_huodongYuyueUuidNumber.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(HuodongYuyueEntity s:huodongYuyueEntities_huodongYuyueUuidNumber){repeatFields.add(s.getHuodongYuyueUuidNumber());}return R.error(511,"数据库的该表中的 [报名编号] 字段已经存在 存在数据为:"+repeatFields.toString());}huodongYuyueService.insertBatch(huodongYuyueList);return R.ok();}}}}catch (Exception e){e.printStackTrace();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));CommonUtil.checkMap(params);PageUtils page = huodongYuyueService.queryPage(params);//字典表数据转换List<HuodongYuyueView> list =(List<HuodongYuyueView>)page.getList();for(HuodongYuyueView 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);HuodongYuyueEntity huodongYuyue = huodongYuyueService.selectById(id);if(huodongYuyue !=null){//entity转viewHuodongYuyueView view = new HuodongYuyueView();BeanUtils.copyProperties( huodongYuyue , view );//把实体数据重构到view中//级联表HuodongEntity huodong = huodongService.selectById(huodongYuyue.getHuodongId());if(huodong != null){BeanUtils.copyProperties( huodong , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setHuodongId(huodong.getId());}//级联表LaorenEntity laoren = laorenService.selectById(huodongYuyue.getLaorenId());if(laoren != null){BeanUtils.copyProperties( laoren , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setLaorenId(laoren.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody HuodongYuyueEntity huodongYuyue, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,huodongYuyue:{}",this.getClass().getName(),huodongYuyue.toString());Wrapper<HuodongYuyueEntity> queryWrapper = new EntityWrapper<HuodongYuyueEntity>().eq("huodong_yuyue_uuid_number", huodongYuyue.getHuodongYuyueUuidNumber()).eq("huodong_id", huodongYuyue.getHuodongId()).eq("laoren_id", huodongYuyue.getLaorenId()).eq("huodong_yuyue_text", huodongYuyue.getHuodongYuyueText()).in("huodong_yuyue_yesno_types", new Integer[]{1,2}).eq("huodong_yuyue_yesno_text", huodongYuyue.getHuodongYuyueYesnoText());logger.info("sql语句:"+queryWrapper.getSqlSegment());HuodongYuyueEntity huodongYuyueEntity = huodongYuyueService.selectOne(queryWrapper);if(huodongYuyueEntity==null){huodongYuyue.setHuodongYuyueYesnoTypes(1);huodongYuyue.setInsertTime(new Date());huodongYuyue.setCreateTime(new Date());huodongYuyueService.insert(huodongYuyue);return R.ok();}else {if(huodongYuyueEntity.getHuodongYuyueYesnoTypes()==1)return R.error(511,"有相同的待审核的数据");else if(huodongYuyueEntity.getHuodongYuyueYesnoTypes()==2)return R.error(511,"有相同的审核通过的数据");elsereturn R.error(511,"表中有相同数据");}}}
7.2 活动预约Service
package com.service;import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.HuodongYuyueEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;/*** 活动报名 服务类*/
public interface HuodongYuyueService extends IService<HuodongYuyueEntity> {/*** @param params 查询参数* @return 带分页的查询出来的数据*/PageUtils queryPage(Map<String, Object> params);}
7.3 活动预约ServiceImpl
package com.service.impl;/*** 活动报名 服务实现类*/
@Service("huodongYuyueService")
@Transactional
public class HuodongYuyueServiceImpl extends ServiceImpl<HuodongYuyueDao, HuodongYuyueEntity> implements HuodongYuyueService {@Overridepublic PageUtils queryPage(Map<String,Object> params) {Page<HuodongYuyueView> page =new Query<HuodongYuyueView>(params).getPage();page.setRecords(baseMapper.selectListView(page,params));return new PageUtils(page);}}
7.4 活动预约DAO
package com.dao;/*** 活动报名 Dao 接口** @author */
public interface HuodongYuyueDao extends BaseMapper<HuodongYuyueEntity> {List<HuodongYuyueView> selectListView(Pagination page,@Param("params")Map<String,Object> params);}
8.参考文档
你可能还有感兴趣的项目👇🏻👇🏻👇🏻
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论