fix: 1.信保额度申请提交效验

This commit is contained in:
ljw 2025-03-04 20:50:26 +08:00
parent 94a7b54425
commit 15efe2eeb7

View File

@ -42,16 +42,17 @@ public class CsrCreditSubmitLineValidator extends AbstractValidator {
String yemCustomer = customer.getString("yem_customer");
if (!"".equals(yemCustomer)) {
qFilter.and(new QFilter("yem_customer.yem_customer", QCP.equals, yemCustomer));
}qFilter.and(new QFilter("yem_payment.id", QCP.equals, method.getLong("id")));
if ("信用证".contains(method.getString("name"))) {
qFilter.and(new QFilter("yem_swiftcode", QCP.equals, swiftcode));
}
DynamicObject[] objs = BusinessDataServiceHelper.load(dataEntity.getDynamicObjectType().getName(), "id", qFilter.toArray());
if (objs.length > 0) {
qFilter.and(new QFilter("yem_payment.id", QCP.equals, method.getLong("id")));
if ("信用证".contains(method.getString("name"))) {
this.addErrorMessage(dataEntitie, "相同客户+支付方式+SWIFT CODE已存在一个客户信保额度申请单请检查数据");
} else {
this.addErrorMessage(dataEntitie, "相同客户+支付方式,已存在一个客户信保额度申请单,请检查数据!");
qFilter.and(new QFilter("yem_swiftcode", QCP.equals, swiftcode));
}
DynamicObject[] objs = BusinessDataServiceHelper.load(dataEntity.getDynamicObjectType().getName(), "id", qFilter.toArray());
if (objs.length > 0) {
if ("信用证".contains(method.getString("name"))) {
this.addErrorMessage(dataEntitie, "相同客户+支付方式+SWIFT CODE已存在一个客户信保额度申请单请检查数据");
} else {
this.addErrorMessage(dataEntitie, "相同客户+支付方式,已存在一个客户信保额度申请单,请检查数据!");
}
}
}
}