diff --git a/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java new file mode 100644 index 0000000..13d5e16 --- /dev/null +++ b/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java @@ -0,0 +1,59 @@ +package shkd.repc.recon.formplugin; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.metadata.IDataEntityType; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.IFormView; +import kd.bos.form.events.SetFilterEvent; +import kd.bos.form.field.BasedataEdit; +import kd.bos.form.field.events.BeforeF7SelectEvent; +import kd.bos.form.field.events.BeforeF7SelectListener; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; + +import java.util.ArrayList; +import java.util.EventObject; +import java.util.List; + +public class ContractTypeListPlugin extends AbstractListPlugin { + +// @Override +// public void registerListener(EventObject e) { +// super.registerListener(e); +// +// BasedataEdit control = this.getControl("contemplate"); +// control.addBeforeF7SelectListener(this); +// } + +// @Override +// public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) { +// +// String name = beforeF7SelectEvent.getProperty().getName(); +// List qFilters = new ArrayList<>(); +// if ("contemplate".equals(name)) { +//// qFilters.add(new QFilter("1", QCP.equals, "1")); +// List customQFilters = beforeF7SelectEvent.getCustomQFilters(); +// beforeF7SelectEvent.setCustomQFilters(qFilters); +// } +// +// } + + + @Override + public void setFilter(SetFilterEvent e) { + super.setFilter(e); + IFormView parentView = this.getView().getParentView(); + IDataModel model = parentView.getModel(); + DynamicObject dataEntity = model.getDataEntity(); + IDataEntityType dataEntityType = dataEntity.getDataEntityType(); + String name = dataEntityType.getName(); + if ("recon_contractbill".equals(name)) { + List qFiletrs = e.getQFilters(); + qFiletrs.removeAll(qFiletrs); + qFiletrs.add(new QFilter("status", QCP.equals, "C")); + qFiletrs.add(new QFilter("enable", QCP.equals, "1")); + } + } +} diff --git a/main/java/shkd/todotask/closeTaskPagePlugin.java b/main/java/shkd/todotask/closeTaskPagePlugin.java index 4135eed..d9d7eeb 100644 --- a/main/java/shkd/todotask/closeTaskPagePlugin.java +++ b/main/java/shkd/todotask/closeTaskPagePlugin.java @@ -28,7 +28,7 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin { if ("zhiyuan".equals(apptype)) { try { view.close(); - }catch (Exception e) { + }catch (Exception e) { logger.info("发送指令时异常" + e.getMessage()); throw new RuntimeException(e); } diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 497c75f..8301f1f 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -34,7 +34,15 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { * @param approvers 人员信息集合 */ private List getApprovers(List userIds, List approvers) { + + List distinctUserIds = new ArrayList<>(); for (Long userId : userIds) { + if (!distinctUserIds.contains(userId)) { + distinctUserIds.add(userId); + } + } + + for (Long userId : distinctUserIds) { DynamicObject user = BusinessDataServiceHelper.loadSingle(userId, "bos_user"); approvers.add(user); }