diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyapplybillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyapplybillPlugin.java index bda6429..0b66015 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyapplybillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyapplybillPlugin.java @@ -12,6 +12,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.sdk.plugin.Plugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; import java.util.*; @@ -35,16 +36,29 @@ public class DailyapplybillPlugin extends AbstractBillPlugIn implements Plugin { comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("往返家居地"), "gohome_apply")); comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); comboList.add(new ComboItem(new LocaleString("工会经费申请"), "union_funding")); }else{ - comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); - comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); - comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); - comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); - comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); - comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); - comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + Long companyId = costcompany.getLong("id"); + if (OrgCheckUtils.isKS(companyId)) { + comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); + comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); + comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); + comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); + comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); + comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("往返家居地"), "gohome_apply")); + comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + } else { + comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); + comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); + comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); + comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); + comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); + comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + } } ComboEdit comboEdit = getView().getControl("zcgj_apply_type"); comboEdit.setComboItems(comboList); @@ -68,17 +82,30 @@ public class DailyapplybillPlugin extends AbstractBillPlugIn implements Plugin { comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("往返家居地"), "gohome_apply")); comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); comboList.add(new ComboItem(new LocaleString("工会经费申请"), "union_funding")); - }else{ - comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); - comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); - comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); - comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); - comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); - comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); - comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + } else { + Long companyId = newValue.getLong("id"); + if (OrgCheckUtils.isKS(companyId)) { + comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); + comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); + comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); + comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); + comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); + comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("往返家居地"), "gohome_apply")); + comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + } else { + comboList.add(new ComboItem(new LocaleString("采购申请(非工程物资)"), "purchase_apply")); + comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); + comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); + comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply")); + comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental")); + comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); + comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); + } } ComboEdit comboEdit = getView().getControl("zcgj_apply_type"); comboEdit.setComboItems(comboList); diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java index e98eaf7..346437d 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java @@ -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, "“是否来往家居地”勾选后必须关联往返家居地的费用申请!"); + } + } } } }