解决财务单据删除逻辑的bug

This commit is contained in:
季圣华
2020-10-05 20:32:12 +08:00
parent ce3fbfb557
commit 3534c26ae3
5 changed files with 19 additions and 38 deletions

View File

@@ -111,9 +111,6 @@ public class AccountHeadController {
}
/**
* create by: qiankunpingtai
* websitehttps://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;
}

View File

@@ -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);
}

View File

@@ -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);