解决财务单据删除逻辑的bug
This commit is contained in:
@@ -496,10 +496,8 @@
|
|||||||
|
|
||||||
//删除财务信息
|
//删除财务信息
|
||||||
function deleteAccountHead(accountHeadID, thisOrganId, totalPrice){
|
function deleteAccountHead(accountHeadID, thisOrganId, totalPrice){
|
||||||
$.messager.confirm('删除确认','确定要删除此财务信息吗?',function(r)
|
$.messager.confirm('删除确认','确定要删除此财务信息吗?',function(r) {
|
||||||
{
|
if (r) {
|
||||||
if (r)
|
|
||||||
{
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"post",
|
type:"post",
|
||||||
url: "/accountHead/batchDeleteAccountHeadByIds",
|
url: "/accountHead/batchDeleteAccountHeadByIds",
|
||||||
@@ -511,19 +509,7 @@
|
|||||||
if(res && res.code == 200) {
|
if(res && res.code == 200) {
|
||||||
$("#searchBtn").click();
|
$("#searchBtn").click();
|
||||||
} else {
|
} else {
|
||||||
if(res && res.code == 601){
|
$.messager.alert('删除提示', '删除财务信息失败,请稍后再试!', 'error');
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//此处添加错误处理
|
//此处添加错误处理
|
||||||
|
|||||||
@@ -111,9 +111,6 @@ public class AccountHeadController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create by: qiankunpingtai
|
|
||||||
* website:https://qiankunpingtai.cn
|
|
||||||
* description:
|
|
||||||
* 批量删除账户信息
|
* 批量删除账户信息
|
||||||
* create time: 2019/3/29 10:49
|
* create time: 2019/3/29 10:49
|
||||||
* @Param: ids
|
* @Param: ids
|
||||||
@@ -122,25 +119,8 @@ public class AccountHeadController {
|
|||||||
@RequestMapping(value = "/batchDeleteAccountHeadByIds")
|
@RequestMapping(value = "/batchDeleteAccountHeadByIds")
|
||||||
public Object batchDeleteAccountHeadByIds(@RequestParam("ids") String ids,@RequestParam(value="deleteType",
|
public Object batchDeleteAccountHeadByIds(@RequestParam("ids") String ids,@RequestParam(value="deleteType",
|
||||||
required =false,defaultValue= BusinessConstants.DELETE_TYPE_NORMAL)String deleteType) throws Exception {
|
required =false,defaultValue= BusinessConstants.DELETE_TYPE_NORMAL)String deleteType) throws Exception {
|
||||||
|
|
||||||
JSONObject result = ExceptionConstants.standardSuccess();
|
JSONObject result = ExceptionConstants.standardSuccess();
|
||||||
int i=0;
|
accountHeadService.batchDeleteAccountHeadByIds(ids);
|
||||||
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);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,4 +32,6 @@ public interface AccountItemMapperEx {
|
|||||||
List<AccountItem> getAccountItemListByHeaderIds(@Param("headerIds") String[] headerIds);
|
List<AccountItem> getAccountItemListByHeaderIds(@Param("headerIds") String[] headerIds);
|
||||||
|
|
||||||
List<AccountItem> getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds);
|
List<AccountItem> getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds);
|
||||||
|
|
||||||
|
int batchDeleteAccountItemByHeadIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids);
|
||||||
}
|
}
|
||||||
@@ -320,6 +320,9 @@ public class AccountHeadService {
|
|||||||
String [] idArray=ids.split(",");
|
String [] idArray=ids.split(",");
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try{
|
try{
|
||||||
|
//删除主表
|
||||||
|
result = accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||||
|
//删除子表
|
||||||
result = accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
result = accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.writeFail(logger, e);
|
JshException.writeFail(logger, e);
|
||||||
|
|||||||
@@ -96,4 +96,14 @@
|
|||||||
)
|
)
|
||||||
and ifnull(delete_flag,'0') !='1'
|
and ifnull(delete_flag,'0') !='1'
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
Reference in New Issue
Block a user