zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cn.autoform.util.form.mapper;
 
import cn.autoform.db.entity.FormFieldEntity;
import cn.autoform.db.entity.form.FormCpnInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
 
@Mapper
public interface FormCpnInfoMapper {
 
    FormCpnInfoMapper MAP = Mappers.getMapper(FormCpnInfoMapper.class);
 
    @Mapping(target = "fieldKey", source = "tagAttribute.alias")
    @Mapping(target = "fieldOrderNum", source = "fieldOrderNum")
    @Mapping(target = "parentsubFormNum", source = "parentsubFormNum")
    @Mapping(target = "fieldtype", source = "tagType")
    @Mapping(target = "title", source = "tagAttribute.title")
    @Mapping(target = "columnOrderNum", source = "columnOrderNum")
    @Mapping(target = "dataSourceType", source = "tagAttribute.datasourcetype")
    @Mapping(target = "fieldset", expression = "java(cn.autoform.util.tool.JSONTool.toJson(formCpnInfo))")
    @Mapping(target = "tenantID", expression = "java(cn.autoform.util.thread.ThreadData.get(cn.autoform.util.thread.Keys.TENANT_ID))")
    @Mapping(target = "masterData", source = "tagAttribute.masterData")
    @Mapping(target = "editable", source = "tagAttribute.editable")
    @Mapping(target = "visible", source = "tagAttribute.visible")
    @Mapping(target = "dataSourceData", source = "tagAttribute.custom")
    @Mapping(target = "fieldId", source = "tagId")
    @Mapping(target = "fieldAttr", source = "tagAttribute.customArr")
    @Mapping(target = "value", source = "tagAttribute.chooseForm")
    FormFieldEntity of(FormCpnInfo formCpnInfo);
 
 
}