package cn.autoform.util.form.mapper;
|
|
import cn.autoform.db.entity.FormFieldAttrEntity;
|
import cn.autoform.db.entity.FormFieldEntity;
|
import cn.autoform.db.entity.form.FormCpnAttr;
|
import cn.autoform.db.entity.form.FormCpnAttr.Custom;
|
import cn.autoform.db.entity.form.FormCpnInfo;
|
import java.util.ArrayList;
|
import java.util.List;
|
import javax.annotation.Generated;
|
|
@Generated(
|
value = "org.mapstruct.ap.MappingProcessor",
|
date = "2020-05-18T19:31:08+0800",
|
comments = "version: 1.2.0.Final, compiler: javac, environment: Java 1.8.0_65 (Oracle Corporation)"
|
)
|
public class FormCpnInfoMapperImpl implements FormCpnInfoMapper {
|
|
@Override
|
public FormFieldEntity of(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
|
FormFieldEntity formFieldEntity = new FormFieldEntity();
|
|
String masterData = formCpnInfoTagAttributeMasterData( formCpnInfo );
|
if ( masterData != null ) {
|
formFieldEntity.setMasterData( masterData );
|
}
|
formFieldEntity.setParentsubFormNum( formCpnInfo.getParentsubFormNum() );
|
Boolean visible = formCpnInfoTagAttributeVisible( formCpnInfo );
|
if ( visible != null ) {
|
formFieldEntity.setVisible( visible );
|
}
|
String alias = formCpnInfoTagAttributeAlias( formCpnInfo );
|
if ( alias != null ) {
|
formFieldEntity.setFieldKey( alias );
|
}
|
Boolean editable = formCpnInfoTagAttributeEditable( formCpnInfo );
|
if ( editable != null ) {
|
formFieldEntity.setEditable( editable );
|
}
|
formFieldEntity.setColumnOrderNum( formCpnInfo.getColumnOrderNum() );
|
List<FormFieldAttrEntity> customArr = formCpnInfoTagAttributeCustomArr( formCpnInfo );
|
List<FormFieldAttrEntity> list = customArr;
|
if ( list != null ) {
|
formFieldEntity.setFieldAttr( new ArrayList<FormFieldAttrEntity>( list ) );
|
}
|
else {
|
formFieldEntity.setFieldAttr( null );
|
}
|
if ( formCpnInfo.getTagType() != null ) {
|
formFieldEntity.setFieldtype( formCpnInfo.getTagType().name() );
|
}
|
String title = formCpnInfoTagAttributeTitle( formCpnInfo );
|
if ( title != null ) {
|
formFieldEntity.setTitle( title );
|
}
|
List<Custom> custom = formCpnInfoTagAttributeCustom( formCpnInfo );
|
List<Custom> list1 = custom;
|
if ( list1 != null ) {
|
formFieldEntity.setDataSourceData( new ArrayList<Object>( list1 ) );
|
}
|
else {
|
formFieldEntity.setDataSourceData( null );
|
}
|
formFieldEntity.setFieldOrderNum( formCpnInfo.getFieldOrderNum() );
|
String chooseForm = formCpnInfoTagAttributeChooseForm( formCpnInfo );
|
if ( chooseForm != null ) {
|
formFieldEntity.setValue( chooseForm );
|
}
|
String datasourcetype = formCpnInfoTagAttributeDatasourcetype( formCpnInfo );
|
if ( datasourcetype != null ) {
|
formFieldEntity.setDataSourceType( datasourcetype );
|
}
|
formFieldEntity.setFieldId( formCpnInfo.getTagId() );
|
|
formFieldEntity.setFieldset( cn.autoform.util.tool.JSONTool.toJson(formCpnInfo) );
|
formFieldEntity.setTenantID( cn.autoform.util.thread.ThreadData.get(cn.autoform.util.thread.Keys.TENANT_ID) );
|
|
return formFieldEntity;
|
}
|
|
private String formCpnInfoTagAttributeMasterData(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
String masterData = tagAttribute.getMasterData();
|
if ( masterData == null ) {
|
return null;
|
}
|
return masterData;
|
}
|
|
private Boolean formCpnInfoTagAttributeVisible(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
Boolean visible = tagAttribute.getVisible();
|
if ( visible == null ) {
|
return null;
|
}
|
return visible;
|
}
|
|
private String formCpnInfoTagAttributeAlias(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
String alias = tagAttribute.getAlias();
|
if ( alias == null ) {
|
return null;
|
}
|
return alias;
|
}
|
|
private Boolean formCpnInfoTagAttributeEditable(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
Boolean editable = tagAttribute.getEditable();
|
if ( editable == null ) {
|
return null;
|
}
|
return editable;
|
}
|
|
private List<FormFieldAttrEntity> formCpnInfoTagAttributeCustomArr(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
List<FormFieldAttrEntity> customArr = tagAttribute.getCustomArr();
|
if ( customArr == null ) {
|
return null;
|
}
|
return customArr;
|
}
|
|
private String formCpnInfoTagAttributeTitle(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
String title = tagAttribute.getTitle();
|
if ( title == null ) {
|
return null;
|
}
|
return title;
|
}
|
|
private List<Custom> formCpnInfoTagAttributeCustom(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
List<Custom> custom = tagAttribute.getCustom();
|
if ( custom == null ) {
|
return null;
|
}
|
return custom;
|
}
|
|
private String formCpnInfoTagAttributeChooseForm(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
String chooseForm = tagAttribute.getChooseForm();
|
if ( chooseForm == null ) {
|
return null;
|
}
|
return chooseForm;
|
}
|
|
private String formCpnInfoTagAttributeDatasourcetype(FormCpnInfo formCpnInfo) {
|
if ( formCpnInfo == null ) {
|
return null;
|
}
|
FormCpnAttr tagAttribute = formCpnInfo.getTagAttribute();
|
if ( tagAttribute == null ) {
|
return null;
|
}
|
String datasourcetype = tagAttribute.getDatasourcetype();
|
if ( datasourcetype == null ) {
|
return null;
|
}
|
return datasourcetype;
|
}
|
}
|