单据列表增加商品信息展开功能

This commit is contained in:
季圣华
2017-09-11 00:25:57 +08:00
parent 7ec6035d1c
commit 3bbcef496f
7 changed files with 48 additions and 8 deletions

View File

@@ -427,6 +427,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
item.put("payType", depotHead.getPayType()==null?"":depotHead.getPayType());
item.put("Status", depotHead.getStatus());
item.put("Remark", depotHead.getRemark());
item.put("MaterialsList", findMaterialsListByHeaderId(depotHead.getId()));
item.put("op", 1);
dataArray.add(item);
}
@@ -684,6 +685,25 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询信息结果异常", e);
}
}
public String findMaterialsListByHeaderId(Long headerId){
String allReturn = "";
PageUtil pageUtil = new PageUtil();
pageUtil.setPageSize(0);
pageUtil.setCurPage(0);
try {
depotHeadService.findMaterialsListByHeaderId(pageUtil, headerId);
allReturn = pageUtil.getPageList().toString();
allReturn = allReturn.substring(1,allReturn.length()-1);
if(allReturn.equals("null")){
allReturn = "";
}
}
catch (JshException e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找信息异常", e);
}
return allReturn;
}
/**
* 拼接搜索条件

View File

@@ -115,4 +115,13 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
pageUtil.setPageList(query.list());
}
@SuppressWarnings("unchecked")
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException {
StringBuffer queryString = new StringBuffer();
queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model,' ',jsh_material.Mfrs)) as mName from jsh_depotitem inner join jsh_material " +
" on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId ="+ headerId);
Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
pageUtil.setPageList(query.list());
}
}

View File

@@ -20,5 +20,7 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException;
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException;
}

View File

@@ -20,4 +20,6 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids)throws JshException;
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids)throws JshException;
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId)throws JshException;
}

View File

@@ -45,4 +45,8 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
public void findInOutMaterialCount(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException {
depotHeadDao.findInOutMaterialCount(pageUtil,beginTime,endTime,type,pid,dids);
}
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException {
depotHeadDao.findMaterialsListByHeaderId(pageUtil, headerId);
}
}