|
@@ -1,6 +1,9 @@
|
|
|
package fi.em.formPlugin;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.exception.KDBizException;
|
|
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
import kd.bos.form.operate.botp.Draw;
|
|
@@ -15,7 +18,6 @@ public class BusinessProcessingUnAuditEditPlugin extends AbstractListPlugin imp
|
|
|
if (args.getSource() instanceof Draw) {
|
|
|
Draw draw = (Draw) args.getSource();
|
|
|
if (draw.getOperateKey().equals("drawysgz")) {
|
|
|
-// int count = this.getModel().getEntryRowCount("nckd_entryentity1");
|
|
|
// StringBuilder numbers = new StringBuilder();
|
|
|
Object value = this.getModel().getValue("nckd_payeenamev");//获取当前单据付款人
|
|
|
Object nckd_orgv = this.getModel().getValue("nckd_orgv");//获取当前单据付款人
|
|
@@ -27,13 +29,22 @@ public class BusinessProcessingUnAuditEditPlugin extends AbstractListPlugin imp
|
|
|
if (orgv == null) {
|
|
|
throw new KDBizException("收款信息收款人为空!");
|
|
|
}
|
|
|
+ DynamicObjectCollection nckdEntryentity1 = this.getModel().getEntryEntity("nckd_entryentity1");
|
|
|
+ JSONArray jSONArray = new JSONArray();
|
|
|
+ for(int i=0;i<nckdEntryentity1.size();i++){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ DynamicObject dynamicObject1 = nckdEntryentity1.get(i);
|
|
|
+ String nckdTextfield7 = dynamicObject1.getString("nckd_textfield7");
|
|
|
+ jsonObject.put("id",nckdTextfield7);
|
|
|
+ jSONArray.add(jsonObject);
|
|
|
+ }
|
|
|
+ draw.getOption().setVariableValue("JSONArray", jSONArray.toString());
|
|
|
String bdsupplier = dynamicObject.getString("id");//当前单据付款供应商 11
|
|
|
draw.getOption().setVariableValue("bdsupplier", bdsupplier);
|
|
|
String orgnumber = orgv.getString("number");
|
|
|
draw.getOption().setVariableValue("orgnumber", orgnumber);
|
|
|
draw.getOption().setVariableValue("type", "drawysgz");
|
|
|
} else if (draw.getOperateKey().equals("drawyfgz")) {
|
|
|
- //int count = this.getModel().getEntryRowCount("nckd_entryentity2");
|
|
|
Object value = this.getModel().getValue("nckd_payeenamevs");//获取当前单据付款人
|
|
|
Object nckd_orgvs = this.getModel().getValue("nckd_orgvs");//获取当前单据收款人
|
|
|
DynamicObject dynamicObject = (DynamicObject) value;
|
|
@@ -44,6 +55,16 @@ public class BusinessProcessingUnAuditEditPlugin extends AbstractListPlugin imp
|
|
|
if (orgvs == null) {
|
|
|
throw new KDBizException("付款信息付款人为空!");
|
|
|
}
|
|
|
+ DynamicObjectCollection nckdEntryentity1 = this.getModel().getEntryEntity("nckd_entryentity2");
|
|
|
+ JSONArray jSONArray = new JSONArray();
|
|
|
+ for(int i=0;i<nckdEntryentity1.size();i++){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ DynamicObject dynamicObject1 = nckdEntryentity1.get(i);
|
|
|
+ String nckdTextfield7 = dynamicObject1.getString("nckd_bigintfield");
|
|
|
+ jsonObject.put("id",nckdTextfield7);
|
|
|
+ jSONArray.add(jsonObject);
|
|
|
+ }
|
|
|
+ draw.getOption().setVariableValue("JSONArray", jSONArray.toString());
|
|
|
String bdsupplier = dynamicObject.getString("id");//当前单据付款供应商
|
|
|
draw.getOption().setVariableValue("bdsupplier", bdsupplier);
|
|
|
String orgnumber = orgvs.getString("number");
|
|
@@ -60,6 +81,16 @@ public class BusinessProcessingUnAuditEditPlugin extends AbstractListPlugin imp
|
|
|
if (payeenamevs == null) {
|
|
|
throw new KDBizException("收款信息付款人为空!");
|
|
|
}
|
|
|
+ DynamicObjectCollection nckdEntryentity1 = this.getModel().getEntryEntity("nckd_entryentity3");
|
|
|
+ JSONArray jSONArray = new JSONArray();
|
|
|
+ for(int i=0;i<nckdEntryentity1.size();i++){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ DynamicObject dynamicObject1 = nckdEntryentity1.get(i);
|
|
|
+ String nckdTextfield7 = dynamicObject1.getString("nckd_pzhthth");
|
|
|
+ jsonObject.put("id",nckdTextfield7);
|
|
|
+ jSONArray.add(jsonObject);
|
|
|
+ }
|
|
|
+ draw.getOption().setVariableValue("JSONArray", jSONArray.toString());
|
|
|
String bdsupplier = payeenamevs.getString("number");//当前单据付款供应商
|
|
|
draw.getOption().setVariableValue("bdsupplier", bdsupplier);
|
|
|
String orgnumber = dynamicObject.getString("number");
|