|
|
@@ -4,15 +4,13 @@ import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.dataentity.utils.StringUtils;
|
|
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
|
|
-import kd.bos.form.CloseCallBack;
|
|
|
-import kd.bos.form.FormShowParameter;
|
|
|
-import kd.bos.form.IFormView;
|
|
|
-import kd.bos.form.ShowType;
|
|
|
+import kd.bos.form.*;
|
|
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
import kd.bos.form.events.ClosedCallBackEvent;
|
|
|
import kd.bos.form.operate.FormOperate;
|
|
|
import kd.bos.list.IListView;
|
|
|
+import kd.bos.list.ListShowParameter;
|
|
|
import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import nckd.jxccl.swc.constants.SwcConstant;
|
|
|
@@ -37,8 +35,41 @@ public class AgencyBillList extends AbstractListPlugin {
|
|
|
if (StringUtils.equals(opKey, "donothing_batchupdate")) {
|
|
|
this.openBatchUpdateWindow(args);
|
|
|
}
|
|
|
+ else if (StringUtils.equals(opKey, "donothing_selectorg")) {
|
|
|
+ this.doSelectOrg(args);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void doSelectOrg (BeforeDoOperationEventArgs args) {
|
|
|
+ //创建弹出列表界面对象,ListShowParameter 表示弹出页面为列表界面
|
|
|
+ ListShowParameter listShowParameter = new ListShowParameter();
|
|
|
+ //设置F7列表表单模板
|
|
|
+ listShowParameter.setFormId("hbp_hislistf7");
|
|
|
+ //设置BillFormId为基础资料的标识
|
|
|
+ listShowParameter.setBillFormId("hsas_payrollgrp");
|
|
|
+ //设置弹出页面标题
|
|
|
+ listShowParameter.setCaption("薪资核算组选择界面");
|
|
|
+ //设置弹出页面的打开方式
|
|
|
+ listShowParameter.getOpenStyle().setShowType(ShowType.Modal);
|
|
|
+ //设置打开页面的大小
|
|
|
+ StyleCss inlineStyleCss = new StyleCss();
|
|
|
+ inlineStyleCss.setHeight("580");
|
|
|
+ inlineStyleCss.setWidth("960");
|
|
|
+ listShowParameter.getOpenStyle().setInlineStyleCss(inlineStyleCss);
|
|
|
+ //LookUp必须为true,该界面才是可选界面
|
|
|
+ listShowParameter.setLookUp(true);
|
|
|
+ //是否只显示审核的数据
|
|
|
+ listShowParameter.setShowApproved(true);
|
|
|
+ //是否只显示只启用的数据
|
|
|
+ listShowParameter.setShowUsed(true);
|
|
|
+ //设置子页面关闭回调参数,回调标识为XXX setControlKey用来设置f7选择的数据返回给哪个字段
|
|
|
+ CloseCallBack closeCallBack = new CloseCallBack(this, "selectorg");
|
|
|
+ listShowParameter.setCloseCallBack(closeCallBack);
|
|
|
+ //弹出F7选择界面
|
|
|
+ this.getView().showForm(listShowParameter);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param args
|
|
|
@@ -91,6 +122,33 @@ public class AgencyBillList extends AbstractListPlugin {
|
|
|
}
|
|
|
view.invokeOperation("refresh");
|
|
|
}
|
|
|
+ else if ("selectorg".equals(actionId)) {
|
|
|
+ ListSelectedRowCollection listSelectedRowCollection = (ListSelectedRowCollection) closedCallBackEvent.getReturnData();
|
|
|
+
|
|
|
+ if (listSelectedRowCollection.size() > 0) {
|
|
|
+ Object payRollGrpId = listSelectedRowCollection.get(0).getPrimaryKeyValue();
|
|
|
+ // 当前单据界面选择的数据
|
|
|
+ ListSelectedRowCollection selectedRows = listview.getSelectedRows();
|
|
|
+ Object[] entryIds = selectedRows.getEntryPrimaryKeyValues();
|
|
|
+
|
|
|
+ List<Long> entryIdsList = Arrays.stream(entryIds).map(obj -> {
|
|
|
+ return (Long) obj;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ QFilter filter = new QFilter("nckd_entryentity.id", "in", entryIdsList);
|
|
|
+ DynamicObject[] billDyns = SwcConstant.AGENCYPAYBILL_ENTITY.load("id, nckd_entryentity.nckd_payrollgrp", new QFilter[]{filter});
|
|
|
+ // 批量更新
|
|
|
+ for(DynamicObject bill : billDyns) {
|
|
|
+ DynamicObjectCollection entryDyns = bill.getDynamicObjectCollection("nckd_entryentity");
|
|
|
+ for(DynamicObject entry : entryDyns) {
|
|
|
+ if(entryIdsList.contains(entry.getLong("id"))) {
|
|
|
+ entry.set("nckd_payrollgrp", payRollGrpId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SwcConstant.AGENCYPAYBILL_ENTITY.update(billDyns);
|
|
|
+ }
|
|
|
+ view.invokeOperation("refresh");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|