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
70556cd3
Commit
70556cd3
authored
Nov 22, 2017
by
季圣华
Browse files
限制用户只显示自己拥有仓库的单据
parent
03abe02c
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/action/materials/DepotHeadAction.java
View file @
70556cd3
...
...
@@ -385,10 +385,11 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
public
void
getHeaderIdByMaterial
(){
try
{
String
materialParam
=
model
.
getMaterialParam
();
//商品参数
String
depotIds
=
model
.
getDepotIds
();
//拥有的仓库信息
PageUtil
pageUtil
=
new
PageUtil
();
pageUtil
.
setPageSize
(
0
);
pageUtil
.
setCurPage
(
0
);
depotHeadService
.
getHeaderIdByMaterial
(
pageUtil
,
materialParam
);
depotHeadService
.
getHeaderIdByMaterial
(
pageUtil
,
materialParam
,
depotIds
);
JSONObject
outer
=
new
JSONObject
();
String
allReturn
=
""
;
List
dataList
=
pageUtil
.
getPageList
();
...
...
src/main/java/com/jsh/dao/materials/DepotHeadDAO.java
View file @
70556cd3
...
...
@@ -159,10 +159,13 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {
}
@SuppressWarnings
(
"unchecked"
)
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
)
throws
JshException
{
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
,
String
depotIds
)
throws
JshException
{
StringBuffer
queryString
=
new
StringBuffer
();
queryString
.
append
(
"select dt.HeaderId from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where m.`Name` "
+
" like '%"
+
materialParam
+
"%' or m.Model like '%"
+
materialParam
+
"%'"
);
queryString
.
append
(
"select dt.HeaderId from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where ( m.`Name` "
+
" like '%"
+
materialParam
+
"%' or m.Model like '%"
+
materialParam
+
"%') "
);
if
(!
depotIds
.
equals
(
""
)){
queryString
.
append
(
" and dt.DepotId in ("
+
depotIds
+
") "
);
}
Query
query
=
this
.
getHibernateTemplate
().
getSessionFactory
().
getCurrentSession
().
createSQLQuery
(
queryString
+
SearchConditionUtil
.
getCondition
(
pageUtil
.
getAdvSearch
()));
pageUtil
.
setPageList
(
query
.
list
());
}
...
...
src/main/java/com/jsh/dao/materials/DepotHeadIDAO.java
View file @
70556cd3
...
...
@@ -25,6 +25,6 @@ public interface DepotHeadIDAO extends BaseIDAO<DepotHead>
public
void
findStatementAccount
(
PageUtil
pageUtil
,
String
beginTime
,
String
endTime
,
Long
organId
,
String
supType
)
throws
JshException
;
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
)
throws
JshException
;
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
,
String
depotIds
)
throws
JshException
;
}
src/main/java/com/jsh/service/materials/DepotHeadIService.java
View file @
70556cd3
...
...
@@ -25,5 +25,5 @@ public interface DepotHeadIService extends BaseIService<DepotHead>
public
void
findStatementAccount
(
PageUtil
pageUtil
,
String
beginTime
,
String
endTime
,
Long
organId
,
String
supType
)
throws
JshException
;
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
)
throws
JshException
;
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
,
String
depotIds
)
throws
JshException
;
}
src/main/java/com/jsh/service/materials/DepotHeadService.java
View file @
70556cd3
...
...
@@ -54,7 +54,7 @@ public class DepotHeadService extends BaseService<DepotHead> implements DepotHea
depotHeadDao
.
findStatementAccount
(
pageUtil
,
beginTime
,
endTime
,
organId
,
supType
);
}
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
)
throws
JshException
{
depotHeadDao
.
getHeaderIdByMaterial
(
pageUtil
,
materialParam
);
public
void
getHeaderIdByMaterial
(
PageUtil
pageUtil
,
String
materialParam
,
String
depotIds
)
throws
JshException
{
depotHeadDao
.
getHeaderIdByMaterial
(
pageUtil
,
materialParam
,
depotIds
);
}
}
src/main/webapp/js/pages/materials/in_out.js
View file @
70556cd3
...
...
@@ -21,7 +21,7 @@
var
payTypeTitle
=
""
;
//付款 收款
var
organUrl
=
""
;
//组织数据接口地址
var
amountNum
=
""
;
//单据编号开头字符
var
depotString
=
""
;
//店铺列表
var
depotString
=
""
;
//店铺
id
列表
var
orgDefaultId
=
0
;
//单位默认编号
var
orgDefaultList
;
//存储查询出来的会员列表
var
accountList
;
//账户列表
...
...
@@ -2583,7 +2583,8 @@
url
:
path
+
"
/depotHead/getHeaderIdByMaterial.action
"
,
dataType
:
"
json
"
,
data
:
({
MaterialParam
:
materialParam
MaterialParam
:
materialParam
,
DepotIds
:
depotString
}),
success
:
function
(
res
)
{
if
(
res
)
{
...
...
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