sysadminmanagerimpl.java

来自「一个用struts+hibernate做的库存管理系统 适合新手研究学习」· Java 代码 · 共 105 行

JAVA
105
字号
package com.strong.ims.service.sysadmin.impl;

import java.util.List;

import com.strong.ims.comutil.IConstants;
import com.strong.ims.comutil.PageBean;
import com.strong.ims.comutil.exception.BaseException;
import com.strong.ims.dao.DaoFactory;
import com.strong.ims.domain.sysmanage.StorageInfo;
import com.strong.ims.service.sysadmin.SysAdminManager;

/**
 * 系统管理业务 实现类
 * @author jqg
 *
 */
public class SysAdminManagerImpl implements SysAdminManager {

	public SysAdminManagerImpl() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * ------------- 仓库管理-----------------
	 */
	
	/**
	 * 添加新仓库
	 * @param StorageInfo
	 * @throws BaseException 
	 */
	public void addNewStorageInfo(StorageInfo storageInfo) throws BaseException {
		// TODO Auto-generated method stub
		//throw new  BaseException(IConstants.ERROR_DAOPROCESS,"");
		DaoFactory.getStorageInfoDao().createStorageInfo(storageInfo );
	}
	
	/**
	 * 删除某仓库
	 * @param StorageInfoID
	 * @throws BaseException 
	 */
	public void deleteStorageInfoById(String stroageId) throws BaseException {
		// TODO Auto-generated method stub
		StorageInfo storageInfo  = new StorageInfo( );
		storageInfo.setF_sid( stroageId );
		
		DaoFactory.getStorageInfoDao().deleteStorageInfo(storageInfo);
	}
	
	/**
	 * 修改某仓库信息
	 * @param StorageInfo
	 * @throws BaseException 
	 */
	public void editStorageInfo(StorageInfo storageInfo) throws BaseException {
		// TODO Auto-generated method stub
		DaoFactory.getStorageInfoDao().updateStorageInfo(storageInfo);
	}
	
	/**
	 * 查询仓库信息
	 * @param name
	 * @param 
	 * @throws BaseException 
	 */
	public List getStorageInfoByHQL(String storageName, String storageState ) throws BaseException {
		// TODO Auto-generated method stub
//		String hql = "from StorageInfo as s where s.f_storagename like '" +storageName + "%' and s.f_isdelete = '" 
//			+  storageState + "'";
		StringBuffer HQL = new StringBuffer();
		HQL.append("from StorageInfo as s where s.f_sid is not null");
		if( storageName != null && storageName.trim().length() >= 1) {
			HQL.append(" and s.f_storagename like '" +storageName + "%'");
		}
		if( storageState != null && storageState.trim().length() >= 1) {
			HQL.append(" and s.f_isdelete = '" +  storageState + "'");
		}
		return DaoFactory.getStorageInfoDao().loadStorageInfoByHQL( HQL.toString() );
	}
	
	/**
	 * 读取某仓库信息
	 * @param storageId
	 * @throws BaseException 
	 */
	public StorageInfo getStorageInfoById(String storageId) throws BaseException {
		// TODO Auto-generated method stub
		return DaoFactory.getStorageInfoDao().loadStorageInfo(storageId);
	}
	/**
	 * 查询某仓库信息
	 * @param name
	 * @param 
	 * @throws BaseException 
	 * 支持分页
	 */
	public List getStorageInfoByHQL(String storageName, String storageState, PageBean pageBean) throws BaseException {
		// TODO Auto-generated method stub
		return null;
	}

}

⌨️ 快捷键说明

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