优化报表的查询条件

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 class="form-group">
<label class="control-label">名称</label>
<label class="control-label">商品信息</label>
<div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input>
</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>
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
@@ -55,7 +49,6 @@
$(function () {
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
initMaterialNameList();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
@@ -63,21 +56,6 @@
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() {
$.ajax({
@@ -222,8 +200,7 @@
currentPage: pageNo,
pageSize: pageSize,
monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"),
model: $("#mModel").textbox("getValue"),
materialParam: $.trim($("#searchMaterial").val()),
mpList: mPropertyList
}),
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>
</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">
<label class="control-label">单据日期:</label>
<div class="control-inline">
@@ -282,6 +288,7 @@
currentPage: pageNo,
pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString,
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>
</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">
<label class="control-label">单据日期:</label>
<div class="control-inline">
@@ -271,6 +277,7 @@
currentPage: pageNo,
pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString,
beginTime: $("#searchBeginTime").val(),

View File

@@ -29,15 +29,9 @@
</div>
</div>
<div class="form-group">
<label class="control-label">名称</label>
<label class="control-label">商品信息</label>
<div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input>
</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>
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
@@ -72,7 +66,6 @@
initSelectInfo_UB();
initSystemData_depot();
initSelectInfo_depot();
initMaterialNameList();
initMProperty(); //初始化商品属性
initTableData();
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() {
$.ajax({
@@ -324,8 +302,7 @@
+ "&currentPage=" + pageNo + "&pageSize=" + pageSize
+ "&depotId=" + $.trim($("#searchProjectId").val())
+ "&monthTime=" + $("#searchMonth").val()
+ "&name=" + $("#mName").combobox("getValue")
+ "&model=" + $("#mModel").textbox("getValue");
+ "&materialParam=" + $.trim($("#searchMaterial").val());
}
else {
$.ajax({
@@ -337,8 +314,7 @@
pageSize: pageSize,
depotId: $.trim($("#searchProjectId").val()),
monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"),
model: $("#mModel").textbox("getValue"),
materialParam: $.trim($("#searchMaterial").val()),
mpList: mPropertyList
}),
success: function (res) {
@@ -361,8 +337,7 @@
data: ({
depotId: $.trim($("#searchProjectId").val()),
monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"),
model: $("#mModel").textbox("getValue")
materialParam: $.trim($("#searchMaterial").val())
}),
success: function (res) {
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>
</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">
<label class="control-label">单据日期:</label>
<div class="control-inline">
@@ -282,6 +288,7 @@
currentPage: pageNo,
pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString,
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>
</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">
<label class="control-label">单据日期:</label>
<div class="control-inline">
@@ -271,6 +277,7 @@
currentPage: pageNo,
pageSize: pageSize,
organId: $('#OrganId').combobox('getValue'),
materialParam: $.trim($("#searchMaterial").val()),
projectId: $.trim($("#searchProjectId").val()),
depotIds: depotString,
beginTime: $("#searchBeginTime").val(),

View File

@@ -30,15 +30,9 @@
</div>
</div>
<div class="form-group">
<label class="control-label">名称</label>
<label class="control-label">商品信息</label>
<div class="control-inline">
<input name="mName" id="mName" style="width:100px;"></input>
</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>
<input type="text" id="searchMaterial" name="searchMaterial" data-options="prompt:'名称规格型号'" class="easyui-textbox width-120"/>
</div>
</div>
<div class="form-group">
@@ -59,7 +53,6 @@
$("#searchTable .tip").css("padding-left", "15px").css("color", "red");
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
initMaterialNameList();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
@@ -67,21 +60,6 @@
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() {
$.ajax({
@@ -229,8 +207,7 @@
currentPage: pageNo,
pageSize: pageSize,
monthTime: $("#searchMonth").val(),
name: $("#mName").combobox("getValue"),
model: $("#mModel").textbox("getValue"),
materialParam: $.trim($("#searchMaterial").val()),
mpList: mPropertyList
}),
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>
</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">
<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>
@@ -291,6 +297,7 @@
data: ({
currentPage: pageNo,
pageSize: pageSize,
materialParam: $.trim($("#searchMaterial").val()),
projectId : $.trim($("#searchProjectId").val()),
mpList: mPropertyList
}),
@@ -299,6 +306,7 @@
if (pageSize === 3000) {
window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs()
+ "&currentPage=" + pageNo + "&pageSize=" + pageSize
+ "&materialParam=" + $.trim($("#searchMaterial").val())
+ "&projectId=" + $.trim($("#searchProjectId").val())
+ "&mpList=" + mPropertyList;
}

View File

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

View File

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

View File

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

View File

@@ -40,15 +40,13 @@ public interface DepotItemMapperEx {
@Param("headerId") Long headerId);
List<DepotItemVo4WithInfoEx> findByAll(
@Param("name") String name,
@Param("model") String model,
@Param("materialParam") String materialParam,
@Param("endTime") String endTime,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int findByAllCount(
@Param("name") String name,
@Param("model") String model,
@Param("materialParam") String materialParam,
@Param("endTime") String endTime);
BigDecimal buyOrSaleNumber(
@@ -108,8 +106,13 @@ public interface DepotItemMapperEx {
List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds);
List<DepotItemStockWarningCount> findStockWarningCount(@Param("offset") Integer offset,
@Param("rows") Integer rows, @Param("pid") Integer pid);
List<DepotItemStockWarningCount> findStockWarningCount(
@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;
}
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;
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){
JshException.readFail(logger, e);
}
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;
try{
result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, pid, dids, oId);
result =depotHeadMapperEx.findByAllCount(beginTime, endTime, type, materialParam, pid, dids, oId);
}catch(Exception e){
JshException.readFail(logger, e);
}
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;
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){
JshException.readFail(logger, e);
}
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;
try{
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, pid, dids, oId);
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, pid, dids, oId);
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

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

View File

@@ -160,6 +160,10 @@
<if test="type != null">
and dh.type='${type}'
</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'
ORDER BY oper_time DESC,number desc
<if test="offset != null and rows != null">
@@ -187,6 +191,10 @@
<if test="type != null">
and dh.type='${type}'
</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'
ORDER BY oper_time DESC,number desc
</select>
@@ -208,7 +216,6 @@
</if>
and ifnull(jdh.delete_flag,'0') !='1'
) numSum,
(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'
where jdi.material_id=di.material_id
@@ -241,6 +248,10 @@
<if test="pid == null">
and di.depot_id in (${dids})
</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'
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName
<if test="offset != null and rows != null">
@@ -266,6 +277,10 @@
<if test="pid == null">
and di.depot_id in (${dids})
</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'
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a
</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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1
<if test="name != null">
and m.name like '%${name}%'
</if>
<if test="model != null">
and m.model like '%${model}%'
<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="endTime != null">
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_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
where 1=1
<if test="name != null">
and m.name like '%${name}%'
</if>
<if test="model != null">
and m.model like '%${model}%'
<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="endTime != null">
and dh.oper_time &lt;= '${endTime}'
@@ -383,6 +379,10 @@
where 1=1
and ifnull(m.delete_flag,'0') !='1'
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">
and mcs.depot_id= ${pid}
</if>
@@ -404,6 +404,10 @@
where 1=1
and ifnull(m.delete_flag,'0') !='1'
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">
and mcs.depot_id= ${pid}
</if>