Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
d17ad852
"eladmin-system/src/vscode:/vscode.git/clone" did not exist on "c4ddacc77dd335d387cbe5e5205fafa9ba2472c4"
Commit
d17ad852
authored
Mar 18, 2019
by
qiankunpingtai
Browse files
添加选择商品名称功能
parent
2e26e41a
Changes
10
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/serialNumber.html
View file @
d17ad852
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px;top:300px;"
title=
"序列号列表"
iconCls=
"icon-list"
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px;top:300px;"
title=
"序列号列表"
iconCls=
"icon-list"
collapsible=
"true"
closable=
"false"
>
collapsible=
"true"
closable=
"false"
>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
<input
id=
"selectType"
hidden=
"hidden"
/>
</div>
</div>
<div
id=
"serialNumberDetailListDlg"
class=
"easyui-dialog"
style=
"width:900px;height:500px;padding:10px 20px"
closed=
"true"
<div
id=
"serialNumberDetailListDlg"
class=
"easyui-dialog"
style=
"width:900px;height:500px;padding:10px 20px"
closed=
"true"
...
@@ -59,12 +60,15 @@
...
@@ -59,12 +60,15 @@
<table>
<table>
<tr>
<tr>
<td
style=
"width:60px; height:30px;"
>
商品名称
</td>
<td
style=
"width:60px; height:30px;"
>
商品名称
</td>
<td
style=
"padding:5px;width:
18
0px;"
>
<td
style=
"padding:5px;width:
30
0px;"
>
<input
name=
"materialId"
id=
"materialId"
type=
"hidden"
/>
<input
name=
"materialId"
id=
"materialId"
type=
"hidden"
/>
<input
name=
"materialName"
id=
"materialName"
class=
"easyui-validatebox"
<input
name=
"materialName"
id=
"materialName"
readonly=
"readonly"
data-options=
"required:false,validType:'length[2,30]'"
style=
"width: 180px;height: 20px"
/>
style=
"width: 180px;height: 20px"
/>
<a
href=
"javascript:void(0)"
class=
"l-btn l-btn-plain"
group=
""
id=
"lookForSelectMaterial"
>
<span
class=
"l-btn-left"
><span
class=
"l-btn-text icon-search l-btn-icon-left"
></span></span></a>
</td>
</td>
</tr>
<tr>
<td
style=
"width:80px;"
>
序列号
</td>
<td
style=
"width:80px;"
>
序列号
</td>
<td
style=
"padding:5px;width:180px;"
>
<td
style=
"padding:5px;width:180px;"
>
<input
name=
"serialNumberId"
id=
"serialNumberId"
type=
"hidden"
/>
<input
name=
"serialNumberId"
id=
"serialNumberId"
type=
"hidden"
/>
...
@@ -100,20 +104,20 @@
...
@@ -100,20 +104,20 @@
<table>
<table>
<tr>
<tr>
<td
style=
"width:60px; height:30px;"
>
商品名称
</td>
<td
style=
"width:60px; height:30px;"
>
商品名称
</td>
<td
style=
"padding:5px;width:180px;"
>
<td
style=
"padding:5px;width:300px;"
>
<input
name=
"materialName"
id=
"batAddMaterialName"
class=
"easyui-validatebox"
<input
name=
"materialName"
id=
"batAddMaterialName"
readonly=
"readonly"
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 180px;height: 20px"
/>
style=
"width: 180px;height: 20px"
/>
<a
href=
"javascript:void(0)"
class=
"l-btn l-btn-plain"
group=
""
id=
"batLookForSelectMaterial"
>
<span
class=
"l-btn-left"
><span
class=
"l-btn-text icon-search l-btn-icon-left"
></span></span></a>
</td>
</td>
</tr>
<tr>
<td
style=
"width:80px;"
>
序列号前缀
</td>
<td
style=
"width:80px;"
>
序列号前缀
</td>
<td
style=
"padding:5px;width:180px;"
>
<td
style=
"padding:5px;width:180px;"
>
<input
name=
"serialNumber"
id=
"batAddSerialNumberInput"
class=
"easyui-validatebox"
<input
name=
"serialNumber"
id=
"batAddSerialNumberInput"
class=
"easyui-validatebox"
data-options=
"required:true,validType:'length[1,30]'"
data-options=
"required:true,validType:'length[1,30]'"
style=
"width: 180px;height: 20px"
/>
style=
"width: 180px;height: 20px"
/>
</td>
</td>
<td
style=
"width:200px;"
></td>
</tr>
<tr>
<td
style=
"width:80px;"
>
序列号数量
</td>
<td
style=
"width:80px;"
>
序列号数量
</td>
<td
style=
"padding:5px;width:180px;"
>
<td
style=
"padding:5px;width:180px;"
>
<input
name=
"batAddTotal"
id=
"batAddTotal"
class=
"easyui-numberbox"
<input
name=
"batAddTotal"
id=
"batAddTotal"
class=
"easyui-numberbox"
...
@@ -141,6 +145,9 @@
...
@@ -141,6 +145,9 @@
onclick=
"javascript:$('#batAddSerialNumberDlg').dialog('close')"
>
取消
</a>
onclick=
"javascript:$('#batAddSerialNumberDlg').dialog('close')"
>
取消
</a>
</div>
</div>
<div
id=
"forSelectMaterialDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
closed=
"true"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
url
;
var
url
;
...
@@ -617,6 +624,34 @@
...
@@ -617,6 +624,34 @@
}
}
});
});
});
});
//查询商品名称
$
(
"
#lookForSelectMaterial
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#selectType
"
).
val
(
"
lookForSelectMaterial
"
);
$
(
'
#forSelectMaterialDlg
'
).
dialog
({
title
:
'
商品名称选择
'
,
width
:
webW
/
2
,
height
:
webH
/
2
,
closed
:
false
,
cache
:
false
,
href
:
'
/pages/materials/material_forselect.html
'
,
modal
:
true
,
resizable
:
true
});
});
//查询商品名称批量添加
$
(
"
#batLookForSelectMaterial
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#selectType
"
).
val
(
"
batLookForSelectMaterial
"
);
$
(
'
#forSelectMaterialDlg
'
).
dialog
({
title
:
'
商品名称选择
'
,
width
:
webW
/
2
,
height
:
webH
/
2
,
closed
:
false
,
cache
:
false
,
href
:
'
/pages/materials/material_forselect.html
'
,
modal
:
true
,
resizable
:
true
});
});
</script>
</script>
</body>
</body>
...
...
erp_web/pages/materials/material.html
View file @
d17ad852
...
@@ -270,6 +270,7 @@
...
@@ -270,6 +270,7 @@
</div>
</div>
<div
id=
"forSelectMaterialCategoryDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
<div
id=
"forSelectMaterialCategoryDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
closed=
"true"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
closed=
"true"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
materialCategoryList
=
null
;
var
materialCategoryList
=
null
;
var
types
=
""
;
var
types
=
""
;
...
@@ -1485,6 +1486,5 @@
...
@@ -1485,6 +1486,5 @@
});
});
</script>
</script>
</div>
</body>
</body>
</html>
</html>
erp_web/pages/materials/material_forselect.html
0 → 100644
View file @
d17ad852
<!DOCTYPE html>
<html>
<head>
<title>
商品信息选择
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/material.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/outlook_in.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 查询 -->
<div
id=
"searchForSelectPanel"
class=
"easyui-panel"
style=
"padding:10px;"
title=
"查询窗口"
iconCls=
"icon-search"
collapsible=
"true"
closable=
"false"
>
<table
id=
"searchForSelectTable"
>
<tr>
<td>
品名:
</td>
<td>
<input
name=
"searchForSelectName"
id=
"searchForSelectName"
style=
"width:80px;"
/>
</td>
<td>
</td>
<td>
型号:
</td>
<td>
<input
name=
"searchForSelectModel"
id=
"searchForSelectModel"
style=
"width:80px;"
/>
</td>
<td>
</td>
<td>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchForSelectBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchForSelectResetBtn"
>
重置
</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div
id=
"tableForSelectPanel"
class=
"easyui-panel"
style=
"padding:1px;top:300px;"
title=
"商品列表"
iconCls=
"icon-list"
collapsible=
"true"
closable=
"false"
>
<table
id=
"tableForSelectData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
</div>
<div
id=
"materialDetailListDlg"
class=
"easyui-dialog"
style=
"width:900px;height:500px;padding:10px 20px"
closed=
"true"
modal=
"true"
collapsible=
"false"
closable=
"true"
>
<table
id=
"materialTableData"
style=
"top:50px;border-bottom-color:#FFFFFF"
></table>
</div>
<script
type=
"text/javascript"
>
var
setCategoryId
=
"
1
"
;
var
cid
=
1
;
//初始化界面
$
(
function
()
{
//初始化系统基础信息
initTableData
();
ininPager
();
});
//初始化表格数据
function
initTableData
()
{
//改变宽度和高度
$
(
"
#searchForSelectPanel
"
).
panel
({
width
:
webW
/
2
-
70
});
$
(
"
#tableForSelectPanel
"
).
panel
({
width
:
webW
/
2
-
70
});
$
(
'
#tableForSelectData
'
).
datagrid
({
//title:'商品列表',
//iconCls:'icon-save',
//width:700,
height
:
heightInfo
,
nowrap
:
false
,
rownumbers
:
false
,
//动画效果
animate
:
false
,
//选中单行
singleSelect
:
true
,
collapsible
:
false
,
selectOnCheck
:
false
,
//fitColumns:true,
//单击行是否选中
//checkOnSelect : false,
pagination
:
true
,
//交替出现背景
striped
:
true
,
//loadFilter: pagerFilter,
pageSize
:
initPageSize
,
pageList
:
initPageNum
,
columns
:
[[
{
field
:
'
id
'
,
width
:
35
,
align
:
"
center
"
,
hidden
:
true
},
{
title
:
'
品名
'
,
field
:
'
name
'
,
width
:
150
},
{
title
:
'
型号
'
,
field
:
'
model
'
,
width
:
100
},
{
title
:
'
类别
'
,
field
:
'
categoryName
'
,
width
:
130
},
{
title
:
'
单位
'
,
field
:
'
unit
'
,
width
:
60
},
{
title
:
'
库存
'
,
field
:
'
abc
'
,
width
:
70
,
formatter
:
function
(
value
,
rec
)
{
var
monthTime
=
getNowFormatMonth
();
var
mId
=
rec
.
id
;
//商品id
var
thisStock
=
0
;
//查询库存
$
.
ajax
({
type
:
"
get
"
,
url
:
'
/depotItem/findStockNumByMaterialId
'
,
data
:
{
materialId
:
mId
,
monthTime
:
monthTime
,
currentPage
:
1
,
pageSize
:
10
},
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
&&
res
.
data
.
page
&&
res
.
data
.
page
[
0
])
{
thisStock
=
res
.
data
.
page
[
0
].
thisSum
-
0
;
if
(
thisStock
>
0
)
{
$
(
"
#tablePanel .class-
"
+
rec
.
id
).
text
(
thisStock
);
//延迟加载库存数据
$
(
"
#tablePanel .class-
"
+
rec
.
id
).
css
(
"
color
"
,
"
blue
"
).
css
(
"
text-decoration
"
,
"
underline
"
).
css
(
"
cursor
"
,
"
pointer
"
);
$
(
"
#tablePanel .class-
"
+
rec
.
id
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
(
'
#materialDetailListDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 查看出入库明细
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
initMaterialDetailData
(
mId
);
getMaterialInOutList
(
mId
,
1
,
initPageSize
);
ininMaterialDetailPager
(
mId
);
});
}
}
}
},
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
}
});
return
"
<span class='class-
"
+
rec
.
id
+
"
'>
"
+
thisStock
+
"
</span>
"
;
}
},
]],
toolbar
:
[
],
onLoadError
:
function
()
{
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
return
;
},
onDblClickRow
:
function
(
rowIndex
,
rowData
){
var
selectType
=
$
(
"
#selectType
"
).
val
();
console
.
log
(
rowData
);
if
(
selectType
==
"
lookForSelectMaterial
"
){
//单个添加序列号时选择
$
(
"
#materialId
"
).
val
(
rowData
.
id
);
$
(
"
#materialName
"
).
val
(
rowData
.
name
);
}
else
if
(
selectType
==
"
batLookForSelectMaterial
"
){
//批量添加序列号时选择
$
(
"
#batAddMaterialName
"
).
val
(
rowData
.
name
);
}
//关闭掉dialog
$
(
"
#forSelectMaterialDlg
"
).
dialog
(
'
close
'
);
}
});
showMaterialDetails
(
1
,
initPageSize
);
}
//分页信息处理
function
ininMaterialDetailPager
(
mId
)
{
try
{
var
opts
=
$
(
"
#materialTableData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#materialTableData
"
).
datagrid
(
'
getPager
'
);
pager
.
pagination
({
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
opts
.
pageNumber
=
pageNum
;
opts
.
pageSize
=
pageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
pageNum
,
pageSize
:
pageSize
});
getMaterialInOutList
(
mId
,
pageNum
,
pageSize
);
}
});
}
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
function
getMaterialInOutList
(
mId
,
pageNo
,
pageSize
)
{
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/depotItem/findDetailByTypeAndMaterialId
"
,
dataType
:
"
json
"
,
data
:
({
materialId
:
mId
,
currentPage
:
pageNo
,
pageSize
:
pageSize
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
){
if
(
res
.
data
&&
res
.
data
.
page
)
{
$
(
"
#materialTableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
.
page
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
//初始化键盘enter事件
$
(
document
).
keydown
(
function
(
event
)
{
//兼容 IE和firefox 事件
var
e
=
window
.
event
||
event
;
var
k
=
e
.
keyCode
||
e
.
which
||
e
.
charCode
;
//兼容 IE,firefox 兼容
var
obj
=
e
.
srcElement
?
e
.
srcElement
:
e
.
target
;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
CategoryLevel
"
||
obj
.
id
==
"
Name
"
))
{
$
(
"
#saveMaterial
"
).
click
();
}
//搜索按钮添加快捷键
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
searchCategoryId
"
||
(
obj
.
id
==
"
searchName
"
)))
{
$
(
"
#searchForSelectBtn
"
).
click
();
}
});
//分页信息处理
function
ininPager
()
{
try
{
var
opts
=
$
(
"
#tableForSelectData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableForSelectData
"
).
datagrid
(
'
getPager
'
);
pager
.
pagination
({
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
opts
.
pageNumber
=
pageNum
;
opts
.
pageSize
=
pageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
pageNum
,
pageSize
:
pageSize
});
showMaterialDetails
(
pageNum
,
pageSize
);
}
});
}
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
//搜索处理
$
(
"
#searchForSelectBtn
"
).
unbind
().
bind
({
click
:
function
()
{
showMaterialDetails
(
1
,
initPageSize
);
var
opts
=
$
(
"
#tableForSelectData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableForSelectData
"
).
datagrid
(
'
getPager
'
);
opts
.
pageNumber
=
1
;
opts
.
pageSize
=
initPageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
1
,
pageSize
:
initPageSize
});
}
});
function
showMaterialDetails
(
pageNo
,
pageSize
)
{
var
name
=
$
.
trim
(
$
(
"
#searchForSelectName
"
).
val
());
var
model
=
$
.
trim
(
$
(
"
#searchForSelectModel
"
).
val
());
if
(
setCategoryId
!=
"
1
"
)
{
cid
=
2
;
}
else
{
cid
=
1
;
}
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/material/getMaterialEnableSerialNumberList
"
,
dataType
:
"
json
"
,
data
:
({
search
:
JSON
.
stringify
({
name
:
name
,
model
:
model
}),
currentPage
:
pageNo
,
pageSize
:
pageSize
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
){
if
(
res
.
data
&&
res
.
data
.
page
)
{
$
(
"
#tableForSelectData
"
).
datagrid
(
'
loadData
'
,
res
.
data
.
page
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
//重置按钮
$
(
"
#searchForSelectResetBtn
"
).
unbind
().
bind
({
click
:
function
()
{
$
(
"
#searchForSelectName
"
).
val
(
""
);
setCategoryId
=
"
1
"
;
//加载完以后重新初始化
$
(
"
#searchForSelectBtn
"
).
click
();
}
});
</script>
</body>
</html>
erp_web/pages/materials/materialcategory_forselect.html
View file @
d17ad852
...
@@ -31,6 +31,9 @@
...
@@ -31,6 +31,9 @@
*/
*/
$
(
function
()
{
$
(
function
()
{
var
id
=
$
(
"
#id
"
).
val
();
var
id
=
$
(
"
#id
"
).
val
();
if
(
id
==
undefined
){
id
=
''
;
}
console
.
log
(
id
);
console
.
log
(
id
);
$
(
'
#ttForSelect
'
).
tree
({
$
(
'
#ttForSelect
'
).
tree
({
url
:
'
/materialCategory/getMaterialCategoryTree?id=
'
+
id
,
url
:
'
/materialCategory/getMaterialCategoryTree?id=
'
+
id
,
...
...
src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
d17ad852
...
@@ -3,6 +3,10 @@ package com.jsh.erp.controller;
...
@@ -3,6 +3,10 @@ package com.jsh.erp.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.datasource.entities.DepotEx
;
import
com.jsh.erp.datasource.entities.Material
;
import
com.jsh.erp.datasource.entities.Material
;
import
com.jsh.erp.datasource.entities.MaterialVo4Unit
;
import
com.jsh.erp.datasource.entities.MaterialVo4Unit
;
import
com.jsh.erp.service.material.MaterialService
;
import
com.jsh.erp.service.material.MaterialService
;
...
@@ -19,10 +23,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -19,10 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
jsh
.
erp
.
utils
.
ResponseJsonUtil
.
returnJson
;
import
static
com
.
jsh
.
erp
.
utils
.
ResponseJsonUtil
.
returnJson
;
...
@@ -307,4 +308,37 @@ public class MaterialController {
...
@@ -307,4 +308,37 @@ public class MaterialController {
return
null
;
return
null
;
}
}
}
}
@RequestMapping
(
value
=
"/getMaterialEnableSerialNumberList"
)
public
String
getMaterialEnableSerialNumberList
(
@RequestParam
(
value
=
Constants
.
PAGE_SIZE
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
value
=
Constants
.
CURRENT_PAGE
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
Constants
.
SEARCH
,
required
=
false
)
String
search
)
{
Map
<
String
,
Object
>
parameterMap
=
new
HashMap
<
String
,
Object
>();
//查询参数
JSONObject
obj
=
JSON
.
parseObject
(
search
);
Set
<
String
>
key
=
obj
.
keySet
();
for
(
String
keyEach:
key
){
parameterMap
.
put
(
keyEach
,
obj
.
getString
(
keyEach
));
}
PageQueryInfo
queryInfo
=
new
PageQueryInfo
();
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
if
(
pageSize
==
null
||
pageSize
<=
0
)
{
pageSize
=
BusinessConstants
.
DEFAULT_PAGINATION_PAGE_SIZE
;
}
if
(
currentPage
==
null
||
currentPage
<=
0
)
{
currentPage
=
BusinessConstants
.
DEFAULT_PAGINATION_PAGE_NUMBER
;
}
PageHelper
.
startPage
(
currentPage
,
pageSize
,
true
);
List
<
Material
>
list
=
materialService
.
getMaterialEnableSerialNumberList
(
parameterMap
);
//获取分页查询后的数据
PageInfo
<
Material
>
pageInfo
=
new
PageInfo
<>(
list
);
objectMap
.
put
(
"page"
,
queryInfo
);
if
(
list
==
null
)
{
queryInfo
.
setRows
(
new
ArrayList
<
Object
>());
queryInfo
.
setTotal
(
BusinessConstants
.
DEFAULT_LIST_NULL_NUMBER
);
return
returnJson
(
objectMap
,
"查找不到数据"
,
ErpInfo
.
OK
.
code
);
}
queryInfo
.
setRows
(
list
);
queryInfo
.
setTotal
(
pageInfo
.
getTotal
());
return
returnJson
(
objectMap
,
ErpInfo
.
OK
.
name
,
ErpInfo
.
OK
.
code
);
}
}
}
src/main/java/com/jsh/erp/datasource/mappers/DepotMapperEx.java
View file @
d17ad852
...
@@ -23,5 +23,4 @@ public interface DepotMapperEx {
...
@@ -23,5 +23,4 @@ public interface DepotMapperEx {
@Param
(
"remark"
)
String
remark
);
@Param
(
"remark"
)
String
remark
);
List
<
DepotEx
>
getDepotList
(
Map
<
String
,
Object
>
params
);
List
<
DepotEx
>
getDepotList
(
Map
<
String
,
Object
>
params
);
Long
getDepotListCount
(
Map
<
String
,
Object
>
params
);
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
View file @
d17ad852
...
@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.MaterialVo4Unit;
...
@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.MaterialVo4Unit;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Description
* Description
...
@@ -49,5 +50,8 @@ public interface MaterialMapperEx {
...
@@ -49,5 +50,8 @@ public interface MaterialMapperEx {
* 通过商品名称查询商品信息
* 通过商品名称查询商品信息
* */
* */
List
<
Material
>
findByMaterialName
(
@Param
(
"name"
)
String
name
);
List
<
Material
>
findByMaterialName
(
@Param
(
"name"
)
String
name
);
/**
* 获取开启序列号并且状态正常的商品列表
* */
List
<
Material
>
getMaterialEnableSerialNumberList
(
Map
<
String
,
Object
>
parameterMap
);
}
}
src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
d17ad852
package
com.jsh.erp.service.material
;
package
com.jsh.erp.service.material
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.datasource.entities.DepotEx
;
import
com.jsh.erp.datasource.entities.Material
;
import
com.jsh.erp.datasource.entities.Material
;
import
com.jsh.erp.datasource.entities.MaterialExample
;
import
com.jsh.erp.datasource.entities.MaterialExample
;
import
com.jsh.erp.datasource.entities.MaterialVo4Unit
;
import
com.jsh.erp.datasource.entities.MaterialVo4Unit
;
...
@@ -194,4 +195,8 @@ public class MaterialService {
...
@@ -194,4 +195,8 @@ public class MaterialService {
info
.
data
=
data
;
info
.
data
=
data
;
return
info
;
return
info
;
}
}
public
List
<
Material
>
getMaterialEnableSerialNumberList
(
Map
<
String
,
Object
>
parameterMap
)
{
return
materialMapperEx
.
getMaterialEnableSerialNumberList
(
parameterMap
);
}
}
}
src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java
View file @
d17ad852
...
@@ -172,9 +172,7 @@ public class SerialNumberService {
...
@@ -172,9 +172,7 @@ public class SerialNumberService {
return
null
;
return
null
;
}
}
/**处理商品id*/
/**处理商品id*/
if
(
serialNumberEx
.
getMaterialId
()==
null
){
serialNumberEx
.
setMaterialId
(
getSerialNumberMaterialIdByMaterialName
(
serialNumberEx
.
getMaterialName
()));
serialNumberEx
.
setMaterialId
(
getSerialNumberMaterialIdByMaterialName
(
serialNumberEx
.
getMaterialName
()));
}
//删除标记,默认未删除
//删除标记,默认未删除
serialNumberEx
.
setDeleteFlag
(
BusinessConstants
.
DELETE_FLAG_EXISTS
);
serialNumberEx
.
setDeleteFlag
(
BusinessConstants
.
DELETE_FLAG_EXISTS
);
//已卖出,默认未否
//已卖出,默认未否
...
...
src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
d17ad852
...
@@ -104,6 +104,25 @@
...
@@ -104,6 +104,25 @@
</if>
</if>
</select>
</select>
<select
id=
"getMaterialEnableSerialNumberList"
parameterType=
"java.util.Map"
resultMap=
"com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap"
>
select
Id, CategoryId, name, Mfrs, Packing, SafetyStock, Model, Standard, Color, Unit, Remark,
RetailPrice, LowPrice, PresetPriceOne, PresetPriceTwo, UnitId, FirstOutUnit, FirstInUnit,
PriceStrategy, Enabled,enableSerialNumber
FROM jsh_material
where 1=1
and enabled ='1'
and enableSerialNumber ='1'
<if
test=
"name != null and name != ''"
>
<bind
name=
"name"
value=
"'%' + _parameter.name + '%'"
/>
and name like #{name}
</if>
<if
test=
"model != null and model != ''"
>
<bind
name=
"model"
value=
"'%' + _parameter.model + '%'"
/>
and model like #{model}
</if>
order by id desc
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment