|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 原数据类型
|
|
|
|
@ -20,7 +196,8 @@ public class BlockFormEnumUtil {
|
|
|
|
|
public enum FORM_TABLE_TYPE {
|
|
|
|
|
TABLE(1, "TABLE", "表"),
|
|
|
|
|
VIEW(2, "VIEW", "视图"),
|
|
|
|
|
PROCEDURE(3, "PROCEDURE", "存储过程");
|
|
|
|
|
PROCEDURE(3, "PROCEDURE", "存储过程"),
|
|
|
|
|
CUSTOM(4, "CUSTOM", "自定义对象");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String code;
|
|
|
|
@ -1915,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"),
|
|
|
|
@ -2548,4 +2726,257 @@ public class BlockFormEnumUtil {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 脚本语言类型
|
|
|
|
|
* 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby
|
|
|
|
|
*/
|
|
|
|
|
public enum LANGUAGE_TYPE {
|
|
|
|
|
GROOVY(1, "Groovy", 10),
|
|
|
|
|
PYTHON(2, "jython", 20), // "jython" string can not change
|
|
|
|
|
JS(3, "JavaScript", 30);
|
|
|
|
|
// 下面这2种语言没人会写,暂不支持
|
|
|
|
|
//SCALA(40,"scala"),
|
|
|
|
|
//JRUBY(50,"jruby");
|
|
|
|
|
|
|
|
|
|
private int index;
|
|
|
|
|
private String description;
|
|
|
|
|
private int value;
|
|
|
|
|
|
|
|
|
|
LANGUAGE_TYPE(int index, String description, int value) {
|
|
|
|
|
this.index = index;
|
|
|
|
|
this.description = description;
|
|
|
|
|
this.value = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getIndex() {
|
|
|
|
|
return this.index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据枚举编号获取语言代码
|
|
|
|
|
public static String getCodeByIndex(Integer index) {
|
|
|
|
|
for (BlockFormEnumUtil.LANGUAGE_TYPE languageType : BlockFormEnumUtil.LANGUAGE_TYPE.values()) {
|
|
|
|
|
if (languageType.getValue() == index) {
|
|
|
|
|
return languageType.getDescription();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统参数类型
|
|
|
|
|
* 1.SYSTEM:系统参数
|
|
|
|
|
* 2.BUSI:业务参数
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum BLOCK_FORM_CONFIG_TYPE {
|
|
|
|
|
|
|
|
|
|
SYSTEM(10, "系统参数", "系统参数"),
|
|
|
|
|
BUSI(20, "业务参数", "业务参数");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String name;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
BLOCK_FORM_CONFIG_TYPE(int value, String name, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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].name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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 String codeOfDescription(String code) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].name.equals(code)) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 脚本类型
|
|
|
|
|
* 10=组件脚本,20=表单脚本,30=报表脚本,40=JOB脚本,50=其他脚本
|
|
|
|
|
*/
|
|
|
|
|
public enum SCRIPT_TYPE {
|
|
|
|
|
MODUAL(10, "Modual", "组件脚本"),
|
|
|
|
|
FORM(20, "Form", "表单脚本"),
|
|
|
|
|
REPORT(30, "Report", "报表脚本"),
|
|
|
|
|
JOB(40, "Job", "JOB脚本"),
|
|
|
|
|
OTHER(50, "Other", "其他脚本");
|
|
|
|
|
|
|
|
|
|
private String description;
|
|
|
|
|
private int value;
|
|
|
|
|
private String code;
|
|
|
|
|
|
|
|
|
|
SCRIPT_TYPE(int value, String code, String description) {
|
|
|
|
|
this.description = description;
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.code = code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getCode() {
|
|
|
|
|
return this.code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getIndex() {
|
|
|
|
|
return this.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统参数类型
|
|
|
|
|
* 1.SYSTEM:系统参数
|
|
|
|
|
* 2.BUSI:业务参数
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum CONFIG_TYPE {
|
|
|
|
|
|
|
|
|
|
SYSTEM(10, "系统参数", "系统参数"),
|
|
|
|
|
BUSI(20, "业务参数", "业务参数");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String name;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
CONFIG_TYPE(int value, String name, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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].name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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 String codeOfDescription(String code) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].name.equals(code)) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统配置值类型
|
|
|
|
|
*/
|
|
|
|
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
|
|
|
|
public enum CONFIG_VALUE_TYPE {
|
|
|
|
|
CHECKLIST(10, "可选列表"),
|
|
|
|
|
NUMBER(20, "数字"),
|
|
|
|
|
STRING(30, "字符串");
|
|
|
|
|
|
|
|
|
|
private int value;
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
CONFIG_VALUE_TYPE(int value, String description) {
|
|
|
|
|
this.value = value;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getValue() {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String valueOf(int val) {
|
|
|
|
|
String tmp = null;
|
|
|
|
|
for (int i = 0; i < values().length; i++) {
|
|
|
|
|
if (values()[i].value == val) {
|
|
|
|
|
tmp = values()[i].description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|