优化报表的查询条件

This commit is contained in:
季圣华
2020-12-28 23:36:38 +08:00
parent 0e91d84c39
commit 70ecb4df75
16 changed files with 142 additions and 157 deletions

View File

@@ -30,15 +30,9 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label">名称</label> <label class="control-label">商品信息</label>
<div class="control-inline"> <div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input> <input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">型号:</label>
<div class="control-inline">
<input type="text" name="mModel" id="mModel" class="easyui-textbox" style="width:100px;"></input>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -55,7 +49,6 @@
$(function () { $(function () {
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate); $("#searchMonth").val(thisDate);
initMaterialNameList();
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
initTableData(); initTableData();
ininPager(); ininPager();
@@ -63,21 +56,6 @@
print(); print();
}); });
//初始化商品名称模糊匹配
function initMaterialNameList() {
$('#mName').combobox({
method:"get",
url: "/material/getMaterialNameList",
valueField: 'value',
textField: 'text',
hasDownArrow: false,
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
}
});
}
//初始化商品属性 //初始化商品属性
function initMProperty() { function initMProperty() {
$.ajax({ $.ajax({
@@ -222,8 +200,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
monthTime: $("#searchMonth").val(), monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"), materialParam: $.trim($("#searchMaterial").val()),
model: $("#mModel").textbox("getValue"),
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (res) { success: function (res) {

View File

@@ -36,6 +36,12 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select> <select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">商品信息:</label>
<div class="control-inline">
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label">单据日期:</label> <label class="control-label">单据日期:</label>
<div class="control-inline"> <div class="control-inline">
@@ -282,6 +288,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'), organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()), projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString, depotIds: depotString,
beginTime: $("#searchBeginTime").val(), beginTime: $("#searchBeginTime").val(),

View File

@@ -34,6 +34,12 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select> <select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">商品信息:</label>
<div class="control-inline">
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label">单据日期:</label> <label class="control-label">单据日期:</label>
<div class="control-inline"> <div class="control-inline">
@@ -271,6 +277,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'), organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()), projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString, depotIds: depotString,
beginTime: $("#searchBeginTime").val(), beginTime: $("#searchBeginTime").val(),

View File

@@ -29,15 +29,9 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label">名称</label> <label class="control-label">商品信息</label>
<div class="control-inline"> <div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input> <input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">型号:</label>
<div class="control-inline">
<input type="text" name="mModel" id="mModel" class="easyui-textbox" style="width:100px;"></input>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -72,7 +66,6 @@
initSelectInfo_UB(); initSelectInfo_UB();
initSystemData_depot(); initSystemData_depot();
initSelectInfo_depot(); initSelectInfo_depot();
initMaterialNameList();
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
initTableData(); initTableData();
ininPager(); ininPager();
@@ -166,21 +159,6 @@
} }
} }
//初始化商品名称模糊匹配
function initMaterialNameList() {
$('#mName').combobox({
method:"get",
url: "/material/getMaterialNameList",
valueField: 'value',
textField: 'text',
hasDownArrow: false,
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
}
});
}
//初始化商品属性 //初始化商品属性
function initMProperty() { function initMProperty() {
$.ajax({ $.ajax({
@@ -324,8 +302,7 @@
+ "&currentPage=" + pageNo + "&pageSize=" + pageSize + "&currentPage=" + pageNo + "&pageSize=" + pageSize
+ "&depotId=" + $.trim($("#searchProjectId").val()) + "&depotId=" + $.trim($("#searchProjectId").val())
+ "&monthTime=" + $("#searchMonth").val() + "&monthTime=" + $("#searchMonth").val()
+ "&name=" + $("#mName").combobox("getValue") + "&materialParam=" + $.trim($("#searchMaterial").val());
+ "&model=" + $("#mModel").textbox("getValue");
} }
else { else {
$.ajax({ $.ajax({
@@ -337,8 +314,7 @@
pageSize: pageSize, pageSize: pageSize,
depotId: $.trim($("#searchProjectId").val()), depotId: $.trim($("#searchProjectId").val()),
monthTime: $("#searchMonth").val(), monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"), materialParam: $.trim($("#searchMaterial").val()),
model: $("#mModel").textbox("getValue"),
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (res) { success: function (res) {
@@ -361,8 +337,7 @@
data: ({ data: ({
depotId: $.trim($("#searchProjectId").val()), depotId: $.trim($("#searchProjectId").val()),
monthTime: $("#searchMonth").val(), monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"), materialParam: $.trim($("#searchMaterial").val())
model: $("#mModel").textbox("getValue")
}), }),
success: function (res) { success: function (res) {
if(res && res.code === 200) { if(res && res.code === 200) {

View File

@@ -36,6 +36,12 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select> <select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">商品信息:</label>
<div class="control-inline">
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label">单据日期:</label> <label class="control-label">单据日期:</label>
<div class="control-inline"> <div class="control-inline">
@@ -282,6 +288,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'), organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()), projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString, depotIds: depotString,
beginTime: $("#searchBeginTime").val(), beginTime: $("#searchBeginTime").val(),

View File

@@ -34,6 +34,12 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select> <select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">商品信息:</label>
<div class="control-inline">
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label">单据日期:</label> <label class="control-label">单据日期:</label>
<div class="control-inline"> <div class="control-inline">
@@ -271,6 +277,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'), organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()), projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString, depotIds: depotString,
beginTime: $("#searchBeginTime").val(), beginTime: $("#searchBeginTime").val(),

View File

@@ -30,15 +30,9 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label">名称</label> <label class="control-label">商品信息</label>
<div class="control-inline"> <div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input> <input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
<label class="control-label">型号:</label>
<div class="control-inline">
<input type="text" name="mModel" id="mModel" class="easyui-textbox" style="width:100px;"></input>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -59,7 +53,6 @@
$("#searchTable .tip").css("padding-left", "15px").css("color", "red"); $("#searchTable .tip").css("padding-left", "15px").css("color", "red");
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate); $("#searchMonth").val(thisDate);
initMaterialNameList();
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
initTableData(); initTableData();
ininPager(); ininPager();
@@ -67,21 +60,6 @@
print(); print();
}); });
//初始化商品名称模糊匹配
function initMaterialNameList() {
$('#mName').combobox({
method:"get",
url: "/material/getMaterialNameList",
valueField: 'value',
textField: 'text',
hasDownArrow: false,
filter: function(q, row){
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
}
});
}
//初始化商品属性 //初始化商品属性
function initMProperty() { function initMProperty() {
$.ajax({ $.ajax({
@@ -229,8 +207,7 @@
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
monthTime: $("#searchMonth").val(), monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"), materialParam: $.trim($("#searchMaterial").val()),
model: $("#mModel").textbox("getValue"),
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (res) { success: function (res) {

View File

@@ -28,6 +28,12 @@
<select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select> <select name="searchProjectId" id="searchProjectId" style="width:100px;height: 30px;border: 1px solid #d3d3d3;border-radius:5px;"></select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">商品信息:</label>
<div class="control-inline">
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="exprotBtn">导出</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="exprotBtn">导出</a>
@@ -291,6 +297,7 @@
data: ({ data: ({
currentPage: pageNo, currentPage: pageNo,
pageSize: pageSize, pageSize: pageSize,
materialParam: $.trim($("#searchMaterial").val()),
projectId : $.trim($("#searchProjectId").val()), projectId : $.trim($("#searchProjectId").val()),
mpList: mPropertyList mpList: mPropertyList
}), }),
@@ -299,6 +306,7 @@
if (pageSize === 3000) { if (pageSize === 3000) {
window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs() window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs()
+ "&currentPage=" + pageNo + "&pageSize=" + pageSize + "&currentPage=" + pageNo + "&pageSize=" + pageSize
+ "&materialParam=" + $.trim($("#searchMaterial").val())
+ "&projectId=" + $.trim($("#searchProjectId").val()) + "&projectId=" + $.trim($("#searchProjectId").val())
+ "&mpList=" + mPropertyList; + "&mpList=" + mPropertyList;
} }

View File

@@ -104,6 +104,7 @@ public class DepotHeadController {
public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId, @RequestParam("organId") Integer oId,
@RequestParam("materialParam") String materialParam,
@RequestParam("projectId") Integer pid, @RequestParam("projectId") Integer pid,
@RequestParam("depotIds") String dids, @RequestParam("depotIds") String dids,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@@ -114,8 +115,8 @@ public class DepotHeadController {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
List<DepotHeadVo4InDetail> resList = new ArrayList<DepotHeadVo4InDetail>(); List<DepotHeadVo4InDetail> resList = new ArrayList<DepotHeadVo4InDetail>();
List<DepotHeadVo4InDetail> list = depotHeadService.findByAll(beginTime, endTime, type, pid, dids, oId, (currentPage-1)*pageSize, pageSize); List<DepotHeadVo4InDetail> list = depotHeadService.findByAll(beginTime, endTime, type, materialParam, pid, dids, oId, (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findByAllCount(beginTime, endTime, type, pid, dids, oId); int total = depotHeadService.findByAllCount(beginTime, endTime, type, materialParam, pid, dids, oId);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
if (null != list) { if (null != list) {
@@ -151,6 +152,7 @@ public class DepotHeadController {
public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("organId") Integer oId, @RequestParam("organId") Integer oId,
@RequestParam("materialParam") String materialParam,
@RequestParam("projectId") Integer pid, @RequestParam("projectId") Integer pid,
@RequestParam("depotIds") String dids, @RequestParam("depotIds") String dids,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@@ -161,8 +163,8 @@ public class DepotHeadController {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
List<DepotHeadVo4InOutMCount> resList = new ArrayList<DepotHeadVo4InOutMCount>(); List<DepotHeadVo4InOutMCount> resList = new ArrayList<DepotHeadVo4InOutMCount>();
List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, pid, dids, oId, (currentPage-1)*pageSize, pageSize); List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, materialParam, pid, dids, oId, (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, pid, dids, oId); int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, pid, dids, oId);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
if (null != list) { if (null != list) {

View File

@@ -225,8 +225,7 @@ public class DepotItemController {
* @param pageSize * @param pageSize
* @param depotId * @param depotId
* @param monthTime * @param monthTime
* @param name * @param materialParam
* @param model
* @param mpList * @param mpList
* @param request * @param request
* @return * @return
@@ -237,8 +236,7 @@ public class DepotItemController {
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("name") String name, @RequestParam("materialParam") String materialParam,
@RequestParam("model") String model,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
@@ -247,10 +245,10 @@ public class DepotItemController {
String timeA = monthTime+"-01 00:00:00"; String timeA = monthTime+"-01 00:00:00";
String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try { try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model), List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
timeB,(currentPage-1)*pageSize, pageSize); timeB,(currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(","); String[] mpArr = mpList.split(",");
int total = depotItemService.findByAllCount(StringUtil.toNull(name), StringUtil.toNull(model), timeB); int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), timeB);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
@@ -306,8 +304,7 @@ public class DepotItemController {
* @param pageSize * @param pageSize
* @param depotId * @param depotId
* @param monthTime * @param monthTime
* @param name * @param materialParam
* @param model
* @param request * @param request
* @param response * @param response
* @return * @return
@@ -317,14 +314,13 @@ public class DepotItemController {
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId, @RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("name") String name, @RequestParam("materialParam") String materialParam,
@RequestParam("model") String model,
HttpServletRequest request, HttpServletResponse response) throws Exception { HttpServletRequest request, HttpServletResponse response) throws Exception {
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString()); Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
String timeA = monthTime+"-01 00:00:00"; String timeA = monthTime+"-01 00:00:00";
String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try { try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model), List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
timeB, (currentPage-1)*pageSize, pageSize); timeB, (currentPage-1)*pageSize, pageSize);
//存放数据json数组 //存放数据json数组
String[] names = {"名称", "规格", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"}; String[] names = {"名称", "规格", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
@@ -359,23 +355,21 @@ public class DepotItemController {
* 统计总计金额 * 统计总计金额
* @param depotId * @param depotId
* @param monthTime * @param monthTime
* @param name * @param materialParam
* @param model
* @param request * @param request
* @return * @return
*/ */
@PostMapping(value = "/totalCountMoney") @PostMapping(value = "/totalCountMoney")
public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId, public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("name") String name, @RequestParam("materialParam") String materialParam,
@RequestParam("model") String model, HttpServletRequest request) throws Exception{
HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString()); Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try { try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model), List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
endTime, null, null); endTime, null, null);
BigDecimal thisAllPrice = BigDecimal.ZERO; BigDecimal thisAllPrice = BigDecimal.ZERO;
if (null != dataList) { if (null != dataList) {
@@ -402,28 +396,26 @@ public class DepotItemController {
* @param currentPage * @param currentPage
* @param pageSize * @param pageSize
* @param monthTime * @param monthTime
* @param name * @param materialParam
* @param model
* @param mpList * @param mpList
* @param request * @param request
* @return * @return
*/ */
@PostMapping(value = "/buyIn") @PostMapping(value = "/buyIn")
public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("name") String name, @RequestParam("materialParam") String materialParam,
@RequestParam("model") String model, @RequestParam("mpList") String mpList,
@RequestParam("mpList") String mpList, HttpServletRequest request)throws Exception {
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try { try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model), List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
endTime, (currentPage-1)*pageSize, pageSize); endTime, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(","); String[] mpArr = mpList.split(",");
int total = depotItemService.findByAllCount(StringUtil.toNull(name), StringUtil.toNull(model), endTime); int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), endTime);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
@@ -466,8 +458,7 @@ public class DepotItemController {
* @param currentPage * @param currentPage
* @param pageSize * @param pageSize
* @param monthTime * @param monthTime
* @param name * @param materialParam
* @param model
* @param mpList * @param mpList
* @param request * @param request
* @return * @return
@@ -476,18 +467,17 @@ public class DepotItemController {
public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime, @RequestParam("monthTime") String monthTime,
@RequestParam("name") String name, @RequestParam("materialParam") String materialParam,
@RequestParam("model") String model,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59"; String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try { try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model), List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
endTime,(currentPage-1)*pageSize, pageSize); endTime,(currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(","); String[] mpArr = mpList.split(",");
int total = depotItemService.findByAllCount(StringUtil.toNull(name), StringUtil.toNull(model), endTime); int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), endTime);
map.put("total", total); map.put("total", total);
//存放数据json数组 //存放数据json数组
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
@@ -575,13 +565,14 @@ public class DepotItemController {
@GetMapping(value = "/findStockWarningCount") @GetMapping(value = "/findStockWarningCount")
public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("materialParam") String materialParam,
@RequestParam("projectId") Integer pid, @RequestParam("projectId") Integer pid,
@RequestParam("mpList") String mpList)throws Exception { @RequestParam("mpList") String mpList)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
String[] mpArr = mpList.split(","); String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,pid); List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,materialParam,pid);
//存放数据json数组 //存放数据json数组
if (null != list) { if (null != list) {
for (DepotItemStockWarningCount disw : list) { for (DepotItemStockWarningCount disw : list) {
@@ -594,7 +585,7 @@ public class DepotItemController {
disw.setMaterialUnit(getUName(disw.getMaterialUnit(), disw.getUnitName())); disw.setMaterialUnit(getUName(disw.getMaterialUnit(), disw.getUnitName()));
} }
} }
int total = depotItemService.findStockWarningCountTotal(pid); int total = depotItemService.findStockWarningCountTotal(materialParam,pid);
map.put("total", total); map.put("total", total);
map.put("rows", list); map.put("rows", list);
res.code = 200; res.code = 200;
@@ -618,6 +609,7 @@ public class DepotItemController {
@GetMapping(value = "/exportWarningExcel") @GetMapping(value = "/exportWarningExcel")
public BaseResponseInfo exportWarningExcel(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo exportWarningExcel(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam("materialParam") String materialParam,
@RequestParam("projectId") Integer projectId, @RequestParam("projectId") Integer projectId,
@RequestParam("mpList") String mpList, @RequestParam("mpList") String mpList,
HttpServletRequest request, HttpServletResponse response)throws Exception { HttpServletRequest request, HttpServletResponse response)throws Exception {
@@ -626,7 +618,7 @@ public class DepotItemController {
String message = "成功"; String message = "成功";
try { try {
String[] mpArr = mpList.split(","); String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, projectId); List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, materialParam, projectId);
//存放数据json数组 //存放数据json数组
Integer pid = projectId; Integer pid = projectId;
String[] names = {"名称", "规格", "型号", "扩展信息", "单位", "安全存量", "当前库存", "建议入库量"}; String[] names = {"名称", "规格", "型号", "扩展信息", "单位", "安全存量", "当前库存", "建议入库量"};

View File

@@ -49,6 +49,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("materialParam") String materialParam,
@Param("pid") Integer pid, @Param("pid") Integer pid,
@Param("dids") String dids, @Param("dids") String dids,
@Param("oId") Integer oId, @Param("oId") Integer oId,
@@ -59,6 +60,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("materialParam") String materialParam,
@Param("pid") Integer pid, @Param("pid") Integer pid,
@Param("dids") String dids, @Param("dids") String dids,
@Param("oId") Integer oId); @Param("oId") Integer oId);
@@ -67,6 +69,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("materialParam") String materialParam,
@Param("pid") Integer pid, @Param("pid") Integer pid,
@Param("dids") String dids, @Param("dids") String dids,
@Param("oId") Integer oId, @Param("oId") Integer oId,
@@ -77,6 +80,7 @@ public interface DepotHeadMapperEx {
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("type") String type, @Param("type") String type,
@Param("materialParam") String materialParam,
@Param("pid") Integer pid, @Param("pid") Integer pid,
@Param("dids") String dids, @Param("dids") String dids,
@Param("oId") Integer oId); @Param("oId") Integer oId);

View File

@@ -40,15 +40,13 @@ public interface DepotItemMapperEx {
@Param("headerId") Long headerId); @Param("headerId") Long headerId);
List<DepotItemVo4WithInfoEx> findByAll( List<DepotItemVo4WithInfoEx> findByAll(
@Param("name") String name, @Param("materialParam") String materialParam,
@Param("model") String model,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows); @Param("rows") Integer rows);
int findByAllCount( int findByAllCount(
@Param("name") String name, @Param("materialParam") String materialParam,
@Param("model") String model,
@Param("endTime") String endTime); @Param("endTime") String endTime);
BigDecimal buyOrSaleNumber( BigDecimal buyOrSaleNumber(
@@ -108,8 +106,13 @@ public interface DepotItemMapperEx {
List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds); List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds);
List<DepotItemStockWarningCount> findStockWarningCount(@Param("offset") Integer offset, List<DepotItemStockWarningCount> findStockWarningCount(
@Param("rows") Integer rows, @Param("pid") Integer pid); @Param("offset") Integer offset,
@Param("rows") Integer rows,
@Param("materialParam") String materialParam,
@Param("pid") Integer pid);
int findStockWarningCountTotal( @Param("pid") Integer pid); int findStockWarningCountTotal(
@Param("materialParam") String materialParam,
@Param("pid") Integer pid);
} }

View File

@@ -295,40 +295,40 @@ public class DepotHeadService {
return result; return result;
} }
public List<DepotHeadVo4InDetail> findByAll(String beginTime, String endTime, String type, Integer pid, String dids, Integer oId, Integer offset, Integer rows) throws Exception{ public List<DepotHeadVo4InDetail> findByAll(String beginTime, String endTime, String type, String materialParam, Integer pid, String dids, Integer oId, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findByAll(beginTime, endTime, type, pid, dids, oId, offset, rows); list =depotHeadMapperEx.findByAll(beginTime, endTime, type, materialParam, pid, dids, oId, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
public int findByAllCount(String beginTime, String endTime, String type, Integer pid, String dids, Integer oId) throws Exception{ public int findByAllCount(String beginTime, String endTime, String type, String materialParam, Integer pid, String dids, Integer oId) throws Exception{
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, pid, dids, oId); result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, materialParam, pid, dids, oId);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return result; return result;
} }
public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, Integer pid, String dids, Integer oId, Integer offset, Integer rows)throws Exception { public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, String materialParam, Integer pid, String dids, Integer oId, Integer offset, Integer rows)throws Exception {
List<DepotHeadVo4InOutMCount> list = null; List<DepotHeadVo4InOutMCount> list = null;
try{ try{
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, pid, dids, oId, offset, rows); list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, materialParam, pid, dids, oId, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, Integer pid, String dids, Integer oId)throws Exception { public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, String materialParam, Integer pid, String dids, Integer oId)throws Exception {
int result = 0; int result = 0;
try{ try{
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, pid, dids, oId); result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, pid, dids, oId);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }

View File

@@ -240,20 +240,20 @@ public class DepotItemService {
return list; return list;
} }
public List<DepotItemVo4WithInfoEx> findByAll(String name, String model, String endTime, Integer offset, Integer rows)throws Exception { public List<DepotItemVo4WithInfoEx> findByAll(String materialParam, String endTime, Integer offset, Integer rows)throws Exception {
List<DepotItemVo4WithInfoEx> list =null; List<DepotItemVo4WithInfoEx> list =null;
try{ try{
list = depotItemMapperEx.findByAll(name, model, endTime, offset, rows); list = depotItemMapperEx.findByAll(materialParam, endTime, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
public int findByAllCount(String name, String model, String endTime)throws Exception { public int findByAllCount(String materialParam, String endTime)throws Exception {
int result=0; int result=0;
try{ try{
result = depotItemMapperEx.findByAllCount(name, model, endTime); result = depotItemMapperEx.findByAllCount(materialParam, endTime);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -440,20 +440,20 @@ public class DepotItemService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, Integer pid) { public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, String materialParam, Integer pid) {
List<DepotItemStockWarningCount> list = null; List<DepotItemStockWarningCount> list = null;
try{ try{
list =depotItemMapperEx.findStockWarningCount( offset, rows, pid); list =depotItemMapperEx.findStockWarningCount( offset, rows, materialParam, pid);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return list; return list;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int findStockWarningCountTotal(Integer pid) { public int findStockWarningCountTotal(String materialParam, Integer pid) {
int result = 0; int result = 0;
try{ try{
result =depotItemMapperEx.findStockWarningCountTotal(pid); result =depotItemMapperEx.findStockWarningCountTotal(materialParam, pid);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }

View File

@@ -160,6 +160,10 @@
<if test="type != null"> <if test="type != null">
and dh.type='${type}' and dh.type='${type}'
</if> </if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc ORDER BY oper_time DESC,number desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
@@ -187,6 +191,10 @@
<if test="type != null"> <if test="type != null">
and dh.type='${type}' and dh.type='${type}'
</if> </if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc ORDER BY oper_time DESC,number desc
</select> </select>
@@ -208,7 +216,6 @@
</if> </if>
and ifnull(jdh.delete_flag,'0') !='1' and ifnull(jdh.delete_flag,'0') !='1'
) numSum, ) numSum,
(select sum(jdi.all_price) priceSum from jsh_depot_head jdh (select sum(jdi.all_price) priceSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id where jdi.material_id=di.material_id
@@ -241,6 +248,10 @@
<if test="pid == null"> <if test="pid == null">
and di.depot_id in (${dids}) and di.depot_id in (${dids})
</if> </if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.mName like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
@@ -266,6 +277,10 @@
<if test="pid == null"> <if test="pid == null">
and di.depot_id in (${dids}) and di.depot_id in (${dids})
</if> </if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.mName like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a
</select> </select>

View File

@@ -173,11 +173,9 @@
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1' left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1 where 1=1
<if test="name != null"> <if test="materialParam != null and materialParam !=''">
and m.name like '%${name}%' <bind name="bindKey" value="'%'+materialParam+'%'"/>
</if> and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
<if test="model != null">
and m.model like '%${model}%'
</if> </if>
<if test="endTime != null"> <if test="endTime != null">
and dh.oper_time &lt;= '${endTime}' and dh.oper_time &lt;= '${endTime}'
@@ -196,11 +194,9 @@
left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1' left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1' left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
where 1=1 where 1=1
<if test="name != null"> <if test="materialParam != null and materialParam !=''">
and m.name like '%${name}%' <bind name="bindKey" value="'%'+materialParam+'%'"/>
</if> and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
<if test="model != null">
and m.model like '%${model}%'
</if> </if>
<if test="endTime != null"> <if test="endTime != null">
and dh.oper_time &lt;= '${endTime}' and dh.oper_time &lt;= '${endTime}'
@@ -383,6 +379,10 @@
where 1=1 where 1=1
and ifnull(m.delete_flag,'0') !='1' and ifnull(m.delete_flag,'0') !='1'
and ifnull(m.safety_stock,0) > mcs.current_number and ifnull(m.safety_stock,0) > mcs.current_number
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if test="pid != null"> <if test="pid != null">
and mcs.depot_id= ${pid} and mcs.depot_id= ${pid}
</if> </if>
@@ -404,6 +404,10 @@
where 1=1 where 1=1
and ifnull(m.delete_flag,'0') !='1' and ifnull(m.delete_flag,'0') !='1'
and ifnull(m.safety_stock,0) > mcs.current_number and ifnull(m.safety_stock,0) > mcs.current_number
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if test="pid != null"> <if test="pid != null">
and mcs.depot_id= ${pid} and mcs.depot_id= ${pid}
</if> </if>