优化《核算维度配置表》
This commit is contained in:
parent
32d8cf4d99
commit
252ffa4709
@ -23,6 +23,7 @@ import kd.bos.entity.function.FunctionTypes;
|
||||
import kd.bos.entity.property.AttachmentProp;
|
||||
import kd.bos.entity.property.IFieldHandle;
|
||||
import kd.bos.entity.tree.TreeNode;
|
||||
import kd.bos.flydb.core.schema.cosmic.translate.EntityPropertyHelper;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.ShowType;
|
||||
@ -30,6 +31,7 @@ import kd.bos.form.control.Control;
|
||||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.servicehelper.MetadataServiceHelper;
|
||||
import yem.base.common.utils.YEM;
|
||||
import yem.wm.bd.util.TreeNodeHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventObject;
|
||||
@ -97,11 +99,11 @@ public class FieldMapBillPlugin extends AbstractBillPlugIn {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param property 字段实体属性
|
||||
* @return String 返回字段名称(包含单据体名称)
|
||||
* @Description: 获取字段的名称
|
||||
* @function 功能
|
||||
* @purposes 用途
|
||||
* @param property 字段实体属性
|
||||
* @return String 返回字段名称(包含单据体名称)
|
||||
*/
|
||||
public String buildPropFullCaption(IDataEntityProperty property) {
|
||||
List<String> captions = new ArrayList();
|
||||
@ -143,10 +145,10 @@ public class FieldMapBillPlugin extends AbstractBillPlugIn {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Description: 跳转《表达式》
|
||||
* @function 创建树形结构,然后跳转《选择单据字段》携带参数
|
||||
* @purposes
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public void showFormula() {
|
||||
@ -196,10 +198,10 @@ public class FieldMapBillPlugin extends AbstractBillPlugIn {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Description: 跳转《选择单据字段》
|
||||
* @function 创建树形结构,然后跳转《选择单据字段》携带参数
|
||||
* @purposes 用途
|
||||
* @return void
|
||||
*/
|
||||
public void showSourceField() {
|
||||
DynamicObject sourceentity = (DynamicObject) this.getModel().getValue("yem_sourceentity");//获取【源单实体】
|
||||
@ -246,11 +248,11 @@ public class FieldMapBillPlugin extends AbstractBillPlugIn {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param returnData 《表达式》的返回值(序列化后的计算表达式)
|
||||
* @return void
|
||||
* @Description: 《表达式》点击确定之后,将信息返回到单据上
|
||||
* @function 功能
|
||||
* @purposes 用途
|
||||
* @param returnData 《表达式》的返回值(序列化后的计算表达式)
|
||||
* @return void
|
||||
*/
|
||||
public void setForMulas(String returnData) {
|
||||
if (StringUtils.isNotBlank(returnData)) {
|
||||
@ -262,23 +264,20 @@ public class FieldMapBillPlugin extends AbstractBillPlugIn {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param returnData 《选择单据字段》的返回值(字段标识)
|
||||
* @return void
|
||||
* @Description: 《选择单据字段》点击确定之后,将信息返回到单据上
|
||||
* @function 功能
|
||||
* @purposes 用途
|
||||
* @param returnData 《选择单据字段》的返回值(字段标识)
|
||||
* @return void
|
||||
*/
|
||||
public void setSourceInfor(String returnData) {
|
||||
DynamicObject sourceentity = (DynamicObject) this.getModel().getValue("yem_sourceentity");//获取【源单实体】
|
||||
MainEntityType sourceMainType = MetadataServiceHelper.getDataEntityType(sourceentity.getString("number"));//获取元数据模型,主要用于读取字段类型和字段模型相关。
|
||||
IDataEntityProperty property = null;
|
||||
for (EntityType entityType : sourceMainType.getAllEntities().values()) {
|
||||
if (!entityType.getFields().containsKey(returnData)) continue;//判断返回的字段标识是否存在
|
||||
property = entityType.getFields().get(returnData);
|
||||
if (YEM.isNotEmpty(returnData)) {
|
||||
DynamicObject targetentity = (DynamicObject) this.getModel().getValue("yem_targetentity");//获取【目标单实体】
|
||||
MainEntityType mainType = MetadataServiceHelper.getDataEntityType(targetentity.getString("number"));//获取元数据模型,主要用于读取字段类型和字段模型相关。
|
||||
String fieldCaption = EntityParseHelper.buildPropFullCaption(mainType, returnData);
|
||||
int rowIndex = this.getModel().getEntryCurrentRowIndex("yem_fieldcontrast_e");//获取选中的焦点行
|
||||
this.getModel().setValue("yem_sourcekey", returnData, rowIndex);//【源单字段标识】
|
||||
this.getModel().setValue("yem_sourcefield", fieldCaption, rowIndex);//【源单字段】
|
||||
}
|
||||
if (property == null) return;
|
||||
int rowIndex = this.getModel().getEntryCurrentRowIndex("yem_fieldcontrast_e");//获取选中的焦点行
|
||||
this.getModel().setValue("yem_sourcekey", returnData, rowIndex);//【源单字段标识】
|
||||
this.getModel().setValue("yem_sourcefield", buildPropFullCaption(property), rowIndex);//【源单字段】
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user