更新供应商和客户的累计应收应付的算法

This commit is contained in:
季圣华
2017-04-09 16:52:02 +08:00
parent bd5deee8ba
commit 33bb4e06ef
29 changed files with 293 additions and 25 deletions

View File

@@ -22,11 +22,26 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO
}
@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()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
@SuppressWarnings("unchecked")
public void findAllMoney(PageUtil<DepotHead> pageUtil, Integer supplierId, String type, String subType, String mode) throws JshException
{
Query query;
String modeName = "";
if(mode.equals("实际")){
modeName = "ChangeAmount";
}
else if(mode.equals("合计")){
modeName = "TotalPrice";
}
query= this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum(" + modeName + ") as allMoney from DepotHead depotHead where Type='" + type + "' and SubType = '" + subType + "' and OrganId =" + supplierId + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setTotalCount(query.list().size());
pageUtil.setPageList(query.list());
}
}