整理代码

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>
</property>
<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>
</column>
</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.Log;
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.Assetname;
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);
}

View File

@ -5,7 +5,7 @@ import java.util.Map;
import com.jsh.base.BaseAction;
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.vo.asset.ReportModel;
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]);
model.getShowModel().setReportData(pageUtil.getPageList());
}
catch (AmsException e)
catch (JshException e)
{
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
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.Log;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.App;
import com.jsh.model.po.Logdetails;
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.Log;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.Depot;
import com.jsh.model.po.Logdetails;
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.Log;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.App;
import com.jsh.model.po.Functions;
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.Log;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.App;
import com.jsh.model.po.Role;
import com.jsh.model.po.Logdetails;

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@ import com.jsh.util.common.PageUtil;
/**
* 常用增删改查操作
* @author andy
* @author jishenghua
* @param <T>
*/
public interface BaseIDAO<T>

View File

@ -7,7 +7,7 @@ import java.util.Map;
import org.springframework.dao.DataAccessException;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.Basicuser;
import com.jsh.util.common.PageUtil;

View File

@ -4,7 +4,7 @@ import org.apache.log4j.Logger;
/**
* 封装log4j日志信息打印日志信息类
* @author andy
* @author jishenghua
* @since 2014-01-22
*/
public class Log

View File

@ -2,13 +2,13 @@ package com.jsh.constants.asset;
/**
* 定义资产管理常量
* @author andy
* @author jishenghua
*/
public interface AssetConstants
{
/**
* 公共常量
* @author andy
* @author jishenghua
*/
public class Common
{
@ -17,7 +17,7 @@ public interface AssetConstants
/**
* 资产常量--导入导出excel表格业务相关
* @author andy
* @author jishenghua
*/
public class BusinessForExcel
{

View File

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

View File

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

View File

@ -3,7 +3,7 @@ package com.jsh.dao.asset;
import org.hibernate.Query;
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.util.common.PageUtil;
import com.jsh.util.common.SearchConditionUtil;
@ -12,7 +12,7 @@ public class ReportDAO extends HibernateDaoSupport implements ReportIDAO
{
@SuppressWarnings("unchecked")
@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()));
pageUtil.setTotalCount(query.list().size());

View File

@ -1,6 +1,6 @@
package com.jsh.dao.asset;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil;
@ -10,7 +10,7 @@ public interface ReportIDAO
* 查找资产列表
* @param pageUtil 分页工具类
* @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 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.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -23,7 +23,7 @@ public class UserBusinessDAO extends BaseDAO<UserBusiness> implements UserBusine
@SuppressWarnings("unchecked")
@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()));
pageUtil.setTotalCount(query.list().size());

View File

@ -1,7 +1,7 @@
package com.jsh.dao.basic;
import com.jsh.base.BaseIDAO;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -10,5 +10,5 @@ public interface UserBusinessIDAO extends BaseIDAO<UserBusiness>
/*
* 测试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 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.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -23,7 +23,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO
@SuppressWarnings("unchecked")
@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()));
pageUtil.setTotalCount(query.list().size());

View File

@ -1,7 +1,7 @@
package com.jsh.dao.materials;
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.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -11,5 +11,5 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
/*
* 获取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 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.DepotItem;
import com.jsh.util.common.PageUtil;
@ -23,7 +23,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
@SuppressWarnings("unchecked")
@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语句很方便
Query query;
@ -40,7 +40,7 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
@SuppressWarnings("unchecked")
@Override
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws AmsException
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws JshException
{
//多表联查,多表连查此处用到了createSQLQuery可以随便写sql语句很方便
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;
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.DepotItem;
import com.jsh.util.common.PageUtil;
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: 平台异常基类
* @description: 用于包装一些异常信息打印日志等服务
* @author andy
* @author jishenghua
* @since: 2014-01-24
*/
@SuppressWarnings("serial")
public class AmsException extends Exception
public class JshException extends Exception
{
public long errorCode = -1;
public String message ;
public AmsException()
public JshException()
{
super();
}
public AmsException(String message)
public JshException(String message)
{
super(message);
this.message = message;
}
public AmsException(String message, Throwable cause)
public JshException(String message, Throwable cause)
{
super(message, cause);
this.message = message;
}
public AmsException(Throwable cause)
public JshException(Throwable cause)
{
super(cause);
}
public AmsException(long errorCode)
public JshException(long errorCode)
{
super();
this.errorCode = errorCode;
}
public AmsException(String message, long errorCode)
public JshException(String message, long errorCode)
{
super(message);
this.errorCode = errorCode;
this.message = message;
}
public AmsException(String message, long errorCode, Throwable cause)
public JshException(String message, long errorCode, Throwable cause)
{
super(message, cause);
this.errorCode = errorCode;
this.message = message;
}
public AmsException(long errorCode, Throwable cause)
public JshException(long errorCode, Throwable cause)
{
super(cause);
this.errorCode = errorCode;

View File

@ -15,7 +15,7 @@ import javax.servlet.http.HttpSession;
/**
* 用户登录session处理类
* 过滤session是否超时
* @author andy
* @author jishenghua
* @version [版本号, 2012-3-6]
* @see [相关类/方法]
* @since

View File

@ -18,7 +18,7 @@
</column>
</property>
<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>
</column>
</property>

View File

@ -1,7 +1,6 @@
package com.jsh.model.vo.materials;
import java.io.Serializable;
import com.sun.jmx.snmp.Timestamp;
@SuppressWarnings("serial")
public class DepotHeadModel implements Serializable

View File

@ -4,7 +4,7 @@ import java.io.File;
import java.io.InputStream;
import com.jsh.base.BaseIService;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil;
@ -14,7 +14,7 @@ public interface AssetIService extends BaseIService<Asset>
* 导出信息
* @return
*/
InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws AmsException;
InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws JshException;
/**
* 导入资产excel文件--表格格式 媒资列表 || 资产名称-资产类型-单价-用户-购买时间-状态-位置-资产编号-序列号-有效日期-保修日期-供应商-标签-描述
@ -24,7 +24,7 @@ public interface AssetIService extends BaseIService<Asset>
* @param assetFile excel表格文件
* @param isCheck 是否检查 0--手工确定 1--直接导入数据库中
* @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.SupplierIDAO;
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.Assetname;
import com.jsh.model.po.Category;
@ -74,7 +74,7 @@ public class AssetService extends BaseService<Asset> implements AssetIService
* 导出Excel表格
*/
@Override
public InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws AmsException
public InputStream exmportExcel(String isAllPage,PageUtil<Asset> pageUtil)throws JshException
{
try
{
@ -97,12 +97,12 @@ public class AssetService extends BaseService<Asset> implements AssetIService
catch (Exception 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
public InputStream importExcel(File assetFile,int isCheck) throws AmsException
public InputStream importExcel(File assetFile,int isCheck) throws JshException
{
//全局变量--每次调用前需要清空数据
mapData.clear();
@ -129,10 +129,10 @@ public class AssetService extends BaseService<Asset> implements AssetIService
/**
* 初始加载系统基础数据--导入过程中不用频繁查询数据库内容影响系统性能
* @throws AmsException
* @throws JshException
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private void loadSystemData()throws AmsException
private void loadSystemData()throws JshException
{
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);

View File

@ -1,6 +1,6 @@
package com.jsh.service.asset;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.Asset;
import com.jsh.util.common.PageUtil;
@ -9,7 +9,7 @@ public interface ReportIService
/**
* 查找报表数据
* @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;
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.util.common.PageUtil;
@ -15,7 +15,7 @@ public class ReportService implements ReportIService
}
@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);
}

View File

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

View File

@ -1,7 +1,7 @@
package com.jsh.service.basic;
import com.jsh.base.BaseIService;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -10,6 +10,6 @@ public interface UserBusinessIService extends BaseIService<UserBusiness>
/*
* 测试一下自定义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.dao.basic.UserBusinessIDAO;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -23,7 +23,7 @@ public class UserBusinessService extends BaseService<UserBusiness> implements Us
}
@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);
}

View File

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

View File

@ -1,7 +1,7 @@
package com.jsh.service.materials;
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.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -11,5 +11,5 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
/*
* 获取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.dao.materials.DepotHeadIDAO;
import com.jsh.exception.AmsException;
import com.jsh.exception.JshException;
import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness;
import com.jsh.util.common.PageUtil;
@ -25,7 +25,7 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
}
@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);
}

View File

@ -6,7 +6,7 @@ import java.util.List;
import net.sf.json.JSONArray;
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.DepotHead;
import com.jsh.model.po.DepotItem;
@ -14,13 +14,13 @@ import com.jsh.util.common.PageUtil;
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
*/
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.constants.asset.AssetConstants;
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.DepotHead;
import com.jsh.model.po.DepotItem;
@ -45,13 +45,13 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
}
@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);
}
@Override
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws AmsException
public void findOrderByMaterial(PageUtil<DepotItem> pageUtil) throws JshException
{
depotItemDao.findOrderByMaterial(pageUtil);
}
@ -60,7 +60,7 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
* 导出Excel表格
*/
@Override
public InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws AmsException
public InputStream exmportExcel(String isAllPage,JSONArray dataArray)throws JshException
{
try
{
@ -72,7 +72,7 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
catch (Exception 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;
import java.util.HashMap;
@ -19,7 +10,7 @@ import org.springframework.context.support.FileSystemXmlApplicationContext;
/**
* 获取spring配置中的bean对象,是单例只会加载一次请注意使用
* 注意此工具类默认处理UI组件WEB-INF目录下的applicationContext.xml配置文件,请注意文件 名和路径
* @author andy
* @author jishenghua
* @version V1.0
*/
public class BeanFactoryUtil

View File

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

View File

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

View File

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

View File

@ -14,8 +14,7 @@ import java.util.Date;
import java.util.Locale;
import java.util.UUID;
import java.util.regex.Pattern;
import sun.misc.BASE64Encoder;
import java.math.BigInteger;
public class Tools
{
@ -435,7 +434,7 @@ public class Tools
/**
* 判断字符串中是否含有中文
* @author andy
* @author jishenghua
* @param str
* @return
*/
@ -456,7 +455,7 @@ public class Tools
/**
* 去掉字符串中所有符号不论是全角还是半角的或是货币符号或者空格等
* @author andy
* @author jishenghua
* @param s
* @return
*
@ -483,7 +482,11 @@ public class Tools
*/
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
* @author andy
* @author jishenghua
* @param strDate
* @param pattern
* @return