增加-供应商对账报表

This commit is contained in:
季圣华
2017-10-29 23:46:13 +08:00
parent 2f14504b2a
commit f432351937
7 changed files with 383 additions and 12 deletions

View File

@@ -749,8 +749,16 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
String beginTime = model.getBeginTime();
String endTime = model.getEndTime();
Long organId = model.getOrganId();
String supType = model.getSupType(); //单位类型:客户、供应商
int j = 1;
if(supType.equals("客户")){ //客户
j = 1;
}
else if(supType.equals("供应商")){ //供应商
j = -1;
}
try{
depotHeadService.findStatementAccount(pageUtil, beginTime, endTime, organId);
depotHeadService.findStatementAccount(pageUtil, beginTime, endTime, organId, supType);
List dataList = pageUtil.getPageList();
JSONObject outer = new JSONObject();
outer.put("total", pageUtil.getTotalCount());
@@ -805,7 +813,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
}
item.put("discountLastMoney", p1); //金额
item.put("changeAmount", p2); //金额
item.put("allPrice", String .format("%.2f",allPrice)); //计算后的金额
item.put("allPrice", String .format("%.2f",allPrice*j)); //计算后的金额
item.put("supplierName", arr[4]); //供应商
item.put("operTime", arr[5]); //入库出库日期
dataArray.add(item);

View File

@@ -129,17 +129,17 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
@SuppressWarnings("unchecked")
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId) throws JshException {
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId,String supType) throws JshException {
StringBuffer queryString = new StringBuffer();
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh " +
"inner join jsh_supplier s on s.id=dh.OrganId where s.type!='会员' and dh.SubType!='其它' " +
"inner join jsh_supplier s on s.id=dh.OrganId where s.type='" + supType + "' and dh.SubType!='其它' " +
"and dh.OperTime >='"+ beginTime +"' and dh.OperTime<='"+ endTime +"' ");
if(organId!=null && !organId.equals("")) {
queryString.append(" and dh.OrganId='"+ organId +"' ");
}
queryString.append("UNION ALL " +
"select ah.BillNo,ah.Type as newType,ah.TotalPrice,ah.ChangeAmount,s.supplier,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah " +
"inner join jsh_supplier s on s.id=ah.OrganId where s.type!='会员' " +
"inner join jsh_supplier s on s.id=ah.OrganId where s.type='" + supType + "' " +
"and ah.BillTime >='"+ beginTime +"' and ah.BillTime<='"+ endTime +"' ");
if(organId!=null && !organId.equals("")) {
queryString.append(" and ah.OrganId='"+ organId +"' ");

View File

@@ -23,7 +23,7 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId) throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId, String supType) throws JshException;
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam) throws JshException;

View File

@@ -23,7 +23,7 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId)throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime, Long organId)throws JshException;
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime, Long organId, String supType)throws JshException;
public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam)throws JshException;
}

View File

@@ -50,8 +50,8 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
depotHeadDao.findMaterialsListByHeaderId(pageUtil, headerId);
}
public void findStatementAccount(PageUtil pageUtil,String beginTime,String endTime,Long organId) throws JshException {
depotHeadDao.findStatementAccount(pageUtil, beginTime, endTime, organId);
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) throws JshException {