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

update

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