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
be6a1744
Commit
be6a1744
authored
Dec 21, 2018
by
季圣华
Browse files
解决供应商、客户、会员的启用和禁用失败的问题
parent
81cd6dc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/manage/supplier.js
View file @
be6a1744
...
...
@@ -293,23 +293,20 @@
}
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/supplier/batchSetEnable
.action
"
,
url
:
"
/supplier/batchSetEnable
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
enabled
:
true
,
supplierIDs
:
ids
}),
success
:
function
(
tipInfo
)
{
var
msg
=
tipInfo
.
showModel
.
msgTip
;
if
(
msg
==
'
成功
'
)
{
//加载完以后重新初始化
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
启用提示
'
,
'
启用信息失败,请稍后再试!
'
,
'
error
'
);
}
else
$
.
messager
.
alert
(
'
启用提示
'
,
'
启用信息失败,请稍后再试!
'
,
'
error
'
);
},
//此处添加错误处理
error
:
function
()
{
...
...
@@ -342,22 +339,20 @@
}
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/supplier/batchSetEnable
.action
"
,
url
:
"
/supplier/batchSetEnable
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
enabled
:
false
,
supplierIDs
:
ids
}),
success
:
function
(
tipInfo
)
{
var
msg
=
tipInfo
.
showModel
.
msgTip
;
if
(
msg
==
'
成功
'
)
{
//加载完以后重新初始化
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
禁用提示
'
,
'
禁用信息失败,请稍后再试!
'
,
'
error
'
);
}
else
$
.
messager
.
alert
(
'
禁用提示
'
,
'
禁用信息失败,请稍后再试!
'
,
'
error
'
);
},
//此处添加错误处理
error
:
function
()
{
...
...
src/main/java/com/jsh/erp/controller/SupplierController.java
View file @
be6a1744
...
...
@@ -189,4 +189,24 @@ public class SupplierController {
}
return
res
;
}
/**
* 批量设置状态-启用或者禁用
* @param enabled
* @param supplierIDs
* @param request
* @return
*/
@PostMapping
(
value
=
"/batchSetEnable"
)
public
String
batchSetEnable
(
@RequestParam
(
"enabled"
)
Boolean
enabled
,
@RequestParam
(
"supplierIDs"
)
String
supplierIDs
,
HttpServletRequest
request
)
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
int
res
=
supplierService
.
batchSetEnable
(
enabled
,
supplierIDs
);
if
(
res
>
0
)
{
return
returnJson
(
objectMap
,
ErpInfo
.
OK
.
name
,
ErpInfo
.
OK
.
code
);
}
else
{
return
returnJson
(
objectMap
,
ErpInfo
.
ERROR
.
name
,
ErpInfo
.
ERROR
.
code
);
}
}
}
src/main/java/com/jsh/erp/service/supplier/SupplierService.java
View file @
be6a1744
...
...
@@ -99,4 +99,13 @@ public class SupplierService {
example
.
setOrderByClause
(
"id desc"
);
return
supplierMapper
.
selectByExample
(
example
);
}
public
int
batchSetEnable
(
Boolean
enabled
,
String
supplierIDs
)
{
List
<
Long
>
ids
=
StringUtil
.
strToLongList
(
supplierIDs
);
Supplier
supplier
=
new
Supplier
();
supplier
.
setEnabled
(
enabled
);
SupplierExample
example
=
new
SupplierExample
();
example
.
createCriteria
().
andIdIn
(
ids
);
return
supplierMapper
.
updateByExampleSelective
(
supplier
,
example
);
}
}
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