From 9e89cf5d25f61024279da19818f953fdfe9e2a62 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Wed, 15 Jan 2025 17:36:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=90=88=E5=90=8C=E6=A8=A1=E6=9D=BF=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6=E4=BC=98=E5=8C=96=202.=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E9=A1=B5=E9=9D=A2=E5=85=B3=E9=97=AD=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../formplugin/ContractTypeListPlugin.java | 58 +++++++++++-------- .../shkd/todotask/closeTaskPagePlugin.java | 11 ++-- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java index 13d5e16..61f3f09 100644 --- a/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ContractTypeListPlugin.java @@ -13,37 +13,19 @@ 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; +import java.util.*; 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); + //number like '%1%' AND enable in ('1') AND name like '%11%' AND ctrlstrategy in ('1','2','5','6','7') AND description like '%1%' AND usagecounter = 1 AND createorg.name like '%德必%' + + Set filterKeywords = new HashSet<>(Arrays.asList( + "number", "name", "enable", "ctrlstrategy", + "description", "usagecounter", "createorg.name" + )); IFormView parentView = this.getView().getParentView(); IDataModel model = parentView.getModel(); DynamicObject dataEntity = model.getDataEntity(); @@ -51,9 +33,35 @@ public class ContractTypeListPlugin extends AbstractListPlugin { String name = dataEntityType.getName(); if ("recon_contractbill".equals(name)) { List qFiletrs = e.getQFilters(); + List qFilterList = new ArrayList<>(); + int size = qFiletrs.size(); + if (size > 2) { + QFilter q1 = qFiletrs.get(size - 1); + if (null != q1) { + String string = q1.toString(); + for (String keyword : filterKeywords) { + if (string.contains(keyword)) { + qFilterList.add(q1); + break; + } + } + } + QFilter q2 = qFiletrs.get(size - 2); + if (null != q2) { + String string = q2.toString(); + for (String keyword : filterKeywords) { + if (string.contains(keyword)) { + qFilterList.add(q2); + break; + } + } + } + } qFiletrs.removeAll(qFiletrs); qFiletrs.add(new QFilter("status", QCP.equals, "C")); qFiletrs.add(new QFilter("enable", QCP.equals, "1")); + qFiletrs.addAll(qFilterList); + } } } diff --git a/main/java/shkd/todotask/closeTaskPagePlugin.java b/main/java/shkd/todotask/closeTaskPagePlugin.java index 665b3f0..f50b554 100644 --- a/main/java/shkd/todotask/closeTaskPagePlugin.java +++ b/main/java/shkd/todotask/closeTaskPagePlugin.java @@ -36,13 +36,12 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin { } flag = true; } else { -// HashMap map = new HashMap<>(); -// map.put("method", "closeWebView"); -// String mapString = JSON.toJSONString(map); -// view.executeClientCommand("callAPPApi", map); -// logger.info("准备发送指令" + mapString); + HashMap map = new HashMap<>(); + map.put("method", "closeWebView"); + String mapString = JSON.toJSONString(map); + view.executeClientCommand("callAPPApi", map); + logger.info("准备发送指令" + mapString); logger.info("准备关闭移动页面"); - view.close(); flag = true; } }