整理代码

This commit is contained in:
季圣华
2016-11-19 23:32:00 -06:00
parent 46b75fecc6
commit 55135acaaa
76 changed files with 6878 additions and 6884 deletions

View File

@@ -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>

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.constants.asset.AssetConstants; import com.jsh.constants.asset.AssetConstants;
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.Basicuser; import com.jsh.model.po.Basicuser;
@@ -431,7 +431,7 @@ public class AssetAction extends BaseAction<AssetModel>
} }
} }
catch (AmsException e) catch (JshException e)
{ {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e); Log.errorFileSync(">>>>>>>>>>>>>>>>>>>导入excel表格信息异常", e);
} }

View File

@@ -5,7 +5,7 @@ import java.util.Map;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
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.vo.asset.ReportModel; import com.jsh.model.vo.asset.ReportModel;
import com.jsh.service.asset.ReportIService; import com.jsh.service.asset.ReportIService;
@@ -33,7 +33,7 @@ public class ReportAction extends BaseAction<ReportModel>
reportService.find(pageUtil,reportType.split("_")[0],reportType.split("_")[1]); reportService.find(pageUtil,reportType.split("_")[0],reportType.split("_")[1]);
model.getShowModel().setReportData(pageUtil.getPageList()); model.getShowModel().setReportData(pageUtil.getPageList());
} }
catch (AmsException e) catch (JshException e)
{ {
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e); Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
model.getShowModel().setMsgTip("get report data exception"); model.getShowModel().setMsgTip("get report data exception");

View File

@@ -22,7 +22,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.App; import com.jsh.model.po.App;
import com.jsh.model.po.Logdetails; import com.jsh.model.po.Logdetails;
import com.jsh.model.vo.basic.AppModel; import com.jsh.model.vo.basic.AppModel;

View File

@@ -13,7 +13,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.Depot; import com.jsh.model.po.Depot;
import com.jsh.model.po.Logdetails; import com.jsh.model.po.Logdetails;
import com.jsh.model.po.Role; import com.jsh.model.po.Role;

View File

@@ -13,7 +13,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.App; import com.jsh.model.po.App;
import com.jsh.model.po.Functions; import com.jsh.model.po.Functions;
import com.jsh.model.po.Logdetails; import com.jsh.model.po.Logdetails;

View File

@@ -13,7 +13,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.exception.AmsException; import com.jsh.exception.JshException;
import com.jsh.model.po.App; import com.jsh.model.po.App;
import com.jsh.model.po.Role; import com.jsh.model.po.Role;
import com.jsh.model.po.Logdetails; import com.jsh.model.po.Logdetails;

View File

@@ -41,6 +41,7 @@ public class UserAction extends BaseAction<UserModel>
try try
{ {
password = Tools.md5Encryp(password); password = Tools.md5Encryp(password);
System.out.println(password);
} }
catch (NoSuchAlgorithmException e) catch (NoSuchAlgorithmException e)
{ {
@@ -136,7 +137,7 @@ public class UserAction extends BaseAction<UserModel>
user.setIsystem((short)1); user.setIsystem((short)1);
user.setIsmanager((short)1); user.setIsmanager((short)1);
user.setLoginame(model.getLoginame()); user.setLoginame(model.getLoginame());
String password ="00000000"; String password ="123456";
//因密码用MD5加密需要对密码进行转化 //因密码用MD5加密需要对密码进行转化
try try
{ {

View File

@@ -17,7 +17,7 @@ import org.springframework.dao.DataAccessException;
import com.jsh.base.BaseAction; import com.jsh.base.BaseAction;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.constants.asset.AssetConstants; import com.jsh.constants.asset.AssetConstants;
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.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem; import com.jsh.model.po.DepotItem;
@@ -348,7 +348,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
allNumber = "0"; allNumber = "0";
} }
allNumber = allNumber.replace(".0", ""); allNumber = allNumber.replace(".0", "");
} catch (AmsException e) { } catch (JshException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }

View File

@@ -15,7 +15,7 @@ import com.jsh.model.po.Basicuser;
import com.jsh.service.basic.LogIService; import com.jsh.service.basic.LogIService;
/** /**
* struts2工具类 * struts2工具类
* @author andy * @author jishenghua
* struts2 base action 一些常用方法获取 * struts2 base action 一些常用方法获取
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")

View File

@@ -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>

View File

@@ -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;

View File

@@ -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

View File

@@ -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
/** /**
* 资产常量--导入导出excel表格业务相关 * 资产常量--导入导出excel表格业务相关
* @author andy * @author jishenghua
*/ */
public class BusinessForExcel public class BusinessForExcel
{ {

View File

@@ -4,7 +4,7 @@ public interface AmsConstants
{ {
/** /**
* 定义资产管理公共常量 * 定义资产管理公共常量
* @author andy * @author jishenghua
*/ */
public class Common public class Common
{ {

View File

@@ -4,7 +4,7 @@ public interface LogModuleConstants
{ {
/** /**
* 系统管理模块名称定义 * 系统管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class ManageModuleNameCode public class ManageModuleNameCode
{ {
@@ -31,7 +31,7 @@ public interface LogModuleConstants
/** /**
* 资产管理模块名称定义 * 资产管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class AssetModuleNameCode public class AssetModuleNameCode
{ {
@@ -53,7 +53,7 @@ public interface LogModuleConstants
/** /**
* 日志管理模块名称定义 * 日志管理模块名称定义
* @author andy * @author jishenghua
*/ */
public class LogModuleNameCode public class LogModuleNameCode
{ {

View File

@@ -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
{ {
@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());

View File

@@ -1,6 +1,6 @@
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
* 查找资产列表 * 查找资产列表
* @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;
} }

View File

@@ -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
@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());

View File

@@ -1,7 +1,7 @@
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>
/* /*
* 测试hql语句 * 测试hql语句
*/ */
void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws AmsException; void find(PageUtil<UserBusiness> pageUtil,String ceshi) throws JshException;
} }

View File

@@ -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
@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());

View File

@@ -1,7 +1,7 @@
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>
/* /*
* 获取MaxId * 获取MaxId
*/ */
void find(PageUtil<DepotHead> pageUtil,String maxid) throws AmsException; void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException;
} }

View File

@@ -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
@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
@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()));

View File

@@ -1,14 +1,14 @@
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;
} }

View File

@@ -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;

View File

@@ -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

View File

@@ -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>

View File

@@ -1,7 +1,6 @@
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

View 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>
* 导出信息 * 导出信息
* @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>
* @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;
} }

View File

@@ -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
* 导出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
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
/** /**
* 初始加载系统基础数据--导入过程中,不用频繁查询数据库内容,影响系统性能。 * 初始加载系统基础数据--导入过程中,不用频繁查询数据库内容,影响系统性能。
* @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);

View File

@@ -1,6 +1,6 @@
package com.jsh.service.asset; package com.jsh.service.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;
@@ -9,7 +9,7 @@ public interface ReportIService
/** /**
* 查找报表数据 * 查找报表数据
* @param asset * @param asset
* @throws AmsException * @throws JshException
*/ */
void find(PageUtil<Asset> asset,String reportType,String reportName)throws AmsException; void find(PageUtil<Asset> asset,String reportType,String reportName)throws JshException;
} }

View File

@@ -1,7 +1,7 @@
package com.jsh.service.asset; package com.jsh.service.asset;
import com.jsh.dao.asset.ReportIDAO; import com.jsh.dao.asset.ReportIDAO;
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;
@@ -15,7 +15,7 @@ public class ReportService implements ReportIService
} }
@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
{ {
reportDao.find(pageUtil, reportType,reportName); reportDao.find(pageUtil, reportType,reportName);
} }

View File

@@ -1,7 +1,7 @@
package com.jsh.service.basic; package com.jsh.service.basic;
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.Logdetails; import com.jsh.model.po.Logdetails;
public interface LogIService extends BaseIService<Logdetails> public interface LogIService extends BaseIService<Logdetails>
@@ -9,7 +9,7 @@ public interface LogIService extends BaseIService<Logdetails>
/** /**
* 增加 * 增加
* @param t 对象 * @param t 对象
* @throws AmsException * @throws JshException
*/ */
@Override @Override
void save(Logdetails t); void save(Logdetails t);

View File

@@ -1,7 +1,7 @@
package com.jsh.service.basic; package com.jsh.service.basic;
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.UserBusiness; import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
@@ -10,6 +10,6 @@ public interface UserBusinessIService extends BaseIService<UserBusiness>
/* /*
* 测试一下自定义hql语句 * 测试一下自定义hql语句
*/ */
void find(PageUtil<UserBusiness> userBusiness,String ceshi)throws AmsException; void find(PageUtil<UserBusiness> userBusiness,String ceshi)throws JshException;
} }

View File

@@ -2,7 +2,7 @@ package com.jsh.service.basic;
import com.jsh.base.BaseService; import com.jsh.base.BaseService;
import com.jsh.dao.basic.UserBusinessIDAO; import com.jsh.dao.basic.UserBusinessIDAO;
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;
@@ -23,7 +23,7 @@ public class UserBusinessService extends BaseService<UserBusiness> implements Us
} }
@Override @Override
public void find(PageUtil<UserBusiness> pageUtil, String ceshi) throws AmsException public void find(PageUtil<UserBusiness> pageUtil, String ceshi) throws JshException
{ {
userBusinessDao.find(pageUtil, ceshi); userBusinessDao.find(pageUtil, ceshi);
} }

View File

@@ -1,7 +1,7 @@
package com.jsh.service.basic; package com.jsh.service.basic;
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.Basicuser; import com.jsh.model.po.Basicuser;
public interface UserIService extends BaseIService<Basicuser> public interface UserIService extends BaseIService<Basicuser>
@@ -11,15 +11,15 @@ public interface UserIService extends BaseIService<Basicuser>
* @param username 用户名 String password * @param username 用户名 String password
* @return int 1、用户名不存在 2、密码不正确 3、黑名单用户 4、符合条件 5、访问后台异常 * @return int 1、用户名不存在 2、密码不正确 3、黑名单用户 4、符合条件 5、访问后台异常
*/ */
int validateUser(String username,String password)throws AmsException; int validateUser(String username,String password)throws JshException;
/** /**
* 获取用户信息 * 获取用户信息
* @param username * @param username
* @return 用户信息 * @return 用户信息
* @throws AmsException * @throws JshException
*/ */
public Basicuser getUser(String username) throws AmsException; public Basicuser getUser(String username) throws JshException;
/** /**
* 检查用户名称是否存在 * 检查用户名称是否存在
@@ -27,7 +27,7 @@ public interface UserIService extends BaseIService<Basicuser>
* @param username 用户名称 * @param username 用户名称
* @param userID 供应商ID * @param userID 供应商ID
* @return true==存在重名 false==不存在 * @return true==存在重名 false==不存在
* @throws AmsException * @throws JshException
*/ */
Boolean checkIsNameExist(String field,String username,Long userID)throws AmsException; Boolean checkIsNameExist(String field,String username,Long userID)throws JshException;
} }

View File

@@ -9,7 +9,7 @@ import com.jsh.base.Log;
import com.jsh.constants.common.ExceptionCodeConstants; import com.jsh.constants.common.ExceptionCodeConstants;
import com.jsh.dao.basic.UserBusinessIDAO; import com.jsh.dao.basic.UserBusinessIDAO;
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.Basicuser; import com.jsh.model.po.Basicuser;
import com.jsh.util.common.PageUtil; import com.jsh.util.common.PageUtil;
@@ -20,7 +20,7 @@ public class UserService extends BaseService<Basicuser> implements UserIService
private UserIDAO userDao; private UserIDAO userDao;
@Override @Override
public int validateUser(String username, String password)throws AmsException public int validateUser(String username, String password)throws JshException
{ {
try try
{ {
@@ -66,12 +66,12 @@ public class UserService extends BaseService<Basicuser> implements UserIService
} }
catch (Exception e) catch (Exception e)
{ {
throw new AmsException("unknown exception",e); throw new JshException("unknown exception",e);
} }
} }
@Override @Override
public Basicuser getUser(String username) throws AmsException public Basicuser getUser(String username) throws JshException
{ {
//全局变量 每次使用前清除 //全局变量 每次使用前清除
condition.clear(); condition.clear();
@@ -82,11 +82,11 @@ public class UserService extends BaseService<Basicuser> implements UserIService
if(null != list && list.size() >0) if(null != list && list.size() >0)
return list.get(0); return list.get(0);
else else
throw new AmsException("no username exist"); throw new JshException("no username exist");
} }
@Override @Override
public Boolean checkIsNameExist(String field,String username, Long userID)throws AmsException public Boolean checkIsNameExist(String field,String username, Long userID)throws JshException
{ {
condition.clear(); condition.clear();
condition.put(field + "_s_eq", username); condition.put(field + "_s_eq", username);

View File

@@ -1,7 +1,7 @@
package com.jsh.service.materials; package com.jsh.service.materials;
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.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 DepotHeadIService extends BaseIService<DepotHead>
/* /*
* 获取MaxId * 获取MaxId
*/ */
void find(PageUtil<DepotHead> depotHead,String maxid)throws AmsException; void find(PageUtil<DepotHead> depotHead,String maxid)throws JshException;
} }

View File

@@ -2,7 +2,7 @@ package com.jsh.service.materials;
import com.jsh.base.BaseService; import com.jsh.base.BaseService;
import com.jsh.dao.materials.DepotHeadIDAO; import com.jsh.dao.materials.DepotHeadIDAO;
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;
@@ -25,7 +25,7 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
} }
@Override @Override
public void find(PageUtil<DepotHead> pageUtil, String maxid) throws AmsException public void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException
{ {
depotHeadDao.find(pageUtil, maxid); depotHeadDao.find(pageUtil, maxid);
} }

View File

@@ -6,7 +6,7 @@ import java.util.List;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
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.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem; import com.jsh.model.po.DepotItem;
@@ -14,13 +14,13 @@ import com.jsh.util.common.PageUtil;
public interface DepotItemIService extends BaseIService<DepotItem> public interface DepotItemIService extends BaseIService<DepotItem>
{ {
void findByType(PageUtil<DepotItem> depotItem, String type, Long MId, String MonthTime,Boolean isPrev)throws AmsException; void findByType(PageUtil<DepotItem> depotItem, String type, Long MId, String MonthTime,Boolean isPrev)throws JshException;
void findOrderByMaterial(PageUtil<DepotItem> depotItem)throws AmsException; void findOrderByMaterial(PageUtil<DepotItem> depotItem)throws JshException;
/** /**
* 导出信息 * 导出信息
* @return * @return
*/ */
InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws AmsException; InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws JshException;
} }

View File

@@ -20,7 +20,7 @@ import com.jsh.base.BaseService;
import com.jsh.base.Log; import com.jsh.base.Log;
import com.jsh.constants.asset.AssetConstants; import com.jsh.constants.asset.AssetConstants;
import com.jsh.dao.materials.DepotItemIDAO; import com.jsh.dao.materials.DepotItemIDAO;
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.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.DepotItem; import com.jsh.model.po.DepotItem;
@@ -45,13 +45,13 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
} }
@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
{ {
depotItemDao.findByType(pageUtil, type, MId, MonthTime,isPrev); depotItemDao.findByType(pageUtil, type, MId, MonthTime,isPrev);
} }
@Override @Override
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws AmsException public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws JshException
{ {
depotItemDao.findOrderByMaterial(pageUtil); depotItemDao.findOrderByMaterial(pageUtil);
} }
@@ -60,7 +60,7 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
* 导出Excel表格 * 导出Excel表格
*/ */
@Override @Override
public InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws AmsException public InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws JshException
{ {
try try
{ {
@@ -72,7 +72,7 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
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);
} }
} }

View File

@@ -1,12 +1,3 @@
/**
* 项 目 名HiTV
* 包 名com.suma.hitv.utils
* 文 件 名BeanFactoryUtil.java
* 版本信息V1.0
* 日 期2011-12-30-下午01:25:00
* Copyright (c) 2000-2011北京数码视讯有限公司版权所有
*
*/
package com.jsh.util.common; package com.jsh.util.common;
import java.util.HashMap; import java.util.HashMap;
@@ -19,7 +10,7 @@ import org.springframework.context.support.FileSystemXmlApplicationContext;
/** /**
* 获取spring配置中的bean对象,是单例,只会加载一次,请注意使用 * 获取spring配置中的bean对象,是单例,只会加载一次,请注意使用
* 注意此工具类默认处理UI组件WEB-INF目录下的applicationContext.xml配置文件,请注意文件 名和路径 * 注意此工具类默认处理UI组件WEB-INF目录下的applicationContext.xml配置文件,请注意文件 名和路径
* @author andy * @author jishenghua
* @version V1.0 * @version V1.0
*/ */
public class BeanFactoryUtil public class BeanFactoryUtil

View File

@@ -7,7 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 分页工具类,实现分页功能 * 分页工具类,实现分页功能
* @author andy * @author jishenghua
* @version [版本号version01, 2012-1-25] * @version [版本号version01, 2012-1-25]
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")

View File

@@ -8,7 +8,7 @@ import com.jsh.base.Log;
/** /**
* 获取应用系统路径 * 获取应用系统路径
* @author andy * @author jishenghua
*/ */
public class PathTool public class PathTool
{ {

View File

@@ -6,7 +6,7 @@ import java.util.Set;
/** /**
* 根据搜索条件拼装成查询hql语句 * 根据搜索条件拼装成查询hql语句
* @author andy * @author jishenghua
*/ */
public class SearchConditionUtil public class SearchConditionUtil
{ {

View File

@@ -14,8 +14,7 @@ import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.UUID; import java.util.UUID;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.math.BigInteger;
import sun.misc.BASE64Encoder;
public class Tools public class Tools
{ {
@@ -435,7 +434,7 @@ public class Tools
/** /**
* 判断字符串中是否含有中文 * 判断字符串中是否含有中文
* @author andy * @author jishenghua
* @param str * @param str
* @return * @return
*/ */
@@ -456,7 +455,7 @@ public class Tools
/** /**
* 去掉字符串中所有符号,不论是全角,还是半角的,或是货币符号或者空格等 * 去掉字符串中所有符号,不论是全角,还是半角的,或是货币符号或者空格等
* @author andy * @author jishenghua
* @param s * @param s
* @return * @return
* *
@@ -483,7 +482,11 @@ public class Tools
*/ */
public static String md5Encryp(String msg) throws NoSuchAlgorithmException public static String md5Encryp(String msg) throws NoSuchAlgorithmException
{ {
return new BASE64Encoder().encode(MessageDigest.getInstance("MD5").digest(msg.getBytes())); // 生成一个MD5加密计算摘要
MessageDigest md = MessageDigest.getInstance("MD5");
// 计算md5函数
md.update(msg.getBytes());
return new BigInteger(1, md.digest()).toString(16);
} }
/** /**
@@ -500,7 +503,7 @@ public class Tools
/** /**
* 使用参数Format将字符串转为Date * 使用参数Format将字符串转为Date
* @author andy * @author jishenghua
* @param strDate * @param strDate
* @param pattern * @param pattern
* @return * @return