ssm在线医疗服务系统源码和论文PPT003
开发工具:idea
数据库mysql5.7+(mysql5.7最佳)
数据库链接工具:navcat,小海豚等
开发技术:java ssm tomcat8.5
选题意义、价值和目标:
随着经济的迅速发展,人们对生活水平和身体健康的要求越来越高,但同时也面临着优质医疗资源紧缺,看病难,看病贵,医患关系危机等各种各样的问题。近些年,越来越多传统行业的服务被迁移到互联网上来。如何使用互联网技术解决当前医疗系统中存在的问题,提高效率,成为研究热点。针对这种现状,本文设计并且实现了一个在线医疗服务系统。在线医疗服务系统为患者提供了内容丰富、信息准确、便捷高效、体贴主动的互联网医疗服务新体验,提高了患者的满意度,同时提升了医院服务和管理的水平。
开发工具:idea
数据库mysql5.7+(mysql5.7最佳)
数据库链接工具:navcat,小海豚等
开发技术:java ssm tomcat8.5
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.AddressEntity;
import com.entity.view.AddressView;
import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 地址
* 后端接口
* @author
* @email
* @date 2023-12-24 11:35:16
*/
@RestController
@RequestMapping("/address")
public class AddressController {
@Autowired
private AddressService addressService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,AddressEntity address, HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,AddressEntity address, HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( AddressEntity address){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
return R.ok().put("data", addressService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(AddressEntity address){
EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
AddressView addressView = addressService.selectView(ew);
return R.ok("查询地址成功").put("data", addressView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody AddressEntity address, HttpServletRequest request){
//ValidatorUtils.validateEntity(address);
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper().eq("userid", request.getSession().getAttribute("userId")));
}
addressService.updateById(address);//全部更新
return R.ok();
}
/**
* 获取默认地址
*/
@RequestMapping("/default")
public R defaultAddress(HttpServletRequest request){
Wrapper wrapper = new EntityWrapper().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
AddressEntity address = addressService.selectOne(wrapper);
return R.ok().put("data", address);
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
addressService.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 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 wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
}
int count = addressService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
主要参考文献:
[1]朱晓婷,张绍文.互联网医疗服务系统的设计及评估[J].科技和产业,2017,17(04):144-148.
[2]王伟伟,孟丹妮,巩丽娜.智能社区的健康医疗服务模式设计研究[J].工业设计,2020(09):112-113.
[3]兰旭辉,熊家军,邓刚.基于MySQL的应用程序设计[J].计算机工程与设计,2018(03):442-443+468.
[4]张伟丽,江春华,魏劲超.MySQL复制技术的研究及应用[J].计算机科学,2015,39(S3):168-170.
[5]刘学芬,孙荣辛,夏鲁宁,李伟.面向MySQL的安全隐患检测方法研究[J].信息网络安全,2016(09):1-5.
[6]孙志锋,徐镜春,厉小润.数据结构与数据库技术[M].浙江大学出版社,2016.
[7]刘明清.Java语言的特点与C++语言的比较[J].信息技术与信息化,2018(11):151-153.
[8]田智.基于计算机软件开发的JAVA编程语言分析[J].硅谷,2017,7(19):59+37.
[9]孙磊,贾宝强,曾翠翠.浅议Java软件开发中几种误区[J].网络与信息,2018,26(07):52.
[10]付博文.计算机软件开发的JAVA编程语言及其实际应用[J].南方农机,2018,49(23):158.
[11]Oscar Rodriguez-Prieto,Francisco Ortin,Donna O’Shea. Efficient runtime aspect weaving for Java applications[J]. Information and Software Technology,2018,100.
[12]Raffi Khatchadourian. Automated refactoring of legacy Java software to enumerated types[J]. Automated Software Engineering,2017,24(4).
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.DiscussjiankangzixunEntity;
import com.entity.view.DiscussjiankangzixunView;
import com.service.DiscussjiankangzixunService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 健康资讯评论表
* 后端接口
* @author
* @email
* @date 2023-12-24 11:35:16
*/
@RestController
@RequestMapping("/discussjiankangzixun")
public class DiscussjiankangzixunController {
@Autowired
private DiscussjiankangzixunService discussjiankangzixunService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,DiscussjiankangzixunEntity discussjiankangzixun, HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = discussjiankangzixunService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussjiankangzixun), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,DiscussjiankangzixunEntity discussjiankangzixun, HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = discussjiankangzixunService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussjiankangzixun), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DiscussjiankangzixunEntity discussjiankangzixun){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( discussjiankangzixun, "discussjiankangzixun"));
return R.ok().put("data", discussjiankangzixunService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DiscussjiankangzixunEntity discussjiankangzixun){
EntityWrapper< DiscussjiankangzixunEntity> ew = new EntityWrapper< DiscussjiankangzixunEntity>();
ew.allEq(MPUtil.allEQMapPre( discussjiankangzixun, "discussjiankangzixun"));
DiscussjiankangzixunView discussjiankangzixunView = discussjiankangzixunService.selectView(ew);
return R.ok("查询健康资讯评论表成功").put("data", discussjiankangzixunView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DiscussjiankangzixunEntity discussjiankangzixun = discussjiankangzixunService.selectById(id);
return R.ok().put("data", discussjiankangzixun);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DiscussjiankangzixunEntity discussjiankangzixun = discussjiankangzixunService.selectById(id);
return R.ok().put("data", discussjiankangzixun);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DiscussjiankangzixunEntity discussjiankangzixun, HttpServletRequest request){
discussjiankangzixun.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussjiankangzixun);
discussjiankangzixunService.insert(discussjiankangzixun);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DiscussjiankangzixunEntity discussjiankangzixun, HttpServletRequest request){
discussjiankangzixun.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussjiankangzixun);
discussjiankangzixunService.insert(discussjiankangzixun);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody DiscussjiankangzixunEntity discussjiankangzixun, HttpServletRequest request){
//ValidatorUtils.validateEntity(discussjiankangzixun);
discussjiankangzixunService.updateById(discussjiankangzixun);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
discussjiankangzixunService.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 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 wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = discussjiankangzixunService.selectCount(wrapper);
return R.ok().put("count", count);
}
}