|
@@ -2,6 +2,7 @@ package nckd.jimin.jyyy.fi.plugin.form;
|
|
|
|
|
|
import kd.bos.bill.AbstractBillPlugIn;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
import kd.bos.entity.datamodel.events.BizDataEventArgs;
|
|
|
import kd.bos.entity.property.BasedataProp;
|
|
|
import kd.bos.form.field.BasedataEdit;
|
|
@@ -13,9 +14,9 @@ import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
|
|
-import java.util.EventObject;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 单据标识:费用申请单(nckd_er_dailyapplybil_ext)
|
|
@@ -51,9 +52,13 @@ public class DailyApplyBillEditPlugin extends AbstractBillPlugIn implements Befo
|
|
|
QFilter viewTypeFilter = QFilter.fromSerializedString(customParams.get("nckd_viewTypeFilter").toString());
|
|
|
|
|
|
qFilters.add(viewTypeFilter);
|
|
|
- } else if(this.getModel().getValue("nckd_payviewtype") != null){
|
|
|
- DynamicObject viewType = (DynamicObject) this.getModel().getValue("nckd_payviewtype");
|
|
|
- QFilter viewTypeFilter = new QFilter("nckd_payviewtype.id", QCP.equals, viewType.getLong("id"));
|
|
|
+ } else if(this.getModel().getValue("nckd_payviewtypemul") != null){
|
|
|
+ DynamicObjectCollection collection = (DynamicObjectCollection)this.getModel().getValue("nckd_payviewtypemul");
|
|
|
+ List<Long> idList = (List)collection.stream().mapToLong((x) -> {
|
|
|
+ return x.getLong("fbasedataid_id");
|
|
|
+ }).boxed().collect(Collectors.toList());
|
|
|
+
|
|
|
+ QFilter viewTypeFilter = new QFilter("nckd_payviewtype.id", QCP.in, idList);
|
|
|
|
|
|
qFilters.add(viewTypeFilter);
|
|
|
}
|
|
@@ -68,18 +73,28 @@ public class DailyApplyBillEditPlugin extends AbstractBillPlugIn implements Befo
|
|
|
if(customParams.get("viewType") != null){
|
|
|
String[] typeStrings = customParams.get("viewType").toString().split(",");
|
|
|
|
|
|
- QFilter qFilter = new QFilter("number", QCP.equals, typeStrings[0]);
|
|
|
+ QFilter qFilter = new QFilter("number", QCP.in, typeStrings);
|
|
|
+
|
|
|
+ DynamicObject[] viewTypeCols = BusinessDataServiceHelper.load("nckd_payviewtype", "id, number, name", qFilter.toArray());
|
|
|
+ if(viewTypeCols != null && viewTypeCols.length > 0){
|
|
|
+ //页面类型赋值
|
|
|
+ this.getModel().setValue("nckd_payviewtype", viewTypeCols[0]);
|
|
|
+
|
|
|
+ List<Long> idList = Arrays.stream(viewTypeCols)
|
|
|
+ .map(type -> type.getLong("id"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ Object[] basedataIds = idList.toArray();
|
|
|
+ //页面类型多选赋值
|
|
|
+ this.getModel().setValue("nckd_payviewtypemul", basedataIds);
|
|
|
|
|
|
- DynamicObject viewTypeInfo = BusinessDataServiceHelper.loadSingle("nckd_payviewtype", qFilter.toArray());
|
|
|
- if(viewTypeInfo != null){
|
|
|
- this.getModel().setValue("nckd_payviewtype", viewTypeInfo);
|
|
|
/***
|
|
|
* 当页面类型为 资金类时,往来类型为 内部公司
|
|
|
* turborao 2025/05/15
|
|
|
*/
|
|
|
- String viewType = viewTypeInfo.getString("name");
|
|
|
- if(viewType.equals("资金类")) {
|
|
|
- this.getModel().setValue("billpayertype", "bos_org");
|
|
|
+ for(DynamicObject viewType : viewTypeCols){
|
|
|
+ if("资金类".equals(viewType.getString("name"))) {
|
|
|
+ this.getModel().setValue("billpayertype", "bos_org");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|