Skip to content

Commit

Permalink
解决bug:开启出入库管理之后,在给采购入库单做批量入库的时候,需要进行一下校验
Browse files Browse the repository at this point in the history
  • Loading branch information
jishenghua committed Aug 14, 2024
1 parent 7d0ae0a commit 841d30f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ public class ExceptionConstants {
//单据录入-关联请购单号和关联订单号不能同时录入
public static final int DEPOT_ITEM_EXIST_REPEAT_NO_FAILED_CODE = 8500029;
public static final String DEPOT_ITEM_EXIST_REPEAT_NO_FAILED_MSG = "抱歉,关联请购单号和关联订单号不能同时录入";
//单据录入-单据最新状态不能进行批量操作
public static final int DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_CODE = 8500030;
public static final String DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_MSG = "抱歉,单据:%s最新状态不能进行批量操作";

/**
* 单据明细信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,12 @@ public void batchAddDepotHeadAndDetail(String ids, HttpServletRequest request) t
String prefixNo = BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType())?"QTRK":"QTCK";
//关联单据单号
String oldNumber = depotHead.getNumber();
//校验单据最新状态不能进行批量操作
if("0".equals(depotHead.getStatus()) || "2".equals(depotHead.getStatus()) || "9".equals(depotHead.getStatus())) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_MSG, oldNumber, depotHead.getType()));
}
//校验是否是部分入库或者部分出库
if("3".equals(depotHead.getStatus())) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_EXIST_PARTIALLY_STATUS_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_ITEM_EXIST_PARTIALLY_STATUS_FAILED_MSG, oldNumber, depotHead.getType()));
Expand Down

0 comments on commit 841d30f

Please sign in to comment.