Commit 546aa7ec authored by AlanGao's avatar AlanGao
Browse files

update

parent 35e9301b
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Mobile Tools for Java (J2ME) # Mobile Tools for Java (J2ME)
.mtj.tmp/ .mtj.tmp/
*.iml
# Package Files # # Package Files #
*.jar *.jar
*.war *.war
...@@ -12,5 +13,7 @@ ...@@ -12,5 +13,7 @@
hs_err_pid* hs_err_pid*
.idea .idea
/target
**/*.iml
package com.jsh.action.asset; package com.jsh.action.asset;
import java.util.HashMap;
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.util.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;
import com.jsh.util.JshException;
import com.jsh.util.PageUtil; import com.jsh.util.PageUtil;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class ReportAction extends BaseAction<ReportModel> public class ReportAction extends BaseAction<ReportModel> {
{
private ReportModel model = new ReportModel(); private ReportModel model = new ReportModel();
private ReportIService reportService; private ReportIService reportService;
/** /**
* 查找资产信息 * 查找资产信息
*
* @return * @return
*/ */
public String find() public String find() {
{ try {
try
{
PageUtil<Asset> pageUtil = new PageUtil<Asset>(); PageUtil<Asset> pageUtil = new PageUtil<Asset>();
pageUtil.setPageSize(0); pageUtil.setPageSize(0);
pageUtil.setCurPage(0); pageUtil.setCurPage(0);
pageUtil.setAdvSearch(getCondition()); pageUtil.setAdvSearch(getCondition());
String reportType = getReportType(new HashMap<String,Object>()); String reportType = getReportType(new HashMap<String, Object>());
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 (JshException e) {
catch (JshException e)
{
Log.errorFileSync(">>>>>>>>>查找资产信息异常", e); Log.errorFileSync(">>>>>>>>>查找资产信息异常", e);
model.getShowModel().setMsgTip("get report data exception"); model.getShowModel().setMsgTip("get report data exception");
} }
...@@ -43,20 +39,20 @@ public class ReportAction extends BaseAction<ReportModel> ...@@ -43,20 +39,20 @@ public class ReportAction extends BaseAction<ReportModel>
/** /**
* 拼接搜索条件 * 拼接搜索条件
*
* @return * @return
*/ */
private Map<String,Object> getCondition() private Map<String, Object> getCondition() {
{
/** /**
* 拼接搜索条件 * 拼接搜索条件
*/ */
Map<String,Object> condition = new HashMap<String,Object>(); Map<String, Object> condition = new HashMap<String, Object>();
condition.put("assetname.id_n_eq", model.getAssetNameID()); condition.put("assetname.id_n_eq", model.getAssetNameID());
condition.put("assetname.category.id_n_eq", model.getAssetCategoryID()); condition.put("assetname.category.id_n_eq", model.getAssetCategoryID());
condition.put("user.id_n_eq", model.getUsernameID()); condition.put("user.id_n_eq", model.getUsernameID());
condition.put("status_n_eq", model.getStatus()); condition.put("status_n_eq", model.getStatus());
condition.put("supplier.id_n_eq", model.getSupplierID()); condition.put("supplier.id_n_eq", model.getSupplierID());
condition.put("dataSum_s_order","desc"); condition.put("dataSum_s_order", "desc");
//拼接统计数据条件 //拼接统计数据条件
getReportType(condition); getReportType(condition);
return condition; return condition;
...@@ -64,10 +60,10 @@ public class ReportAction extends BaseAction<ReportModel> ...@@ -64,10 +60,10 @@ public class ReportAction extends BaseAction<ReportModel>
/** /**
* 获取统计条件 * 获取统计条件
*
* @param condition * @param condition
*/ */
private String getReportType(Map<String,Object> condition) private String getReportType(Map<String, Object> condition) {
{
// <option value="0">资产状态</option> // <option value="0">资产状态</option>
// <option value="1">资产类型</option> // <option value="1">资产类型</option>
// <option value="2">供应商</option> // <option value="2">供应商</option>
...@@ -76,8 +72,7 @@ public class ReportAction extends BaseAction<ReportModel> ...@@ -76,8 +72,7 @@ public class ReportAction extends BaseAction<ReportModel>
int reportType = model.getReportType(); int reportType = model.getReportType();
String reportTypeInfo = ""; String reportTypeInfo = "";
String reportTypeName = ""; String reportTypeName = "";
switch(reportType) switch (reportType) {
{
case 0: case 0:
condition.put("status_s_gb", "group"); condition.put("status_s_gb", "group");
reportTypeInfo = "status"; reportTypeInfo = "status";
...@@ -103,18 +98,19 @@ public class ReportAction extends BaseAction<ReportModel> ...@@ -103,18 +98,19 @@ public class ReportAction extends BaseAction<ReportModel>
reportTypeInfo = "user.id"; reportTypeInfo = "user.id";
reportTypeName = "user.username"; reportTypeName = "user.username";
break; break;
default:
break;
} }
return reportTypeInfo + "_" + reportTypeName; return reportTypeInfo + "_" + reportTypeName;
} }
//=========Spring注入以及model驱动公共方法=========== //=========Spring注入以及model驱动公共方法===========
public void setReportService(ReportIService reportService) public void setReportService(ReportIService reportService) {
{
this.reportService = reportService; this.reportService = reportService;
} }
@Override @Override
public ReportModel getModel() public ReportModel getModel() {
{
return model; return model;
} }
} }
...@@ -86,7 +86,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel> ...@@ -86,7 +86,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
depotHead.setDefaultNumber(allNewNumber); //初始编号,一直都从后台取值 depotHead.setDefaultNumber(allNewNumber); //初始编号,一直都从后台取值
depotHead.setOperPersonName(getUser().getUsername()); depotHead.setOperPersonName(getUser().getUsername());
depotHead.setCreateTime(new Timestamp(new Date().getTime())); depotHead.setCreateTime(new Timestamp(System.currentTimeMillis()));
try{ try{
depotHead.setOperTime(new Timestamp(Tools.parse(model.getOperTime(), "yyyy-MM-dd HH:mm:ss").getTime())); depotHead.setOperTime(new Timestamp(Tools.parse(model.getOperTime(), "yyyy-MM-dd HH:mm:ss").getTime()));
} }
......
...@@ -20,6 +20,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO { ...@@ -20,6 +20,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override
public void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException 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()));
...@@ -28,6 +29,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO { ...@@ -28,6 +29,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override
public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException
{ {
Query query; Query query;
...@@ -51,6 +53,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO { ...@@ -51,6 +53,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
query.executeUpdate(); query.executeUpdate();
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException { public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException {
StringBuffer queryString = new StringBuffer(); StringBuffer queryString = new StringBuffer();
...@@ -87,6 +90,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO { ...@@ -87,6 +90,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
pageUtil.setPageList(query.list()); pageUtil.setPageList(query.list());
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException { public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException {
StringBuffer queryString = new StringBuffer(); StringBuffer queryString = new StringBuffer();
...@@ -185,6 +189,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO { ...@@ -185,6 +189,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
pageUtil.setPageList(query.list()); pageUtil.setPageList(query.list());
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException { public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException {
StringBuffer queryString = new StringBuffer(); StringBuffer queryString = new StringBuffer();
......
package com.jsh.dao.materials; package com.jsh.dao.materials;
import com.jsh.base.BaseIDAO; import com.jsh.base.BaseIDAO;
import com.jsh.util.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness; import com.jsh.util.JshException;
import com.jsh.util.PageUtil; import com.jsh.util.PageUtil;
public interface DepotHeadIDAO extends BaseIDAO<DepotHead> public interface DepotHeadIDAO extends BaseIDAO<DepotHead> {
{
/* /*
* 获取MaxId * 获取MaxId
*/ */
void find(PageUtil<DepotHead> pageUtil,String maxid) throws JshException; void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException;
void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException; void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException;
public void batchSetStatus(Boolean status,String depotHeadIDs); void batchSetStatus(Boolean status, String depotHeadIDs);
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException; void findInDetail(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException;
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids, Long oId) throws JshException; void findInOutMaterialCount(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException; void findMaterialsListByHeaderId(PageUtil pageUtil, Long headerId) throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId, String supType) throws JshException; void findStatementAccount(PageUtil pageUtil, String beginTime, String endTime, Long organId, String supType) throws JshException;
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException; void getHeaderIdByMaterial(PageUtil pageUtil, String materialParam, String depotIds) throws JshException;
} }
...@@ -15,15 +15,15 @@ public interface DepotHeadIService extends BaseIService<DepotHead> ...@@ -15,15 +15,15 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
void findAllMoney(PageUtil<DepotHead> depotHead, Integer supplierId, String type, String subType, String mode)throws JshException; void findAllMoney(PageUtil<DepotHead> depotHead, Integer supplierId, String type, String subType, String mode)throws JshException;
public void batchSetStatus(Boolean status,String depotHeadIDs); void batchSetStatus(Boolean status,String depotHeadIDs);
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids,Long oId)throws JshException; void findInDetail(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids,Long oId)throws JshException;
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids,Long oId)throws JshException; void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids,Long oId)throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId)throws JshException; void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId)throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime, Long organId, String supType)throws JshException; void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime, Long organId, String supType)throws JshException;
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds)throws JshException; void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds)throws JshException;
} }
...@@ -2,13 +2,11 @@ package com.jsh.service.materials; ...@@ -2,13 +2,11 @@ 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.util.JshException;
import com.jsh.model.po.DepotHead; import com.jsh.model.po.DepotHead;
import com.jsh.model.po.UserBusiness; import com.jsh.util.JshException;
import com.jsh.util.PageUtil; import com.jsh.util.PageUtil;
public class DepotHeadService extends BaseService<DepotHead> implements DepotHeadIService public class DepotHeadService extends BaseService<DepotHead> implements DepotHeadIService {
{
@SuppressWarnings("unused") @SuppressWarnings("unused")
private DepotHeadIDAO depotHeadDao; private DepotHeadIDAO depotHeadDao;
...@@ -19,42 +17,47 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea ...@@ -19,42 +17,47 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
@Override @Override
protected Class<DepotHead> getEntityClass() protected Class<DepotHead> getEntityClass() {
{
return DepotHead.class; return DepotHead.class;
} }
public void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException @Override
{ public void find(PageUtil<DepotHead> pageUtil, String maxid) throws JshException {
depotHeadDao.find(pageUtil, maxid); depotHeadDao.find(pageUtil, maxid);
} }
public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException @Override
{ public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException {
depotHeadDao.findAllMoney(pageUtil, supplierId, type, subType, mode); depotHeadDao.findAllMoney(pageUtil, supplierId, type, subType, mode);
} }
public void batchSetStatus(Boolean status,String depotHeadIDs){ @Override
public void batchSetStatus(Boolean status, String depotHeadIDs) {
depotHeadDao.batchSetStatus(status, depotHeadIDs); depotHeadDao.batchSetStatus(status, depotHeadIDs);
} }
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException { @Override
depotHeadDao.findInDetail(pageUtil,beginTime,endTime,type,pid,dids,oId); public void findInDetail(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException {
depotHeadDao.findInDetail(pageUtil, beginTime, endTime, type, pid, dids, oId);
} }
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids,Long oId) throws JshException { @Override
depotHeadDao.findInOutMaterialCount(pageUtil,beginTime,endTime,type,pid,dids,oId); public void findInOutMaterialCount(PageUtil pageUtil, String beginTime, String endTime, String type, Long pid, String dids, Long oId) throws JshException {
depotHeadDao.findInOutMaterialCount(pageUtil, beginTime, endTime, type, pid, dids, oId);
} }
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException { @Override
public void findMaterialsListByHeaderId(PageUtil pageUtil, Long headerId) throws JshException {
depotHeadDao.findMaterialsListByHeaderId(pageUtil, headerId); depotHeadDao.findMaterialsListByHeaderId(pageUtil, headerId);
} }
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId, String supType) throws JshException { @Override
public void findStatementAccount(PageUtil pageUtil, String beginTime, String endTime, Long organId, String supType) throws JshException {
depotHeadDao.findStatementAccount(pageUtil, beginTime, endTime, organId, supType); depotHeadDao.findStatementAccount(pageUtil, beginTime, endTime, organId, supType);
} }
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam,String depotIds) throws JshException { @Override
public void getHeaderIdByMaterial(PageUtil pageUtil, String materialParam, String depotIds) throws JshException {
depotHeadDao.getHeaderIdByMaterial(pageUtil, materialParam, depotIds); depotHeadDao.getHeaderIdByMaterial(pageUtil, materialParam, depotIds);
} }
} }
stmp=smtp.126.com stmp=smtp.gaodonghua.com
emailname=accountnms@126.com emailname=alan@gaodonghua.com
password=public password=1QAZ2wsx
\ No newline at end of file \ No newline at end of file
jdbcUrl= jdbc\:mysql\://localhost\:3306/jsh_erp?useUnicode\=true&characterEncoding\=UTF-8 jdbcUrl= jdbc\:mysql\://mysql.gaodonghua.com\:13306/jsh_erp?useUnicode\=true&characterEncoding\=UTF-8
driverClass= com.mysql.jdbc.Driver driverClass= com.mysql.jdbc.Driver
user= root user= root
password=1234 password=Alan!@#
\ No newline at end of file \ No newline at end of file
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