工序成本预算添加保存校验,校验新增单据是否存在相同的年份加项目,且不是源单修改提交

This commit is contained in:
xuhaihui 2025-06-12 10:00:28 +08:00
parent bbcec0604a
commit 4766b8ae49
1 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import kd.bos.entity.validate.AbstractValidator;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
//工序成本预算单提交操作插件验证项目和年份的组合是否已经存在
//工序成本预算单保存提交操作插件验证项目和年份的组合是否已经存在且只有一个
public class AimcostcbsBllSubmitOp extends AbstractOperationServicePlugIn {
@Override
@ -37,6 +37,9 @@ public class AimcostcbsBllSubmitOp extends AbstractOperationServicePlugIn {
filter.and(new QFilter("project", "=", project.getPkValue()));
DynamicObject ecco_aimcostbillcbs = BusinessDataServiceHelper.loadSingle("ecco_aimcostbillcbs", "id", new QFilter[]{filter});
if (ecco_aimcostbillcbs != null) {
if (dataEntity.getPkValue().equals(ecco_aimcostbillcbs.getPkValue())){
continue;
}
this.addFatalErrorMessage(extendedDataEntity, "该年份的项目已编制预算,请勿重复创建!");
}
}