Commit 55135aca authored by 季圣华's avatar 季圣华
Browse files

整理代码

parent 46b75fec
...@@ -10,7 +10,7 @@ import com.jsh.util.common.PageUtil; ...@@ -10,7 +10,7 @@ import com.jsh.util.common.PageUtil;
/** /**
* 常用增删改查操作 * 常用增删改查操作
* @author andy * @author jishenghua
* @param <T> * @param <T>
*/ */
public interface BaseIDAO<T> public interface BaseIDAO<T>
......
...@@ -7,7 +7,7 @@ import java.util.Map; ...@@ -7,7 +7,7 @@ import java.util.Map;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Basicuser; import com.jsh.model.po.Basicuser;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
......
...@@ -4,7 +4,7 @@ import org.apache.log4j.Logger; ...@@ -4,7 +4,7 @@ import org.apache.log4j.Logger;
/** /**
* 封装log4j日志信息,打印日志信息类 * 封装log4j日志信息,打印日志信息类
* @author andy * @author jishenghua
* @since 2014-01-22 * @since 2014-01-22
*/ */
public class Log public class Log
......
...@@ -2,13 +2,13 @@ package com.jsh.constants.asset; ...@@ -2,13 +2,13 @@ package com.jsh.constants.asset;
/** /**
* 定义资产管理常量 * 定义资产管理常量
* @author andy * @author jishenghua
*/ */
public interface AssetConstants public interface AssetConstants
{ {
/** /**
* 公共常量 * 公共常量
* @author andy * @author jishenghua
*/ */
public class Common public class Common
{ {
...@@ -17,7 +17,7 @@ public interface AssetConstants ...@@ -17,7 +17,7 @@ public interface AssetConstants
/** /**
* 资产常量--导入导出excel表格业务相关 * 资产常量--导入导出excel表格业务相关
* @author andy * @author jishenghua
*/ */
public class BusinessForExcel public class BusinessForExcel
{ {
......
...@@ -4,7 +4,7 @@ public interface AmsConstants ...@@ -4,7 +4,7 @@ public interface AmsConstants
{ {
/** /**
* 定义资产管理公共常量 * 定义资产管理公共常量
* @author andy * @author jishenghua
*/ */
public class Common public class Common
{ {
......
...@@ -4,7 +4,7 @@ public interface LogModuleConstants ...@@ -4,7 +4,7 @@ public interface LogModuleConstants
{ {
/** /**
* 系统管理模块名称定义 * 系统管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class ManageModuleNameCode public class ManageModuleNameCode
{ {
...@@ -31,7 +31,7 @@ public interface LogModuleConstants ...@@ -31,7 +31,7 @@ public interface LogModuleConstants
/** /**
* 资产管理模块名称定义 * 资产管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class AssetModuleNameCode public class AssetModuleNameCode
{ {
...@@ -53,7 +53,7 @@ public interface LogModuleConstants ...@@ -53,7 +53,7 @@ public interface LogModuleConstants
/** /**
* 日志管理模块名称定义 * 日志管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class LogModuleNameCode public class LogModuleNameCode
{ {
......
...@@ -3,7 +3,7 @@ package com.jsh.dao.asset; ...@@ -3,7 +3,7 @@ package com.jsh.dao.asset;
import org.hibernate.Query; import org.hibernate.Query;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Asset; import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
import com.jsh.util.common.SearchConditionUtil; import com.jsh.util.common.SearchConditionUtil;
...@@ -12,7 +12,7 @@ public class ReportDAO extends HibernateDaoSupport implements ReportIDAO ...@@ -12,7 +12,7 @@ public class ReportDAO extends HibernateDaoSupport implements ReportIDAO
{ {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws AmsException public void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws JshException
{ {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(" + reportType +") as dataSum, " + reportName + " from Asset asset where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(" + reportType +") as dataSum, " + reportName + " from Asset asset where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size()); pageUtil.setTotalCount(query.list().size());
......
package com.jsh.dao.asset; package com.jsh.dao.asset;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Asset; import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -10,7 +10,7 @@ public interface ReportIDAO ...@@ -10,7 +10,7 @@ public interface ReportIDAO
* 查找资产列表 * 查找资产列表
* @param pageUtil 分页工具类 * @param pageUtil 分页工具类
* @param reportType 报表统计字段 * @param reportType 报表统计字段
* @throws AmsException * @throws JshException
*/ */
void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws AmsException; void find(PageUtil<Asset> pageUtil,String reportType,String reportName) throws JshException;
} }
...@@ -3,7 +3,7 @@ package com.jsh.dao.basic; ...@@ -3,7 +3,7 @@ package com.jsh.dao.basic;
import org.hibernate.Query; import org.hibernate.Query;
import com.jsh.base.BaseDAO; import com.jsh.base.BaseDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Asset; import com.jsh.model.po.Asset;
import com.jsh.model.po.UserBusiness; import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -23,7 +23,7 @@ public class UserBusinessDAO extends BaseDAO<UserBusiness> implements UserBusine ...@@ -23,7 +23,7 @@ public class UserBusinessDAO extends BaseDAO<UserBusiness> implements UserBusine
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws AmsException public void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws JshException
{ {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(id),sum(id) from UserBusiness userBusiness where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select count(id),sum(id) from UserBusiness userBusiness where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size()); pageUtil.setTotalCount(query.list().size());
......
package com.jsh.dao.basic; package com.jsh.dao.basic;
import com.jsh.base.BaseIDAO; import com.jsh.base.BaseIDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.UserBusiness; import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -10,5 +10,5 @@ public interface UserBusinessIDAO extends BaseIDAO<UserBusiness> ...@@ -10,5 +10,5 @@ public interface UserBusinessIDAO extends BaseIDAO<UserBusiness>
/* /*
* 测试hql语句 * 测试hql语句
*/ */
void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws AmsException; void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws JshException;
} }
...@@ -3,7 +3,7 @@ package com.jsh.dao.materials; ...@@ -3,7 +3,7 @@ package com.jsh.dao.materials;
import org.hibernate.Query; import org.hibernate.Query;
import com.jsh.base.BaseDAO; import com.jsh.base.BaseDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness; import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -23,7 +23,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO ...@@ -23,7 +23,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void find(PageUtil<DepotHead> pageUtil,String maxid) throws AmsException public void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException
{ {
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size()); pageUtil.setTotalCount(query.list().size());
......
package com.jsh.dao.materials; package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO; import com.jsh.base.BaseIDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness; import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -11,5 +11,5 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead> ...@@ -11,5 +11,5 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
/* /*
* 获取MaxId * 获取MaxId
*/ */
void find(PageUtil<DepotHead> pageUtil,String maxid) throws AmsException; void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException;
} }
...@@ -3,7 +3,7 @@ package com.jsh.dao.materials; ...@@ -3,7 +3,7 @@ package com.jsh.dao.materials;
import org.hibernate.Query; import org.hibernate.Query;
import com.jsh.base.BaseDAO; import com.jsh.base.BaseDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem; import com.jsh.model.po.DepotItem;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -23,7 +23,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO ...@@ -23,7 +23,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId,String MonthTime,Boolean isPrev) throws AmsException public void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId,String MonthTime,Boolean isPrev) throws JshException
{ {
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便 //多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
Query query; Query query;
...@@ -40,7 +40,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO ...@@ -40,7 +40,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws AmsException public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws JshException
{ {
//多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便 //多表联查,多表连查,此处用到了createSQLQuery,可以随便写sql语句,很方便
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select * from jsh_depotitem where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select * from jsh_depotitem where 1=1 " + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
......
package com.jsh.dao.materials; package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO; import com.jsh.base.BaseIDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem; import com.jsh.model.po.DepotItem;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
public interface DepotItemIDAO extends BaseIDAO<DepotItem> public interface DepotItemIDAO extends BaseIDAO<DepotItem>
{ {
void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId, String MonthTime,Boolean isPrev) throws AmsException; void findByType(PageUtil<DepotItem> pageUtil,String type,Long MId, String MonthTime,Boolean isPrev) throws JshException;
void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws AmsException; void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws JshException;
} }
...@@ -3,59 +3,59 @@ package com.jsh.exception; ...@@ -3,59 +3,59 @@ package com.jsh.exception;
/** /**
* @title: 平台异常基类 * @title: 平台异常基类
* @description: 用于包装一些异常信息,打印日志等服务 * @description: 用于包装一些异常信息,打印日志等服务
* @author andy * @author jishenghua
* @since: 2014-01-24 * @since: 2014-01-24
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class AmsException extends Exception public class JshException extends Exception
{ {
public long errorCode = -1; public long errorCode = -1;
public String message ; public String message ;
public AmsException() public JshException()
{ {
super(); super();
} }
public AmsException(String message) public JshException(String message)
{ {
super(message); super(message);
this.message = message; this.message = message;
} }
public AmsException(String message, Throwable cause) public JshException(String message, Throwable cause)
{ {
super(message, cause); super(message, cause);
this.message = message; this.message = message;
} }
public AmsException(Throwable cause) public JshException(Throwable cause)
{ {
super(cause); super(cause);
} }
public AmsException(long errorCode) public JshException(long errorCode)
{ {
super(); super();
this.errorCode = errorCode; this.errorCode = errorCode;
} }
public AmsException(String message, long errorCode) public JshException(String message, long errorCode)
{ {
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
this.message = message; this.message = message;
} }
public AmsException(String message, long errorCode, Throwable cause) public JshException(String message, long errorCode, Throwable cause)
{ {
super(message, cause); super(message, cause);
this.errorCode = errorCode; this.errorCode = errorCode;
this.message = message; this.message = message;
} }
public AmsException(long errorCode, Throwable cause) public JshException(long errorCode, Throwable cause)
{ {
super(cause); super(cause);
this.errorCode = errorCode; this.errorCode = errorCode;
......
...@@ -15,7 +15,7 @@ import javax.servlet.http.HttpSession; ...@@ -15,7 +15,7 @@ import javax.servlet.http.HttpSession;
/** /**
* 用户登录session处理类 * 用户登录session处理类
* 过滤session是否超时 * 过滤session是否超时
* @author andy * @author jishenghua
* @version [版本号, 2012-3-6] * @version [版本号, 2012-3-6]
* @see [相关类/方法] * @see [相关类/方法]
* @since * @since
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</column> </column>
</property> </property>
<property name="password" type="java.lang.String"> <property name="password" type="java.lang.String">
<column name="password" length="30" not-null="true"> <column name="password" length="50" not-null="true">
<comment>登陆密码</comment> <comment>登陆密码</comment>
</column> </column>
</property> </property>
......
package com.jsh.model.vo.materials; package com.jsh.model.vo.materials;
import java.io.Serializable; import java.io.Serializable;
import com.sun.jmx.snmp.Timestamp;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class DepotHeadModel implements Serializable public class DepotHeadModel implements Serializable
......
...@@ -4,7 +4,7 @@ import java.io.File; ...@@ -4,7 +4,7 @@ import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import com.jsh.base.BaseIService; import com.jsh.base.BaseIService;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Asset; import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
...@@ -14,7 +14,7 @@ public interface AssetIService extends BaseIService<Asset> ...@@ -14,7 +14,7 @@ public interface AssetIService extends BaseIService<Asset>
* 导出信息 * 导出信息
* @return * @return
*/ */
InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws AmsException; InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws JshException;
/** /**
* 导入资产excel文件--表格格式 同 媒资列表 || 资产名称-资产类型-单价-用户-购买时间-状态-位置-资产编号-序列号-有效日期-保修日期-供应商-标签-描述 * 导入资产excel文件--表格格式 同 媒资列表 || 资产名称-资产类型-单价-用户-购买时间-状态-位置-资产编号-序列号-有效日期-保修日期-供应商-标签-描述
...@@ -24,7 +24,7 @@ public interface AssetIService extends BaseIService<Asset> ...@@ -24,7 +24,7 @@ public interface AssetIService extends BaseIService<Asset>
* @param assetFile excel表格文件 * @param assetFile excel表格文件
* @param isCheck 是否检查 0--手工确定 1--直接导入数据库中 * @param isCheck 是否检查 0--手工确定 1--直接导入数据库中
* @return 错误的表格数据 * @return 错误的表格数据
* @throws AmsException * @throws JshException
*/ */
InputStream importExcel(File assetFile,int isCheck)throws AmsException; InputStream importExcel(File assetFile,int isCheck)throws JshException;
} }
...@@ -39,7 +39,7 @@ import com.jsh.dao.basic.AssetNameIDAO; ...@@ -39,7 +39,7 @@ import com.jsh.dao.basic.AssetNameIDAO;
import com.jsh.dao.basic.CategoryIDAO; import com.jsh.dao.basic.CategoryIDAO;
import com.jsh.dao.basic.SupplierIDAO; import com.jsh.dao.basic.SupplierIDAO;
import com.jsh.dao.basic.UserIDAO; import com.jsh.dao.basic.UserIDAO;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Asset; import com.jsh.model.po.Asset;
import com.jsh.model.po.Assetname; import com.jsh.model.po.Assetname;
import com.jsh.model.po.Category; import com.jsh.model.po.Category;
...@@ -74,7 +74,7 @@ public class AssetService extends BaseService<Asset> implements AssetIService ...@@ -74,7 +74,7 @@ public class AssetService extends BaseService<Asset> implements AssetIService
* 导出Excel表格 * 导出Excel表格
*/ */
@Override @Override
public InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws AmsException public InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws JshException
{ {
try try
{ {
...@@ -97,12 +97,12 @@ public class AssetService extends BaseService<Asset> implements AssetIService ...@@ -97,12 +97,12 @@ public class AssetService extends BaseService<Asset> implements AssetIService
catch (Exception e) catch (Exception e)
{ {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>>导出资产信息为excel表格异常", e); Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>>导出资产信息为excel表格异常", e);
throw new AmsException("export asset info to excel exception",e); throw new JshException("export asset info to excel exception",e);
} }
} }
@Override @Override
public InputStream importExcel(File assetFile,int isCheck) throws AmsException public InputStream importExcel(File assetFile,int isCheck) throws JshException
{ {
//全局变量--每次调用前需要清空数据 //全局变量--每次调用前需要清空数据
mapData.clear(); mapData.clear();
...@@ -129,10 +129,10 @@ public class AssetService extends BaseService<Asset> implements AssetIService ...@@ -129,10 +129,10 @@ public class AssetService extends BaseService<Asset> implements AssetIService
/** /**
* 初始加载系统基础数据--导入过程中,不用频繁查询数据库内容,影响系统性能。 * 初始加载系统基础数据--导入过程中,不用频繁查询数据库内容,影响系统性能。
* @throws AmsException * @throws JshException
*/ */
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings({ "unchecked", "rawtypes" })
private void loadSystemData()throws AmsException private void loadSystemData()throws JshException
{ {
PageUtil pageUtil = new PageUtil(); PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0); pageUtil.setPageSize(0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment