出入库报表增加供应商的栏目
This commit is contained in:
parent
c6792564e3
commit
cdd06c3abf
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 );
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单位名称:</td>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
|
||||
@ -30,6 +30,11 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
@ -62,6 +67,8 @@
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var path = "<%=path %>";
|
||||
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@ -71,6 +78,7 @@
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList=null;
|
||||
var userdepot=null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
@ -79,9 +87,20 @@
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier(){
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField:'id',
|
||||
textField:'supplier',
|
||||
filter: function(q, row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) >-1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB(){
|
||||
@ -290,6 +309,7 @@
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
OrganId: $('#OrganId').combobox('getValue'),
|
||||
ProjectId: $.trim($("#searchProjectId").val()),
|
||||
DepotIds: depotString,
|
||||
BeginTime: $("#searchBeginTime").val(),
|
||||
|
||||
@ -30,6 +30,11 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
@ -62,6 +67,8 @@
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var path = "<%=path %>";
|
||||
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@ -71,6 +78,7 @@
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList=null;
|
||||
var userdepot=null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
@ -79,8 +87,20 @@
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier(){
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField:'id',
|
||||
textField:'supplier',
|
||||
filter: function(q, row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) >-1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB(){
|
||||
@ -193,6 +213,7 @@
|
||||
{ title: '商品名称',field: 'mName',width:150},
|
||||
{ title: '商品型号',field: 'Model',width:150},
|
||||
{ title: '商品类型',field: 'categoryName',width:120},
|
||||
{ title: '入库数量',field: 'numSum',width:120},
|
||||
{ title: '入库金额',field: 'priceSum',width:120}
|
||||
]],
|
||||
onLoadError:function()
|
||||
@ -284,6 +305,7 @@
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
OrganId: $('#OrganId').combobox('getValue'),
|
||||
ProjectId: $.trim($("#searchProjectId").val()),
|
||||
DepotIds: depotString,
|
||||
BeginTime: $("#searchBeginTime").val(),
|
||||
|
||||
@ -30,6 +30,11 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
@ -62,6 +67,8 @@
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var path = "<%=path %>";
|
||||
var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@ -71,6 +78,7 @@
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList=null;
|
||||
var userdepot=null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
@ -81,6 +89,18 @@
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier(){
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField:'id',
|
||||
textField:'supplier',
|
||||
filter: function(q, row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) >-1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB(){
|
||||
@ -196,7 +216,7 @@
|
||||
{ title: '单价',field: 'unitPrice',width:60},
|
||||
{ title: '出库数量',field: 'operNumber',width:60},
|
||||
{ title: '金额',field: 'allPrice',width:60},
|
||||
{ title: '供应商',field: 'supplierName',width:200},
|
||||
{ title: '客户',field: 'supplierName',width:200},
|
||||
{ title: '仓库',field: 'depotName',width:120},
|
||||
{ title: '出库日期',field: 'operTime',width:80},
|
||||
]],
|
||||
@ -289,6 +309,7 @@
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
OrganId: $('#OrganId').combobox('getValue'),
|
||||
ProjectId: $.trim($("#searchProjectId").val()),
|
||||
DepotIds: depotString,
|
||||
BeginTime: $("#searchBeginTime").val(),
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var uid = ${sessionScope.user.id};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@ -30,6 +30,11 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
@ -62,6 +67,8 @@
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var path = "<%=path %>";
|
||||
var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
@ -71,6 +78,7 @@
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList=null;
|
||||
var userdepot=null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
@ -79,8 +87,20 @@
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier(){
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField:'id',
|
||||
textField:'supplier',
|
||||
filter: function(q, row){
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) >-1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB(){
|
||||
@ -88,7 +108,7 @@
|
||||
type:"post",
|
||||
url: "<%=path %>/userBusiness/getBasicData.action",
|
||||
data: ({
|
||||
KeyId:kid,
|
||||
KeyId:uid,
|
||||
Type:"UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
@ -193,6 +213,7 @@
|
||||
{ title: '商品名称',field: 'mName',width:150},
|
||||
{ title: '商品型号',field: 'Model',width:150},
|
||||
{ title: '商品类型',field: 'categoryName',width:120},
|
||||
{ title: '出库数量',field: 'numSum',width:120},
|
||||
{ title: '出库金额',field: 'priceSum',width:120}
|
||||
]],
|
||||
onLoadError:function()
|
||||
@ -284,6 +305,7 @@
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
OrganId: $('#OrganId').combobox('getValue'),
|
||||
ProjectId: $.trim($("#searchProjectId").val()),
|
||||
DepotIds: depotString,
|
||||
BeginTime: $("#searchBeginTime").val(),
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单位名称:</td>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user