parent
86fc8f1416
commit
9e89cf5d25
|
@ -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<QFilter> qFilters = new ArrayList<>();
|
||||
// if ("contemplate".equals(name)) {
|
||||
//// qFilters.add(new QFilter("1", QCP.equals, "1"));
|
||||
// List<QFilter> 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<String> 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<QFilter> qFiletrs = e.getQFilters();
|
||||
List<QFilter> 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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,13 +36,12 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin {
|
|||
}
|
||||
flag = true;
|
||||
} else {
|
||||
// HashMap<String, Object> map = new HashMap<>();
|
||||
// map.put("method", "closeWebView");
|
||||
// String mapString = JSON.toJSONString(map);
|
||||
// view.executeClientCommand("callAPPApi", map);
|
||||
// logger.info("准备发送指令" + mapString);
|
||||
HashMap<String, Object> 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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue