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
3534c26a
Commit
3534c26a
authored
Oct 05, 2020
by
季圣华
Browse files
解决财务单据删除逻辑的bug
parent
ce3fbfb5
Changes
5
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/financial/financial_base.js
View file @
3534c26a
...
...
@@ -496,10 +496,8 @@
//删除财务信息
function
deleteAccountHead
(
accountHeadID
,
thisOrganId
,
totalPrice
){
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除此财务信息吗?
'
,
function
(
r
)
{
if
(
r
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除此财务信息吗?
'
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/accountHead/batchDeleteAccountHeadByIds
"
,
...
...
@@ -511,19 +509,7 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
accountHeadID
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteAccountHeadForceConfirm
(
res
,
"
/accountHead/batchDeleteAccountHeadByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
return
;
}
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息失败,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
...
...
src/main/java/com/jsh/erp/controller/AccountHeadController.java
View file @
3534c26a
...
...
@@ -111,9 +111,6 @@ public class AccountHeadController {
}
/**
* create by: qiankunpingtai
* website:https://qiankunpingtai.cn
* description:
* 批量删除账户信息
* create time: 2019/3/29 10:49
* @Param: ids
...
...
@@ -122,25 +119,8 @@ public class AccountHeadController {
@RequestMapping
(
value
=
"/batchDeleteAccountHeadByIds"
)
public
Object
batchDeleteAccountHeadByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
accountHeadService
.
batchDeleteAccountHeadByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
accountHeadService
.
batchDeleteAccountHeadByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_CODE
,
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_MSG
,
ids
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_CODE
,
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_MSG
);
}
accountHeadService
.
batchDeleteAccountHeadByIds
(
ids
);
return
result
;
}
...
...
src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java
View file @
3534c26a
...
...
@@ -32,4 +32,6 @@ public interface AccountItemMapperEx {
List
<
AccountItem
>
getAccountItemListByHeaderIds
(
@Param
(
"headerIds"
)
String
[]
headerIds
);
List
<
AccountItem
>
getAccountItemListByInOutItemIds
(
@Param
(
"inOutItemIds"
)
String
[]
inOutItemIds
);
int
batchDeleteAccountItemByHeadIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
[]
ids
);
}
\ No newline at end of file
src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
3534c26a
...
...
@@ -320,6 +320,9 @@ public class AccountHeadService {
String
[]
idArray
=
ids
.
split
(
","
);
int
result
=
0
;
try
{
//删除主表
result
=
accountItemMapperEx
.
batchDeleteAccountItemByHeadIds
(
new
Date
(),
userInfo
==
null
?
null
:
userInfo
.
getId
(),
idArray
);
//删除子表
result
=
accountHeadMapperEx
.
batchDeleteAccountHeadByIds
(
new
Date
(),
userInfo
==
null
?
null
:
userInfo
.
getId
(),
idArray
);
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
...
...
src/main/resources/mapper_xml/AccountItemMapperEx.xml
View file @
3534c26a
...
...
@@ -96,4 +96,14 @@
)
and ifnull(delete_flag,'0') !='1'
</select>
<update
id=
"batchDeleteAccountItemByHeadIds"
>
update jsh_account_item
set delete_flag='1'
where 1=1
and header_id in (
<foreach
collection=
"ids"
item=
"id"
separator=
","
>
#{id}
</foreach>
)
</update>
</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