一、项目简述
功能包括: 住院病人管理,住院病房管理,医生管理,药品管理,仪 器管理等等。
二、项目运行
环境配置: 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;
}



