处理字段带有富文本页面数据无法加载

This commit is contained in:
wanggeng 2021-08-16 14:47:43 +08:00
parent 538d13e555
commit 74802d4a17
6 changed files with 60 additions and 100 deletions

12
pom.xml
View File

@ -56,12 +56,24 @@
</dependency> </dependency>
<!-- freemarker end --> <!-- freemarker end -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.30</version> <version>1.7.30</version>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.30</version>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>

View File

@ -12,103 +12,42 @@ package ink.wgink.code.factory.enums;
**/ **/
public enum FormFieldTypeEnum { public enum FormFieldTypeEnum {
/** TEXT("text", "文本"),
* 文本 DATETIME("datetime", "时间戳"),
*/ DATE("date", "日期"),
TEXT("text"), NUMBER("number", "整形"),
/** DOUBLE("double", "双精度"),
* 时间戳 TEXTAREA("textarea", "文本域"),
*/ RICH_TEXT("richText", "富文本"),
DATETIME("datetime"), ID_SELECT("idSelect", "ID 选择"),
/** SELECT("select", "下拉选择"),
* 日期 CHECKBOX("checkbox", "复选"),
*/ RADIO("radio", "单选"),
DATE("date"), SELECT_USER("selectUser", "选择人员"),
/** SELECT_DEPARTMENT("selectDepartment", "选择部门"),
* 整形 FILE("file", "文件"),
*/ IMAGE("image", "图片"),
NUMBER("number"), VIDEO("video", "视频"),
/** AUDIO("audio", "音频"),
* 双精度 CURRENT_USER("currentUser", "当前用户"),
*/ CURRENT_DEPARTMENT("currentDepartment", "当前部门"),
DOUBLE("double"), CURRENT_ROLE("currentRole", "当前角色"),
/** CURRENT_GROUP("currentGroup", "当前组"),
* 文本域 CURRENT_POSITION("currentPosition", "当前职位");
*/
TEXTAREA("textarea"),
/**
* 富文本
*/
RICH_TEXT("richText"),
/**
* ID 选择
*/
ID_SELECT("idSelect"),
/**
* 下拉选择
*/
SELECT("select"),
/**
* 复选
*/
CHECKBOX("checkbox"),
/**
* 单选
*/
RADIO("radio"),
/**
* 选择人员
*/
SELECT_USER("selectUser"),
/**
* 选择部门
*/
SELECT_DEPARTMENT("selectDepartment"),
/**
* 文件
*/
FILE("file"),
/**
* 图片
*/
IMAGE("image"),
/**
* 视频
*/
VIDEO("video"),
/**
* 音频
*/
AUDIO("audio"),
/**
* 当前用户
*/
CURRENT_USER("currentUser"),
/**
* 当前部门
*/
CURRENT_DEPARTMENT("currentDepartment"),
/**
* 当前角色
*/
CURRENT_ROLE("currentRole"),
/**
* 当前组
*/
CURRENT_GROUP("currentGroup"),
/**
* 当前职位
*/
CURRENT_POSITION("currentPosition");
private String value; private String value;
private String summary;
FormFieldTypeEnum(String value) { FormFieldTypeEnum(String value, String summary) {
this.value = value; this.value = value;
this.summary = summary;
} }
public String getValue() { public String getValue() {
return value == null ? "" : value.trim(); return value == null ? "" : value.trim();
} }
public String getSummary() {
return summary == null ? "" : summary.trim();
}
} }

View File

@ -26,7 +26,7 @@ public class ChoiceBoxTableCellFactory implements Callback<TableColumn.CellDataF
private final String property; private final String property;
private ObservableList<String> normalSelect = FXCollections.observableArrayList( private ObservableList<String> normalSelect = FXCollections.observableArrayList(
"", FormFieldTypeEnum.TEXT.getValue(), FormFieldTypeEnum.NUMBER.getValue(), "", FormFieldTypeEnum.TEXT.getValue(), FormFieldTypeEnum.NUMBER.getValue(),
FormFieldTypeEnum.DOUBLE.getValue(), FormFieldTypeEnum.TEXTAREA.getValue(), FormFieldTypeEnum.DOUBLE.getValue(), FormFieldTypeEnum.TEXTAREA.getValue(), FormFieldTypeEnum.RICH_TEXT.getValue(),
FormFieldTypeEnum.SELECT_USER.getValue(), FormFieldTypeEnum.SELECT_DEPARTMENT.getValue(), FormFieldTypeEnum.SELECT_USER.getValue(), FormFieldTypeEnum.SELECT_DEPARTMENT.getValue(),
FormFieldTypeEnum.FILE.getValue(), FormFieldTypeEnum.IMAGE.getValue(), FormFieldTypeEnum.FILE.getValue(), FormFieldTypeEnum.IMAGE.getValue(),
FormFieldTypeEnum.AUDIO.getValue(), FormFieldTypeEnum.VIDEO.getValue(), FormFieldTypeEnum.AUDIO.getValue(), FormFieldTypeEnum.VIDEO.getValue(),

View File

@ -70,7 +70,7 @@ public class FieldService {
} else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.TEXT.getValue(), columnDataType)) { } else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.TEXT.getValue(), columnDataType)) {
return FormFieldTypeEnum.TEXTAREA.getValue(); return FormFieldTypeEnum.TEXTAREA.getValue();
} else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.LONGTEXT.getValue(), columnDataType)) { } else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.LONGTEXT.getValue(), columnDataType)) {
return FormFieldTypeEnum.RICH_TEXT.getValue(); return FormFieldTypeEnum.RICH_TEXT.getValue();
} else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.CHAR.getValue(), columnDataType)) { } else if (StringUtils.equalsIgnoreCase(ColumnDataTypeEnum.CHAR.getValue(), columnDataType)) {
return FormFieldTypeEnum.ID_SELECT.getValue(); return FormFieldTypeEnum.ID_SELECT.getValue();
} }
@ -121,7 +121,7 @@ public class FieldService {
fieldVO.setColumnName(columnName); fieldVO.setColumnName(columnName);
fieldVO.setColumnType(field.get("COLUMN_TYPE").toString()); fieldVO.setColumnType(field.get("COLUMN_TYPE").toString());
fieldVO.setDataType(field.get("DATA_TYPE").toString()); fieldVO.setDataType(field.get("DATA_TYPE").toString());
fieldVO.setCharacterMaximum(field.get("CHARACTER_MAXIMUM_LENGTH") == null ? 0 : Integer.valueOf(field.get("CHARACTER_MAXIMUM_LENGTH").toString())); fieldVO.setCharacterMaximum(field.get("CHARACTER_MAXIMUM_LENGTH") == null ? 0 : Long.valueOf(field.get("CHARACTER_MAXIMUM_LENGTH").toString()));
fieldVO.setNumericPrecision(field.get("NUMERIC_PRECISION") == null ? 0 : Integer.valueOf(field.get("NUMERIC_PRECISION").toString())); fieldVO.setNumericPrecision(field.get("NUMERIC_PRECISION") == null ? 0 : Integer.valueOf(field.get("NUMERIC_PRECISION").toString()));
fieldVO.setNumericScale(field.get("NUMERIC_SCALE") == null ? 0 : Integer.valueOf(field.get("NUMERIC_SCALE").toString())); fieldVO.setNumericScale(field.get("NUMERIC_SCALE") == null ? 0 : Integer.valueOf(field.get("NUMERIC_SCALE").toString()));
fieldVO.setColumnComment(field.get("COLUMN_COMMENT") == null ? "" : field.get("COLUMN_COMMENT").toString()); fieldVO.setColumnComment(field.get("COLUMN_COMMENT") == null ? "" : field.get("COLUMN_COMMENT").toString());

View File

@ -1,6 +1,7 @@
package ink.wgink.code.factory.vos; package ink.wgink.code.factory.vos;
import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
/** /**
@ -21,12 +22,12 @@ public class FieldVO {
private SimpleStringProperty columnDefault; private SimpleStringProperty columnDefault;
private String dataType; private String dataType;
private SimpleStringProperty columnType; private SimpleStringProperty columnType;
private Integer characterMaximum; private Long characterMaximum;
private Integer numericPrecision; private Integer numericPrecision;
private Integer numericScale; private Integer numericScale;
private SimpleStringProperty propertyName; private SimpleStringProperty propertyName;
private SimpleStringProperty propertyType; private SimpleStringProperty propertyType;
private SimpleIntegerProperty propertyLength; private SimpleLongProperty propertyLength;
private String formFieldType; private String formFieldType;
private String formFieldValue; private String formFieldValue;
private Boolean isFormShow; private Boolean isFormShow;
@ -43,7 +44,7 @@ public class FieldVO {
this.columnType = new SimpleStringProperty(); this.columnType = new SimpleStringProperty();
this.propertyName = new SimpleStringProperty(); this.propertyName = new SimpleStringProperty();
this.propertyType = new SimpleStringProperty(); this.propertyType = new SimpleStringProperty();
this.propertyLength = new SimpleIntegerProperty(0); this.propertyLength = new SimpleLongProperty(0);
} }
public int getRowNumber() { public int getRowNumber() {
@ -114,11 +115,11 @@ public class FieldVO {
this.columnType.set(columnType); this.columnType.set(columnType);
} }
public Integer getCharacterMaximum() { public Long getCharacterMaximum() {
return characterMaximum; return characterMaximum;
} }
public void setCharacterMaximum(Integer characterMaximum) { public void setCharacterMaximum(Long characterMaximum) {
this.characterMaximum = characterMaximum; this.characterMaximum = characterMaximum;
} }
@ -162,15 +163,15 @@ public class FieldVO {
this.propertyType.set(propertyType); this.propertyType.set(propertyType);
} }
public int getPropertyLength() { public long getPropertyLength() {
return propertyLength.get(); return propertyLength.get();
} }
public SimpleIntegerProperty propertyLengthProperty() { public SimpleLongProperty propertyLengthProperty() {
return propertyLength; return propertyLength;
} }
public void setPropertyLength(int propertyLength) { public void setPropertyLength(long propertyLength) {
this.propertyLength.set(propertyLength); this.propertyLength.set(propertyLength);
} }

View File

@ -0,0 +1,8 @@
log4j.logger.info=debug
log4j.appender.info=org.apache.log4j.DailyRollingFileAppender
log4j.appender.info.layout=org.apache.log4j.PatternLayout
log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd-HH-mm} [%t] [%c] [%p] - %m%n
log4j.appender.info.datePattern='.'yyyy-MM-dd
log4j.appender.info.Threshold = info
log4j.appender.info.append=true
# log4j.appender.info.File=/mylog/info.log