fix(ic): 优化批次号校验逻辑

- 在进行批次号校验时,增加对单据状态的判断
This commit is contained in:
mzr 2025-09-05 09:16:46 +08:00
parent cf3e898c86
commit 6ec98b7ab5
1 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import nc.vo.ic.pub.util.StringUtil;
import nc.vo.ic.pub.util.ValueCheckUtil; import nc.vo.ic.pub.util.ValueCheckUtil;
import nc.vo.ml.NCLangRes4VoTransl; import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.BusinessException; import nc.vo.pub.BusinessException;
import nc.vo.pub.VOStatus;
import nc.vo.pub.lang.UFBoolean; import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate; import nc.vo.pub.lang.UFDate;
import nc.vo.pubapp.pattern.data.ValueUtils; import nc.vo.pubapp.pattern.data.ValueUtils;
@ -255,7 +256,9 @@ public class BatchCheckImpl implements IBatchCheck {
private boolean isBatchEmpty(ICBillBodyVO body, ICBillHeadVO head) { private boolean isBatchEmpty(ICBillBodyVO body, ICBillHeadVO head) {
boolean isBatchEmpty = StringUtil.isSEmptyOrNull(body.getVbatchcode()); boolean isBatchEmpty = StringUtil.isSEmptyOrNull(body.getVbatchcode());
// 借料类型的其它入库跳过批次号校验 int status = head.getStatus();
if (status == VOStatus.UNCHANGED) {
// 借料类型的其它入库跳过批次号校验
String typeCode = ""; String typeCode = "";
try { try {
typeCode = SysInitQuery.getParaString(head.getPk_org(), "ICIN_TYPE"); typeCode = SysInitQuery.getParaString(head.getPk_org(), "ICIN_TYPE");
@ -265,6 +268,7 @@ public class BatchCheckImpl implements IBatchCheck {
if (!"".equals(typeCode) && typeCode.equals(head.getVtrantypecode())) { if (!"".equals(typeCode) && typeCode.equals(head.getVtrantypecode())) {
isBatchEmpty = false; isBatchEmpty = false;
} }
}
boolean isNumNotEmpty = body.getNnum() != null && !NCBaseTypeUtils.isNullOrZero(body.getNnum()); boolean isNumNotEmpty = body.getNnum() != null && !NCBaseTypeUtils.isNullOrZero(body.getNnum());
return isBatchEmpty && isNumNotEmpty; return isBatchEmpty && isNumNotEmpty;
} }