|
@@ -0,0 +1,72 @@
|
|
|
+package fi.em.editPlugin;
|
|
|
+
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
+import kd.bos.exception.KDBizException;
|
|
|
+import kd.bos.form.CloseCallBack;
|
|
|
+import kd.bos.form.FormShowParameter;
|
|
|
+import kd.bos.form.ShowType;
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
+import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
+
|
|
|
+public class BusinessProcessingEditPlugin extends AbstractListPlugin implements Plugin {
|
|
|
+ public static String btn_NOTICE = "fkf";
|
|
|
+ public static String btn_NOTICES = "skf";
|
|
|
+ public static String nckd_agentparameterf7 = "nckd_agentparameterf7";
|
|
|
+ private static String bos_org = "bos_org";
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs e) {
|
|
|
+ String operateKey = e.getOperateKey();
|
|
|
+ if (btn_NOTICE.equals(e.getOperateKey())) {
|
|
|
+ Object value = this.getModel().getValue("costcompany");
|
|
|
+ DynamicObjectCollection expenseentryentityWait = this.getModel().getEntryEntity("expenseentryentity_wait");
|
|
|
+ DynamicObject dynamicObject = expenseentryentityWait.get(0);
|
|
|
+ DynamicObject entrycostcompanyWait = dynamicObject.getDynamicObject("entrycostcompany_wait");
|
|
|
+ if(entrycostcompanyWait==null){
|
|
|
+ throw new KDBizException("待摊明细分录为空!");
|
|
|
+ }
|
|
|
+ String orgnumber = entrycostcompanyWait.getString("number");
|
|
|
+ String orgid = entrycostcompanyWait.getString("id");
|
|
|
+ if (orgnumber == null){
|
|
|
+ throw new KDBizException("付费承担公司为空!");
|
|
|
+ }
|
|
|
+ showParameter(nckd_agentparameterf7, btn_NOTICE,orgnumber,orgid);
|
|
|
+ }else if (btn_NOTICES.equals(e.getOperateKey())) {
|
|
|
+ Object value = this.getModel().getValue("costcompany");
|
|
|
+ DynamicObjectCollection expenseentryentityWait = this.getModel().getEntryEntity("expenseentryentity_wait");
|
|
|
+ DynamicObject dynamicObject = expenseentryentityWait.get(0);
|
|
|
+ DynamicObject entrycostcompanyWait = dynamicObject.getDynamicObject("entrycostcompany_wait");
|
|
|
+ if(entrycostcompanyWait==null){
|
|
|
+ throw new KDBizException("待摊明细分录为空!");
|
|
|
+ }
|
|
|
+ String orgnumber = entrycostcompanyWait.getString("number");
|
|
|
+ String orgid = entrycostcompanyWait.getString("id");
|
|
|
+ if (orgnumber == null){
|
|
|
+ throw new KDBizException("付费承担公司为空!");
|
|
|
+ }
|
|
|
+ showParameter(nckd_agentparameterf7, btn_NOTICE,orgnumber,orgid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void showParameter(String formId, String actionId,String orgnumber,String orgid) {
|
|
|
+
|
|
|
+ FormShowParameter ShowParameter = new FormShowParameter();
|
|
|
+
|
|
|
+ ShowParameter.setCustomParam("orgnumber", orgnumber);
|
|
|
+ ShowParameter.setCustomParam("orgid", orgid);
|
|
|
+
|
|
|
+ ShowParameter.setFormId(formId);
|
|
|
+
|
|
|
+
|
|
|
+ ShowParameter.setCaption("动因参数选择");
|
|
|
+
|
|
|
+
|
|
|
+ ShowParameter.setCloseCallBack(new CloseCallBack(this, actionId));
|
|
|
+
|
|
|
+ ShowParameter.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
+
|
|
|
+ this.getView().showForm(ShowParameter);
|
|
|
+ }
|
|
|
+}
|