⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 groupsboimpl.java.svn-base

📁 利用sip协议
💻 SVN-BASE
字号:
/**
* 该文件由自动生成代码器生成
*/
package com.xunlei.callcenter.bo;
import java.util.List;

import com.xunlei.common.util.*;
import com.xunlei.callcenter.vo.Groups;
import com.xunlei.callcenter.dao.IGroupsDao;



/**
* @author Administrator
* @date 2008-03-20 20:48:55
*
*/
public class GroupsBoImpl  extends BaseBo implements IGroupsBo {

	private IGroupsDao groupsDao;
	
	public void deleteGroupsById(long seqid) throws Exception{
		Groups g=getGroupsDao().getGroupsById(seqid);
    	if(seqid > 0L)
    	{
    		if(getGroupCountByGroupId(g.getGroupid())>0){
    			throw new Exception("请先删除此组相关的下级组!");
    		}
        	if(getGroupsDao().getEmployeesCountByGroupId(g.getGroupid())>0)
        		throw new Exception("请先删除此组相关的员工列表!");	
        	getGroupsDao().deleteGroupsById(seqid);
    	}
    	else
    		throw new Exception("组不存在,不能删除!");
		
	}

	
	public void deleteGroups(Groups g) throws Exception{
		long seqid = g.getSeqid();
		if(seqid > 0L)
    	{
    		if(getGroupCountByGroupId(g.getGroupid())>0){
    			throw new Exception("请先删除此组相关的下级组!");
    		}
        	if(getGroupsDao().getEmployeesCountByGroupId(g.getGroupid())>0)
        		throw new Exception("请先删除此组相关的员工列表!");	
        	getGroupsDao().deleteGroupsById(seqid);
    	}
    	else
    		throw new Exception("组不存在,不能删除!");
	}

	
	public Groups findGroups(Groups data) {
		return this.getGroupsDao().findGroups(data);
	}
   
	public Groups getGroupsById(long seqid) {
		return this.getGroupsDao().getGroupsById(seqid);
	}

	
	public void insertGroups(Groups data) throws Exception{
		if(getGroupsDao().getGroupCountByGroupName(data.getGroupidname())>0)
    		throw new Exception("已经存在相同名称的组!");
        String groupid=this.getAbleGroupId((data.getPgroupidid()));
		data.setGroupid(groupid);
		getGroupsDao().insertGroups(data);
	}

	
	public Sheet<Groups> queryGroups(Groups data, PagedFliper fliper) {
		return this.getGroupsDao().queryGroups(data, fliper);
	}

	
	public void updateGroups(Groups data)throws Exception {
		if(getGroupsDao().getGroupCountByGroupName(data.getGroupidname())>0)
    		throw new Exception("已经存在相同名称的组!");
		this.getGroupsDao().updateGroups(data);
	}

	public IGroupsDao getGroupsDao() {
		return groupsDao;
	}

	public void setGroupsDao(IGroupsDao groupsDao) {
		this.groupsDao = groupsDao;
	}


	public List<Groups> getAllGroups() {
		return this.groupsDao.getAllGroups();
	}


	public Groups getGroupsByGroupId(String groupid) {
		return this.groupsDao.getGroupsByGroupId(groupid);
	}


	public String getAbleGroupId(String pGroupIdId) {
		return  this.groupsDao.getAbleGroupId(pGroupIdId);
	}


	public int getGroupCountByGroupId(String groupid) {
		// TODO Auto-generated method stub
		return this.groupsDao.getGroupCountByGroupId(groupid);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -