动态表单支持原生sql

yun-zuoyi
castle.zang 2 years ago
parent 27b8c1133e
commit 1b8347db89

@ -12,6 +12,182 @@ import java.util.Objects;
* @Modify:
**/
public class BlockFormEnumUtil {
/**
* common
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum FORM_SCRIPT_TYPE {
SAVE(1, "save", "保存"),
UPDATE(2, "update", "更新"),
DELETE(3, "delete", "删除"),
QUERY(4, "query", "查询"),
EXPORT(5, "export", "导出"),
IMPORT(6, "import", "导入"),
COMMON(7,"common","普通操作");
private int value;
private String type;
private String description;
FORM_SCRIPT_TYPE(int value, String type, String description) {
this.value = value;
this.type = type;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return type;
}
public String getDescription() {
return description;
}
public static String valueOfCode(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].type;
}
}
return tmp;
}
public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].type.toLowerCase().equals(code.toLowerCase())) {
tmp = values()[i].value;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static FORM_SCRIPT_TYPE valueOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].type.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum FORM_SCRIPT_FUN_TYPE {
BEFORE_SAVE(1, "beforeSave", "保存前执行"),
AFTER_SAVE(2, "afterSave", "保存后执行"),
BEFORE_UPDATE(3, "beforeUpdate", "更新前执行"),
AFTER_UPDATE(4, "afterUpdate", "更新后执行"),
BEFORE_DELETE(5, "beforeDelete", "删除前执行"),
AFTER_DELETE(6, "afterDelete", "删除后执行"),
BEFORE_QUERY(7, "beforeQuery", "查询前执行"),
AFTER_QUERY(8, "afterQuery", "查询后执行"),
BEFORE_EXPORT(9, "beforeExport", "导出前执行"),
AFTER_EXPORT(10, "afterExport", "导出后执行"),
BEFORE_IMPORT(11, "beforeImport", "导入前执行"),
AFTER_IMPORT(12, "afterImport", "导入后执行");
private int value;
private String funName;
private String description;
FORM_SCRIPT_FUN_TYPE(int value, String funName, String description) {
this.value = value;
this.funName = funName;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return funName;
}
public String getDescription() {
return description;
}
public static String valueOfCode(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].funName;
}
}
return tmp;
}
public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].funName.toLowerCase().equals(code.toLowerCase())) {
tmp = values()[i].value;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static FORM_SCRIPT_FUN_TYPE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].funName.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
*
@ -1916,6 +2092,7 @@ public class BlockFormEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BUTTON_TRIGGER_EFFECT {
SCRIPT(60,"SCRIPT","执行脚本"),
DIALOG(10, "DIALOG", "弹出窗口"),
NEW_WINDOW(20, "NEW_WINDOW", "新开窗口"),
SQL(30, "SQL", "执行SQL"),

@ -74,4 +74,12 @@ public class BfButton extends BaseBean {
@Column(name = "BUTTON_DESCRIPTION")
@ApiParam(value = "按钮描述")
private String buttonDescription;
@Column(name = "FUN_NAME")
@ApiParam(value = "groovy脚本时的方法名")
private String funName;
@Column(name = "SCRIPT_NO")
@ApiParam(value = "脚本No")
private String scriptNo;
}

@ -125,6 +125,9 @@ public class BfDataObjectProperty extends BaseBean {
@ApiParam(value ="属性描述")
private String propertyDescription;
@Column(name = "REF_TABLE_NAME")
@ApiParam(value ="字段来源的表名--可空,如果自定义对象不可空")
private String refTableName;
@Transient
@ApiParam(value ="默认查询条件")
private Integer objectColumnCustomWhere;

@ -137,6 +137,7 @@ public class BfElement extends BaseBean {
public boolean isOrganizeIsolation() {
return isOrganizeIsolation != null && isOrganizeIsolation == BlockFormEnumUtil.ELEMENT_ORGANIZE_ISOLATION_STATUS.ON.getValue();
}
@Column(name = "ELEMENT_ORGANIZE_ISOLATION_ATTR_ID")
@ApiParam(value = "组织隔离属性id")
private Long elementOrganizeIsolationAttrId;
@ -185,6 +186,26 @@ public class BfElement extends BaseBean {
@ApiParam(value = "元素描述")
private String elementDescription;
/**
*
* 1: true,
* 2: false,
*/
@Column(name = "CUSTOM_ELEMENT")
@ApiParam(value = "自定义元素")
private Integer customElement;
/**
* BlockFormEnumUtil.FORM_SCRIPT_FUN_TYPE ,
*/
@Column(name = "SCRIPT_EXECUTE_POSITION")
@ApiParam(value = "执行脚本的位置,取值为枚举")
private String scriptExecutePosition;
@Column(name = "SCRIPT_NO")
@ApiParam(value = "脚本No")
private String scriptNo;
@Transient
@ApiParam(value = "数据对象")
private BfDataObject dataObject;

Loading…
Cancel
Save