费用报销单添加是否来往家居地是否关联往返家居地的费用申请的提交校验

This commit is contained in:
xuhaihui 2026-01-05 18:07:01 +08:00
parent b4dd499cf6
commit 112b99d752
1 changed files with 24 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import kd.bos.entity.plugin.PreparePropertysEventArgs;
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 kd.bos.servicehelper.user.UserServiceHelper;
import kd.bos.util.StringUtils;
@ -172,6 +173,29 @@ public class DailyreimbursHomeCheckOp extends AbstractOperationServicePlugIn {
this.addFatalErrorMessage(extendedDataEntity, String.format("往来家居配置有误!"));
}
}
boolean zcgj_is_home = dataEntity.getBoolean("zcgj_is_home");//是否来往家居地
if (zcgj_is_home) {
DynamicObjectCollection writeOffApplyCollection = dataEntity.getDynamicObjectCollection("writeoffapply");//关联申请
if (writeOffApplyCollection.size() > 0) {
int i = 0;
for (DynamicObject writeOffApply : writeOffApplyCollection) {
String applyBillNo = writeOffApply.getString("applybillno");//申请单号
QFilter[] qFilters = new QFilter[]{new QFilter("billno", QCP.equals, applyBillNo)};
DynamicObject er_dailyapplybill = BusinessDataServiceHelper.loadSingle("er_dailyapplybill", "id,zcgj_apply_type", qFilters);//费用申请
if (er_dailyapplybill != null) {
String zcgj_apply_type = er_dailyapplybill.getString("zcgj_apply_type");//事先申请类型
if (zcgj_apply_type.equals("gohome_apply")) {
i++;
}
}
}
if (i == 0) {
this.addFatalErrorMessage(extendedDataEntity, "“是否来往家居地”勾选后必须关联往返家居地的费用申请!");
}
} else {
this.addFatalErrorMessage(extendedDataEntity, "“是否来往家居地”勾选后必须关联往返家居地的费用申请!");
}
}
}
}
}