通过redis来进行单据的单号重复判断(修改判断提示)

This commit is contained in:
jishenghua
2025-07-10 09:29:53 +08:00
parent 07d3d70cf6
commit 9330629196
2 changed files with 5 additions and 2 deletions

View File

@@ -451,6 +451,9 @@ public class ExceptionConstants {
//单据录入-单据在该状态不能强制结单
public static final int DEPOT_HEAD_FORCE_CLOSE_FAILED_CODE = 8500031;
public static final String DEPOT_HEAD_FORCE_CLOSE_FAILED_MSG = "抱歉,单据:%s在该状态不能强制结单";
//单据录入-请勿重复提交单据
public static final int DEPOT_HEAD_SUBMIT_REPEAT_FAILED_CODE = 8500032;
public static final String DEPOT_HEAD_SUBMIT_REPEAT_FAILED_MSG = "抱歉,请勿重复提交单据";
/**
* 单据明细信息

View File

@@ -1115,8 +1115,8 @@ public class DepotHeadService {
String keyNo = userInfo.getLoginName() + "_" + depotHead.getNumber();
String keyValue = redisService.getCacheObject(keyNo);
if(StringUtil.isNotEmpty(keyValue)) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_MSG));
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_SUBMIT_REPEAT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_SUBMIT_REPEAT_FAILED_MSG));
} else {
redisService.storageKeyWithTime(keyNo, depotHead.getNumber(), 10L);
}