This commit is contained in:
xuhaihui 2025-12-03 17:09:07 +08:00
parent 624f60211a
commit c51f8b4850
1 changed files with 17 additions and 4 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.math.BigDecimal;
@ -47,10 +48,22 @@ public class MaterialInBillOrgSubmitValidatorOp extends AbstractOperationService
if (fiaccountOrg == null) {
return;
}
QFilter f1 = new QFilter("number", QCP.equals, "ecma_materialinbill");
QFilter f2 = new QFilter("zcgj_org.fbasedataid", QCP.in, fiaccountOrg.getPkValue());
DynamicObject zcgj_authorizedcompany = BusinessDataServiceHelper.loadSingle("zcgj_authorizedcompany",
new QFilter[]{f1.and(f2)});//入库单公司过滤
DynamicObject supplier = ecma_MaterialInBill.getDynamicObject("supplier");//供应商
if (supplier == null) {
return;
}
QFilter filter1 = new QFilter("zcgj_supplier.fbasedataid", QCP.in, supplier.getPkValue());
DynamicObject zcgj_groupbuysupplier = QueryServiceHelper.queryOne("zcgj_groupbuysupplier",
"id", new QFilter[]{filter1});//集采供应商
if (zcgj_groupbuysupplier != null) {
return;
}
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org.id", QCP.equals, fiaccountOrg.getPkValue());
filter.and(new QFilter("zcgj_needcompare", QCP.equals, true));
DynamicObject zcgj_authorizedcompany = QueryServiceHelper.queryOne("zcgj_companybelong",
"id", new QFilter[]{filter});//公司归属区域
if (zcgj_authorizedcompany != null) {
DynamicObjectCollection entryEntityCollection = ecma_MaterialInBill.getDynamicObjectCollection("entryentity");//入库单分录
boolean isPrice = false;