入库单日期提交操作校验插件优化

This commit is contained in:
xuhaihui 2025-11-21 16:24:23 +08:00
parent 0fd3ee6f99
commit 645588997d
1 changed files with 46 additions and 36 deletions

View File

@ -10,6 +10,7 @@ import kd.bos.entity.validate.AbstractValidator;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import java.util.Date;
@ -28,6 +29,7 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
e.getFieldKeys().add("zcgj_entryentity");//合同进项发票信息
e.getFieldKeys().add("zcgj_invoice");//发票号码
e.getFieldKeys().add("zcgj_purchaseapply");//采购申请
e.getFieldKeys().add("fiaccountorg");//财务记账组织
}
@Override
@ -45,6 +47,12 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
String matinsource = ecma_MaterialInBill.getString("matinsource");//入库来源
if ("6".equals(matinsource)) {
//入库来源为采购申请
DynamicObject fiaccountorg = ecma_MaterialInBill.getDynamicObject("fiaccountorg");//财务记账组织
if (fiaccountorg != null) {
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org.id", QCP.equals, fiaccountorg.getPkValue());
filter.and(new QFilter("zcgj_checkreqdate", QCP.equals, true));
DynamicObject zcgj_companybelong = QueryServiceHelper.queryOne("zcgj_companybelong", "id", new QFilter[]{filter});
if (zcgj_companybelong != null) {
boolean zcgj_ispurchaseapplys = ecma_MaterialInBill.getBoolean("zcgj_ispurchaseapplys");//多采购申请
if (zcgj_ispurchaseapplys) {
DynamicObjectCollection zcgj_purchaseapplyentryCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_purchaseapplyentry");//采购申请分录
@ -110,3 +118,5 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
}
}
}
}
}