parent
cf9b71da78
commit
eba6622da0
|
@ -0,0 +1,44 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.ap;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.card.adapter.Button;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.EventObject;
|
||||
|
||||
/**
|
||||
* 动态表单插件
|
||||
*/
|
||||
public class ApHandSettleFormPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
private final static Log logger = LogFactory.getLog(ApHandSettleFormPlugin.class);
|
||||
|
||||
@Override
|
||||
public void afterCreateNewData(EventObject e) {
|
||||
// 获取当前页面的FormShowParameter对象
|
||||
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||
// 获取自定义参数
|
||||
JSONObject e_asstact = formShowParameter.getCustomParam("e_asstact");
|
||||
JSONObject settleorg = formShowParameter.getCustomParam("settleorg");
|
||||
DynamicObject supplier = null;
|
||||
DynamicObject bos_org = null;
|
||||
if (e_asstact != null&&settleorg!=null) {
|
||||
String number = e_asstact.get("number").toString();
|
||||
String number1 = settleorg.get("number").toString();
|
||||
supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("number", QCP.equals, number)});
|
||||
bos_org = BusinessDataServiceHelper.loadSingle("bos_org", new QFilter[]{new QFilter("number", QCP.equals, number1)});
|
||||
this.getModel().setValue("org", bos_org);
|
||||
this.getModel().setValue("asstactvalue", supplier);
|
||||
}
|
||||
this.getModel().setValue("settlerelation", "apself");
|
||||
}
|
||||
}
|
|
@ -37,22 +37,24 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements Plugin
|
|||
// 获取当前页面的FormShowParameter对象
|
||||
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||
// 获取自定义参数
|
||||
String billno = (String)formShowParameter.getCustomParam("purcontract_billno");
|
||||
String billno = (String) formShowParameter.getCustomParam("purcontract_billno");
|
||||
JSONObject purcontract_supplier = formShowParameter.getCustomParam("purcontract_supplier");
|
||||
String number = purcontract_supplier.get("number").toString();
|
||||
DynamicObject supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("number", QCP.equals, number)});
|
||||
DynamicObject supplier = null;
|
||||
if (purcontract_supplier != null) {
|
||||
String number = purcontract_supplier.get("number").toString();
|
||||
supplier = BusinessDataServiceHelper.loadSingle("bd_supplier", new QFilter[]{new QFilter("number", QCP.equals, number)});
|
||||
}
|
||||
|
||||
// 把参数值赋值到页面文本字段上
|
||||
DynamicObject purcontract = BusinessDataServiceHelper.loadSingle("conm_purcontract", new QFilter[]{new QFilter("billno", QCP.equals, billno)});
|
||||
DynamicObjectCollection tqq9_supplier = this.getModel().getDataEntity().getDynamicObjectCollection("tqq9_supplier");
|
||||
DynamicObject newsupplier = new DynamicObject(tqq9_supplier.getDynamicObjectType());
|
||||
if(supplier!=null){
|
||||
newsupplier.set("fbasedataId", supplier);
|
||||
tqq9_supplier.add(newsupplier);
|
||||
this.getModel().setValue("tqq9_supplier", tqq9_supplier);
|
||||
}
|
||||
if (supplier != null) {
|
||||
newsupplier.set("fbasedataId", supplier);
|
||||
tqq9_supplier.add(newsupplier);
|
||||
this.getModel().setValue("tqq9_supplier", tqq9_supplier);
|
||||
}
|
||||
this.getModel().setValue("tqq9_conm_purcontract", purcontract);
|
||||
// getView().updateView();
|
||||
|
||||
}
|
||||
|
||||
|
@ -60,10 +62,10 @@ public class RebateRulesBillPlugin extends AbstractBillPlugIn implements Plugin
|
|||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
String itemKey = evt.getItemKey();
|
||||
if (StringUtils.equals("tqq9_confirm",itemKey)) {
|
||||
if (StringUtils.equals("tqq9_confirm", itemKey)) {
|
||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||
HashMap<String,DynamicObject> map =new HashMap<>();
|
||||
map.put("tqq9_pur_rebate",dataEntity);
|
||||
HashMap<String, DynamicObject> map = new HashMap<>();
|
||||
map.put("tqq9_pur_rebate", dataEntity);
|
||||
this.getView().returnDataToParent(map);
|
||||
this.getView().close();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class purconmAddRebateRulesPlugin extends AbstractFormPlugin implements P
|
|||
BillShowParameter param = new BillShowParameter();
|
||||
param.setFormId("tqq9_pur_rebate");
|
||||
param.setCustomParam("purcontract_billno", this.getModel().getValue("billno"));
|
||||
param.setCustomParam("purcontract_supplier", (DynamicObject)this.getModel().getValue("supplier"));
|
||||
param.setCustomParam("purcontract_supplier", (DynamicObject) this.getModel().getValue("supplier"));
|
||||
param.setCloseCallBack(new CloseCallBack(this, "entry_rebateSync"));
|
||||
param.getOpenStyle().setShowType(ShowType.Modal);
|
||||
this.getView().showForm(param);
|
||||
|
@ -127,7 +127,9 @@ public class purconmAddRebateRulesPlugin extends AbstractFormPlugin implements P
|
|||
|
||||
|
||||
model.setValue("tqq9_rulename", name, size - 1);//规则名称
|
||||
model.setValue("tqq9_company", stringBuilder.substring(1), size - 1);//主体
|
||||
if (stringBuilder.length() > 0) {
|
||||
model.setValue("tqq9_company", stringBuilder.substring(1), size - 1);//主体
|
||||
}
|
||||
model.setValue("tqq9_brand", tqq9_rebatebrand, size - 1);//品牌
|
||||
model.setValue("tqq9_supplier", tqq9_supplier, size - 1);//供应商
|
||||
model.setValue("tqq9_startdate", tqq9_startdate, size - 1);//返利开始时间
|
||||
|
|
Loading…
Reference in New Issue