国外住宿标准增加自动取数
This commit is contained in:
parent
b6adb20b87
commit
c55ed5d85a
|
@ -1,12 +1,18 @@
|
||||||
package zcgj.zcdev.zcdev.fs.plugin.form;
|
package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||||
|
|
||||||
import kd.bos.bill.AbstractBillPlugIn;
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
import kd.bos.form.ConfirmCallBackListener;
|
import kd.bos.form.ConfirmCallBackListener;
|
||||||
import kd.bos.form.MessageBoxOptions;
|
import kd.bos.form.MessageBoxOptions;
|
||||||
import kd.bos.form.MessageBoxResult;
|
import kd.bos.form.MessageBoxResult;
|
||||||
import kd.bos.form.control.events.BeforeClickEvent;
|
import kd.bos.form.control.events.BeforeClickEvent;
|
||||||
import kd.bos.form.control.events.BeforeItemClickEvent;
|
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||||
|
import kd.bos.form.control.events.ItemClickEvent;
|
||||||
import kd.bos.form.events.MessageBoxClosedEvent;
|
import kd.bos.form.events.MessageBoxClosedEvent;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
@ -18,13 +24,8 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen
|
||||||
public void registerListener(EventObject e) {
|
public void registerListener(EventObject e) {
|
||||||
super.registerListener(e);
|
super.registerListener(e);
|
||||||
//监听工具栏按钮点击事件
|
//监听工具栏按钮点击事件
|
||||||
this.addItemClickListeners("zcgj_auto_get_data");
|
this.addItemClickListeners("advcontoolbarap");
|
||||||
this.addClickListeners("zcgj_auto_get_data");
|
//this.addClickListeners("advcontoolbarap");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeClick(BeforeClickEvent evt) {
|
|
||||||
super.beforeClick(evt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,7 +35,7 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen
|
||||||
evt.setCancel(true);
|
evt.setCancel(true);
|
||||||
ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("submitconfirm", this);
|
ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("submitconfirm", this);
|
||||||
//设置页面确认框,参数为:标题,选项框类型,回调监听
|
//设置页面确认框,参数为:标题,选项框类型,回调监听
|
||||||
this.getView().showConfirm("您确认提交该办公用品登记单吗?", MessageBoxOptions.YesNoCancel, confirmCallBackListener);
|
this.getView().showConfirm("此操作将会覆盖现有当前标准明细数据。", MessageBoxOptions.YesNo, confirmCallBackListener);
|
||||||
}
|
}
|
||||||
super.beforeItemClick(evt);
|
super.beforeItemClick(evt);
|
||||||
}
|
}
|
||||||
|
@ -47,11 +48,28 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen
|
||||||
if (MessageBoxResult.Yes.equals(messageBoxClosedEvent.getResult())) {
|
if (MessageBoxResult.Yes.equals(messageBoxClosedEvent.getResult())) {
|
||||||
//如果点击确认按钮,则调用提交操作
|
//如果点击确认按钮,则调用提交操作
|
||||||
// this.getView().invokeOperation("submit");
|
// this.getView().invokeOperation("submit");
|
||||||
this.getView().showMessage("你好");
|
//QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司
|
||||||
|
DynamicObject[] consumeStays = BusinessDataServiceHelper.load("zcgj_consume_stays", "zcgj_tripexpenseitem,zcgj_triparea,zcgj_currency," +
|
||||||
|
"zcgj_standardamount,zcgj_highseasonstandardam", new QFilter[]{});
|
||||||
|
DynamicObjectCollection entryEntity = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");
|
||||||
|
entryEntity.clear();
|
||||||
|
getView().updateView();
|
||||||
|
for (DynamicObject dynamicObject : consumeStays) {
|
||||||
|
DynamicObject dynamicObject1 = entryEntity.addNew();
|
||||||
|
dynamicObject1.set("tripstandardtype",dynamicObject.getDynamicObject("zcgj_tripexpenseitem"));//差旅项目
|
||||||
|
dynamicObject1.set("triparea",dynamicObject.getDynamicObject("zcgj_triparea"));//出差地域
|
||||||
|
dynamicObject1.set("currency",dynamicObject.getDynamicObject("zcgj_currency"));//币别
|
||||||
|
dynamicObject1.set("standardamount",dynamicObject.getBigDecimal("zcgj_standardamount"));//标准人天
|
||||||
|
dynamicObject1.set("highseasonstandardamount",dynamicObject.getBigDecimal("zcgj_highseasonstandardam"));//旺季标准
|
||||||
|
}
|
||||||
|
getView().updateView();
|
||||||
|
if(consumeStays!=null){
|
||||||
|
this.getView().showMessage("取数完成,共获取"+consumeStays.length+"条数据!");
|
||||||
|
}else{
|
||||||
|
this.getView().showMessage("取数完成,共获取0条数据!");
|
||||||
|
}
|
||||||
} else if (MessageBoxResult.No.equals(messageBoxClosedEvent.getResult())) {
|
} else if (MessageBoxResult.No.equals(messageBoxClosedEvent.getResult())) {
|
||||||
|
|
||||||
} else if (MessageBoxResult.Cancel.equals(messageBoxClosedEvent.getResult())) {
|
|
||||||
// 点击取消的相关处理逻辑。。。。
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue