解决以销订购的单据反审核的bug

This commit is contained in:
季圣华
2023-11-18 17:34:32 +08:00
parent f0fa08c670
commit 8ccb855472
2 changed files with 15 additions and 1 deletions

View File

@@ -415,6 +415,12 @@ public class ExceptionConstants {
//单据录入-单据附件不能超过规定数量
public static final int DEPOT_HEAD_FILE_NUM_LIMIT_CODE = 8500025;
public static final String DEPOT_HEAD_FILE_NUM_LIMIT_MSG = "抱歉,单据附件不能超过%s份";
//单据录入-完成采购的单据不能进行反审核
public static final int DEPOT_HEAD_PURCHASE_STATUS_TWO_CODE = 8500026;
public static final String DEPOT_HEAD_PURCHASE_STATUS_TWO_MSG = "抱歉,完成采购的单据不能进行反审核";
//单据录入-部分采购的单据不能进行反审核
public static final int DEPOT_HEAD_PURCHASE_STATUS_THREE_CODE = 8500027;
public static final String DEPOT_HEAD_PURCHASE_STATUS_THREE_MSG = "抱歉,部分采购的单据不能进行反审核";
/**
* 单据明细信息

View File

@@ -582,13 +582,21 @@ public class DepotHeadService {
for(Long id: ids) {
DepotHead depotHead = getDepotHead(id);
if("0".equals(status)){
if("1".equals(depotHead.getStatus())) {
//进行反审核操作
if("1".equals(depotHead.getStatus()) && "0".equals(depotHead.getPurchaseStatus())) {
dhIds.add(id);
} else if("2".equals(depotHead.getPurchaseStatus())) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_PURCHASE_STATUS_TWO_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_PURCHASE_STATUS_TWO_MSG));
} else if("3".equals(depotHead.getPurchaseStatus())) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_PURCHASE_STATUS_THREE_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_PURCHASE_STATUS_THREE_MSG));
} else {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG));
}
} else if("1".equals(status)){
//进行审核操作
if("0".equals(depotHead.getStatus())) {
dhIds.add(id);
} else {