对欠款进行校验
This commit is contained in:
@@ -629,6 +629,13 @@ public class DepotHeadService {
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
//欠款校验
|
||||
if("采购退货".equals(subType) || "销售退货".equals(subType)) {
|
||||
if(depotHead.getChangeAmount().abs().compareTo(depotHead.getDiscountLastMoney().add(depotHead.getOtherMoney()))!=0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
//判断用户是否已经登录过,登录过不再处理
|
||||
User userInfo=userService.getCurrentUser();
|
||||
depotHead.setCreator(userInfo==null?null:userInfo.getId());
|
||||
@@ -708,6 +715,13 @@ public class DepotHeadService {
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
//欠款校验
|
||||
if("采购退货".equals(subType) || "销售退货".equals(subType)) {
|
||||
if(depotHead.getChangeAmount().abs().compareTo(depotHead.getDiscountLastMoney().add(depotHead.getOtherMoney()))!=0) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
if(StringUtil.isNotEmpty(depotHead.getAccountIdList())){
|
||||
depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user