优化 礼品充值和礼品销售

This commit is contained in:
季圣华
2017-09-05 23:55:49 +08:00
parent d9a00b811c
commit 6a081353f7
6 changed files with 371 additions and 420 deletions

View File

@@ -723,9 +723,6 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
private Map<String,Object> getConditionHead_Gift_In() {
Map<String,Object> condition = new HashMap<String,Object>();
if(model.getProjectId()!=null) {
condition.put("AllocationProjectId_n_eq", model.getProjectId());
}
return condition;
}

View File

@@ -97,16 +97,16 @@ public class DepotItemDAO extends BaseDAO<DepotItem> implements DepotItemIDAO
//多表联查,多表连查此处用到了createSQLQuery可以随便写sql语句很方便
Query query;
StringBuffer queryString = new StringBuffer();
queryString.append("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and SubType='" + subType +"'");
queryString.append("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and jsh_depothead.SubType='" + subType +"'");
if(ProjectId!=null) {
if(type.equals("in")){
queryString.append(" and AllocationProjectId='" + ProjectId +"'"); //礼品充值时
queryString.append(" and jsh_depotitem.AnotherDepotId='" + ProjectId +"'"); //礼品充值时
}
else if(type.equals("out")){
queryString.append(" and DepotId='" + ProjectId +"'");
queryString.append(" and jsh_depotitem.DepotId='" + ProjectId +"'");
}
}
queryString.append(" and MaterialId ="+ MId);
queryString.append(" and jsh_depotitem.MaterialId ="+ MId);
query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());