基于微信小程序的在線疫苗預約系統源碼+論文
代碼可以查看文章末尾??聯系方式獲取,記得注明來意哦~🌹
分享萬套開題報告+任務書+答辯PPT模板
作者完整代碼目錄供你選擇:
《SpringBoot網站項目》800套
《SSM網站項目》1200套
《小程序項目》600套
《APP項目》500套
《Python網站項目》800套
??文章末尾可以獲取聯系方式,需要源碼或者演示視頻可以聯系??
?感興趣大家可以點點關注收藏,后續更新更多項目資料。?
采用技術:
后端:Java+SpringBoot
微信小程序端:uniapp
數據庫:MySQL
運行軟件:微信開發者工具
系統功能:
該系統有工作人員、管理員模塊。
工作人員模塊功能:論壇管理、公告管理、疫苗管理、疫苗反饋管理、疫苗訂單管理等。
管理員模塊功能:工作人員管理、用戶管理、疫苗管理、疫苗反饋管理、疫苗訂單管理、論壇管理、公告管理等。
運行截圖:
疫苗管理界面:
疫苗訂單管理界面:
論壇管理界面:
疫苗界面:
論壇界面:
公告管理界面:
論文目錄:
核心代碼:
package com.controller;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.StringUtil;
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.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
import com.utils.PageUtils;
import com.utils.R;@RestController
@Controller
@RequestMapping("/yonghu")
public class YonghuController {private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);@Autowiredprivate YonghuService yonghuService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//級聯表service/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));params.put("orderBy","id");PageUtils page = yonghuService.queryPage(params);//字典表數據轉換List<YonghuView> list =(List<YonghuView>)page.getList();for(YonghuView c:list){//修改對應字典表字段dictionaryService.dictionaryConvert(c);}return R.ok().put("data", page);}/*** 后端詳情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);YonghuEntity yonghu = yonghuService.selectById(id);if(yonghu !=null){//entity轉viewYonghuView view = new YonghuView();BeanUtils.copyProperties( yonghu , view );//把實體數據重構到view中//修改對應字典表字段dictionaryService.dictionaryConvert(view);return R.ok().put("data", view);}else {return R.error(511,"查不到數據");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>().eq("username", yonghu.getUsername()).or().eq("yonghu_phone", yonghu.getYonghuPhone()).or().eq("yonghu_id_number", yonghu.getYonghuIdNumber());;logger.info("sql語句:"+queryWrapper.getSqlSegment());YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);if(yonghuEntity==null){yonghu.setCreateTime(new Date());yonghu.setPassword("123456");// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.insert(yonghu);return R.ok();}else {return R.error(511,"賬戶或者身份證號或者手機號已經被使用");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());//根據字段查詢是否有相同數據Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>().notIn("id",yonghu.getId()).andNew().eq("username", yonghu.getUsername()).or().eq("yonghu_phone", yonghu.getYonghuPhone()).or().eq("yonghu_id_number", yonghu.getYonghuIdNumber());;logger.info("sql語句:"+queryWrapper.getSqlSegment());YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){yonghu.setYonghuPhoto(null);}if(yonghuEntity==null){// String role = String.valueOf(request.getSession().getAttribute("role"));// if("".equals(role)){// yonghu.set// }yonghuService.updateById(yonghu);//根據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());yonghuService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 登錄*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));if(yonghu==null || !yonghu.getPassword().equals(password)) {return R.error("賬號或密碼不正確");}String token = tokenService.generateToken(yonghu.getId(),username, "yonghu", "用戶");R r = R.ok();r.put("token", token);r.put("role","用戶");r.put("username",yonghu.getYonghuName());r.put("tableName","yonghu");r.put("userId",yonghu.getId());return r;}/*** 注冊*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody YonghuEntity yonghu){// ValidatorUtils.validateEntity(user);if(yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", yonghu.getUsername()).orNew().eq("yonghu_phone",yonghu.getYonghuPhone()).orNew().eq("yonghu_id_number",yonghu.getYonghuIdNumber())) !=null) {return R.error("賬戶已存在或手機號或身份證號已經被使用");}yonghuService.insert(yonghu);return R.ok();}/*** 重置密碼*/@GetMapping(value = "/resetPassword")public R resetPassword(Integer id){YonghuEntity yonghu = new YonghuEntity();yonghu.setPassword("123456");yonghu.setId(id);yonghuService.updateById(yonghu);return R.ok();}/*** 獲取用戶的session用戶信息*/@RequestMapping("/session")public R getCurrYonghu(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");YonghuEntity yonghu = yonghuService.selectById(id);return R.ok().put("data", yonghu);}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}}
t("data", yonghu);}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}}