出入库报表增加供应商的栏目

This commit is contained in:
季圣华
2017-12-05 23:31:57 +08:00
parent c6792564e3
commit cdd06c3abf
11 changed files with 143 additions and 29 deletions

View File

@@ -640,11 +640,12 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
pageUtil.setCurPage(model.getPageNo());
Long pid =model.getProjectId();
String dids =model.getDepotIds();
Long oId = model.getOrganId();
String beginTime = model.getBeginTime();
String endTime = model.getEndTime();
String type = model.getType();
try{
depotHeadService.findInDetail(pageUtil,beginTime,endTime,type,pid,dids);
depotHeadService.findInDetail(pageUtil,beginTime,endTime,type,pid,dids,oId);
List dataList = pageUtil.getPageList();
JSONObject outer = new JSONObject();
outer.put("total", pageUtil.getTotalCount());
@@ -688,11 +689,12 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
pageUtil.setCurPage(model.getPageNo());
Long pid =model.getProjectId();
String dids =model.getDepotIds();
Long oId = model.getOrganId();
String beginTime = model.getBeginTime();
String endTime = model.getEndTime();
String type = model.getType();
try{
depotHeadService.findInOutMaterialCount(pageUtil, beginTime, endTime, type, pid, dids);
depotHeadService.findInOutMaterialCount(pageUtil, beginTime, endTime, type, pid, dids, oId);
List dataList = pageUtil.getPageList();
JSONObject outer = new JSONObject();
outer.put("total", pageUtil.getTotalCount());
@@ -707,7 +709,8 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
item.put("mName", arr[1]); //商品名称
item.put("Model", arr[2]); //商品型号
item.put("categoryName", arr[3]); //商品类型
item.put("priceSum", arr[4]); //金额
item.put("numSum", arr[4]); //数量
item.put("priceSum", arr[5]); //金额
dataArray.add(item);
}
}

View File

@@ -52,7 +52,7 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
@SuppressWarnings("unchecked")
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) 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();
queryString.append("select dh.Number,m.`name`,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier,d.dName,date_format(dh.OperTime, '%Y-%m-%d') " +
"from jsh_depothead dh inner join jsh_depotitem di on di.HeaderId=dh.id " +
@@ -60,6 +60,9 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
"inner join jsh_supplier s on s.id=dh.OrganId " +
"inner join (select id,name as dName from jsh_depot) d on d.id=di.DepotId " +
"where dh.OperTime >='"+ beginTime +"' and dh.OperTime <='"+ endTime +"' ");
if(oId!=null){
queryString.append(" and dh.OrganId = "+ oId );
}
if(pid!=null){
queryString.append(" and di.DepotId=" + pid );
}
@@ -84,21 +87,44 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
@SuppressWarnings("unchecked")
public void findInOutMaterialCount(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,Long oId) throws JshException {
StringBuffer queryString = new StringBuffer();
queryString.append("select di.MaterialId, m.mName,m.Model,m.categoryName, "+
" (select sum(jsh_depotitem.AllPrice) priceSum from jsh_depothead INNER JOIN jsh_depotitem " +
"on jsh_depothead.id=jsh_depotitem.HeaderId where jsh_depotitem.MaterialId=di.MaterialId " +
" and jsh_depothead.type='"+ type +"' and dh.OperTime >='"+ beginTime +"' and dh.OperTime <='"+ endTime +"'");
queryString.append("select di.MaterialId, m.mName,m.Model,m.categoryName, ");
//数量汇总
queryString.append(" (select sum(jdi.BasicNumber) numSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
" and jdh.type='"+ type +"' and jdh.OperTime >='"+ beginTime +"' and jdh.OperTime <='"+ endTime +"'");
if(oId!=null){
queryString.append(" and jdh.OrganId = "+ oId );
}
if(pid!=null){
queryString.append(" and di.DepotId=" + pid );
queryString.append(" and jdi.DepotId=" + pid );
}
else {
queryString.append(" and di.DepotId in (" + dids + ")" );
queryString.append(" and jdi.DepotId in (" + dids + ")" );
}
queryString.append(" ) priceSum from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId " +
queryString.append(" ) numSum, ");
//金额汇总
queryString.append(" (select sum(jdi.AllPrice) priceSum from jsh_depothead jdh INNER JOIN jsh_depotitem jdi " +
"on jdh.id=jdi.HeaderId where jdi.MaterialId=di.MaterialId " +
" and jdh.type='"+ type +"' and jdh.OperTime >='"+ beginTime +"' and jdh.OperTime <='"+ endTime +"'");
if(oId!=null){
queryString.append(" and jdh.OrganId = "+ oId );
}
if(pid!=null){
queryString.append(" and jdi.DepotId=" + pid );
}
else {
queryString.append(" and jdi.DepotId in (" + dids + ")" );
}
queryString.append(" ) priceSum ");
queryString.append(" from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId " +
" INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName from jsh_material INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id) m " +
" on m.Id=di.MaterialId where dh.type='"+ type +"' and dh.OperTime >='"+ beginTime +"' and dh.OperTime <='"+ endTime +"' ");
if(oId!=null){
queryString.append(" and dh.OrganId = "+ oId );
}
if(pid!=null){
queryString.append(" and di.DepotId=" + pid );
}

View File

@@ -17,9 +17,9 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
public void batchSetStatus(Boolean status,String depotHeadIDs);
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException;
public 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) throws JshException;
public 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;

View File

@@ -17,9 +17,9 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
public void batchSetStatus(Boolean status,String depotHeadIDs);
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime, String type, Long pid,String dids)throws JshException;
public 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)throws JshException;
public 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;

View File

@@ -38,12 +38,12 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
depotHeadDao.batchSetStatus(status, depotHeadIDs);
}
public void findInDetail(PageUtil pageUtil,String beginTime,String endTime,String type,Long pid,String dids) throws JshException {
depotHeadDao.findInDetail(pageUtil,beginTime,endTime,type,pid,dids);
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) throws JshException {
depotHeadDao.findInOutMaterialCount(pageUtil,beginTime,endTime,type,pid,dids);
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 {