📄 businessserviceimpl.java
字号:
package com.jlobo.service.impl;
import java.util.List;
import javax.faces.model.SelectItem;
import org.apache.myfaces.custom.tree2.TreeNode;
import org.apache.myfaces.custom.tree2.TreeNodeChecked;
import com.jlobo.data.IBusinessDao;
import com.jlobo.data.ITreeDao;
import com.jlobo.hibernate.HibernateSessionFactory;
import com.jlobo.identity.User;
import com.jlobo.service.IBusinessService;
import com.jlobo.web.beans.Answer;
import com.jlobo.web.beans.Paper;
import com.jlobo.web.beans.Question;
public class BusinessServiceImpl implements IBusinessService {
IBusinessDao businessDao = null;
ITreeDao treeDao = null;
public IBusinessDao getBusinessDao() {
return businessDao;
}
public void setBusinessDao(IBusinessDao businessDao) {
this.businessDao = businessDao;
}
public ITreeDao getTreeDao() {
return treeDao;
}
public void setTreeDao(ITreeDao treeDao) {
this.treeDao = treeDao;
}
public boolean deleteQuestion(Question question) {
businessDao.setSession(HibernateSessionFactory.getSession());
// TODO Auto-generated method stub
return businessDao.deleteQuestion(question);
}
public Answer getAnswer(Long aid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getAnswer(aid);
}
public List getAnswers(Question question) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getAnswers(question);
}
public Question getQuestion(Long qid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getQuestion(qid);
}
public List getQuestions(Long tid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getQuestions(tid);
}
public boolean updateQuestion(Question question) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updateQuestion(question);
}
public TreeNode getQuestionBySubject() {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getQuestionBySubject();
}
public TreeNode getQuestionByType() {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getQuestionByType();
}
public boolean deletePaper(Paper paper) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.deletePaper(paper);
}
public Paper getPaper(Long pid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getPaper(pid);
}
public TreeNode getPaperTree() {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getPaperTree();
}
public List getPapers(Long sid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getPapers(sid);
}
public boolean updatePaper(Paper paper) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updatePaper(paper);
}
public SelectItem[] getSubjects(User user,Long mid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getSubjects(user,mid);
}
public SelectItem[] getTypes(User user,Long mid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getTypes(user,mid);
}
public TreeNodeChecked getDepartmentAndUserTree(Long mid,User user) {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getDepartmentAndUserTree(mid,user);
}
public TreeNodeChecked getSelectSubjectTree(Long mid) {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getSelectSubjectTree(mid);
}
public TreeNodeChecked getSelectTypeTree(Long mid) {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getSelectTypeTree(mid);
}
public boolean updateQuestionUser(String userPermissions) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updateQuestionUser(userPermissions);
}
public String getQuestionUserPermissions(Long mid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getQuestionUserPermissions(mid);
}
public List getSelectPapers() {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getSelectPapers();
}
public boolean deleteAnswer(Answer answer) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.deleteAnswer(answer);
}
public boolean updateAnswer(Answer answer) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updateAnswer(answer);
}
public boolean updateQuestionUser(TreeNodeChecked departmentAndUser) {
// TODO Auto-generated method stub
return false;
}
//指定阅卷人权限
public boolean updateReadPaper(String userPermissions) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updateReadPaper(userPermissions);
}
public boolean updateReadPaperAction(String userPermissions) {
// TODO Auto-generated method stub
return false;
}
// 指定出卷人权限
public boolean updatePaperUser(String userPermissions) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updatePaperUser(userPermissions);
}
public TreeNode getPaperSetTree(User user) {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getPaperSetTree(user);
}
public List getPaperQuestions(Long pid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getPaperQuestions(pid);
}
public TreeNodeChecked getExaminationDepartmentAndUserTree(Long eid) {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getExaminationDepartmentAndUserTree(eid);
}
public List getExaminationPapers(Long eid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getExaminationPapers(eid);
}
public String getExaminationPeopleList(Long eid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getExaminationPeopleList(eid);
}
public List getExaminationPeoples(Long eid) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getExaminationPeoples(eid);
}
public TreeNode getExaminationTree() {
treeDao.setSession(HibernateSessionFactory.getSession());
return treeDao.getExaminationTree();
}
public List getExaminations() {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.getExaminations();
}
public boolean updateExaminationPeople(String peopleList) {
businessDao.setSession(HibernateSessionFactory.getSession());
return businessDao.updateExaminationPeople(peopleList);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -