栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Java项目:医院住院管理系统(java+SSM+jsp+mysql+maven)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Java项目:医院住院管理系统(java+SSM+jsp+mysql+maven)

一、项目简述
功能包括: 住院病人管理,住院病房管理,医生管理,药品管理,仪 器管理等等。

二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + Javascript + JQuery + Ajax + layui+ maven等等。





后台角色操作service服务:

@Service
public class RoleService {

@Autowired
private RoleDao roleDao;


public Role save(Role role){
	return roleDao.save(role);
}


public List findAll(){
	return roleDao.findAll();
}


public List findSome(){
	return roleDao.findSome();
}


public PageBean findByName(Role role,PageBean pageBean){
	ExampleMatcher withMatcher = ExampleMatcher.matching().withMatcher("name", GenericPropertyMatchers.contains());
	withMatcher = withMatcher.withIgnorePaths("status");
	Example example = Example.of(role, withMatcher);
	Pageable pageable = PageRequest.of(pageBean.getCurrentPage()-1, pageBean.getPageSize());
	Page findAll = roleDao.findAll(example, pageable);
	pageBean.setContent(findAll.getContent());
	pageBean.setTotal(findAll.getTotalElements());
	pageBean.setTotalPage(findAll.getTotalPages());
	return pageBean;
}


public Role find(Long id){
	return roleDao.find(id);
}


public void delete(Long id){
	roleDao.deleteById(id);
}

医生层Service服务:
@Service
public class DoctorService {

@Autowired
private DoctorDao doctorDao;

@Autowired
private OrderReceivingDao orderReceivingDao;

public Doctor find(Long id) { //通过病人id查病人信息
return doctorDao.find(id);
}

public Doctor save(Doctor patient) { //保存
return doctorDao.save(patient);
}


public PageBean findList(Doctor doctor, PageBean pageBean){
ExampleMatcher withMatcher = ExampleMatcher.matching().withMatcher(“user.name”, ExampleMatcher.GenericPropertyMatchers.contains());
withMatcher = withMatcher.withIgnorePaths(“status”,“experience”,“user.status”,“user.sex”,“user.age”);
Example example = Example.of(doctor, withMatcher);
Pageable pageable = PageRequest.of(pageBean.getCurrentPage()-1, pageBean.getPageSize());
Page findAll = doctorDao.findAll(example, pageable);
pageBean.setContent(findAll.getContent());
pageBean.setTotal(findAll.getTotalElements());
pageBean.setTotalPage(findAll.getTotalPages());
return pageBean;
}


public Doctor findByLoginDoctorUser(){//拿到医生登录的信息
Long userId = SessionUtil.getLoginedUser().getId();
return doctorDao.findByUser_Id(userId);
}


public List findByDoctorDno(String doctorDno) {
return doctorDao.findByDoctorDno(doctorDno);
}


public void deleteById(Long id) {
doctorDao.deleteById(id);
}


public List findFreeDoctorByDepartmentId(Long departmentId) {
return doctorDao.findByDepartmentIdAndStatus(departmentId, DOCTOR_STATUS_ENABLE);
}


public PageBeanfindAllByDepartment(PageBeanpageBean, Long id){
Specification specification = new Specification() {
private static final long serialVersionUID = 1L;
@Override
public Predicate toPredicate(Root root,
CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) {
Predicate predicate = null;
Predicate equal1 = criteriaBuilder.equal(root.get(“department”),id);
predicate = criteriaBuilder.and(equal1);
return predicate;
}
};
Sort sort = Sort.by(Sort.Direction.DESC,“createTime”);
PageRequest pageable = PageRequest.of(pageBean.getCurrentPage()-1, pageBean.getPageSize(), sort);
Page findAll = doctorDao.findAll(specification, pageable);
pageBean.setContent(findAll.getContent());
pageBean.setTotal(findAll.getTotalElements());
pageBean.setTotalPage(findAll.getTotalPages());
return pageBean;
}


public boolean modifyVisitStatus(Long id){
Doctor doctor = findByLoginDoctorUser();
OrderReceiving receiving = orderReceivingDao.findAllOrderReceivingByDoctorId(id);
if (doctor.getId()==null&&doctor.getId().equals("")){
return false;
}
if (receiving.getOrderRegistration().getStatus()==REGISTRATION_STATUS_COMPLETED){
return false;
}
//订单状态设置为已完成
receiving.setStatus(RECEIVING_STATUS_COMPLETE);
//挂号状态设置为已完成
receiving.getOrderRegistration().setStatus(REGISTRATION_STATUS_COMPLETED);
orderReceivingDao.save(receiving);
return true;
}


public Integer selectCountByOrderReceiving(){
return doctorDao.selectCountByOrderReceiving();
}


public DoctorOrderCount OrderCountByDoctor(){
DoctorOrderCount orderCount = new DoctorOrderCount();
List Orders = doctorDao.OrderCountByDoctor();
ListdoctorName=new ArrayList<>();
ListcountNum=new ArrayList<>();
for (Object o : Orders) {
Object[] obj = (Object[]) o;
doctorName.add(obj[0].toString());
orderCount.setDoctorName(doctorName);
countNum.add(Integer.valueOf(obj[1].toString()));
orderCount.setCountNum(countNum);
}
return orderCount;
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/704985.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号