diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java index 60760a417..d33ff161c 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java @@ -16,7 +16,6 @@ */ package org.hswebframework.web.service.authorization.simple; -import org.apache.commons.collections.CollectionUtils; import org.hswebframework.web.authorization.Authentication; import org.hswebframework.web.authorization.AuthenticationInitializeService; import org.hswebframework.web.authorization.Permission; @@ -25,7 +24,6 @@ import org.hswebframework.web.authorization.simple.SimpleAuthentication; import org.hswebframework.web.authorization.simple.SimplePermission; import org.hswebframework.web.authorization.simple.SimpleRole; import org.hswebframework.web.authorization.simple.SimpleUser; -import org.hswebframework.web.commons.entity.DataStatus; import org.hswebframework.web.commons.entity.TreeSupportEntity; import org.hswebframework.web.dao.authorization.AuthorizationSettingDao; import org.hswebframework.web.dao.authorization.AuthorizationSettingDetailDao; @@ -49,10 +47,10 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.apache.commons.collections.CollectionUtils.*; -import static org.hswebframework.web.commons.entity.DataStatus.*; +import static org.apache.commons.collections.CollectionUtils.isEmpty; +import static org.apache.commons.collections.CollectionUtils.isNotEmpty; +import static org.hswebframework.web.commons.entity.DataStatus.STATUS_ENABLED; import static org.hswebframework.web.entity.authorization.AuthorizationSettingDetailEntity.*; -import static org.hswebframework.web.entity.authorization.AuthorizationSettingDetailEntity.STATE_OK; import static org.hswebframework.web.entity.authorization.AuthorizationSettingEntity.settingFor; import static org.hswebframework.web.entity.authorization.AuthorizationSettingEntity.type; import static org.hswebframework.web.service.authorization.simple.CacheConstants.USER_AUTH_CACHE_NAME; @@ -129,10 +127,10 @@ public class SimpleAuthorizationSettingService extends GenericEntityService + + + hsweb-system-dynamic-form + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-controller + + + + javax.servlet + servlet-api + 2.5 + true + + + org.hswebframework.web + hsweb-system-dynamic-form-service-api + ${project.version} + + + org.hswebframework.web + hsweb-commons-controller + ${project.version} + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormColumnController.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormColumnController.java new file mode 100644 index 000000000..7eccb2ac0 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormColumnController.java @@ -0,0 +1,35 @@ +package org.hswebfarmework.web.controller.form; + +import org.hswebframework.web.authorization.annotation.Authorize; +import org.hswebframework.web.commons.entity.param.QueryParamEntity; +import org.hswebframework.web.controller.SimpleGenericEntityController; +import org.hswebfarmework.web.entity.form.DynamicFormColumnEntity; +import org.hswebframework.web.logging.AccessLogger; +import org.hswebfarmework.web.service.form.DynamicFormColumnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 动态表单 + * + * @author hsweb-generator-online + */ +@RestController +@RequestMapping("${hsweb.web.mappings.dynamicFormColumn:dynamicFormColumn}") +@Authorize(permission = "dynamicFormColumn") +@AccessLogger("动态表单") +public class DynamicFormColumnController implements SimpleGenericEntityController { + + private DynamicFormColumnService dynamicFormColumnService; + + @Autowired + public void setDynamicFormColumnService(DynamicFormColumnService dynamicFormColumnService) { + this.dynamicFormColumnService = dynamicFormColumnService; + } + + @Override + public DynamicFormColumnService getService() { + return dynamicFormColumnService; + } +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormController.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormController.java new file mode 100644 index 000000000..3f6e556dd --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-controller/src/main/java/org/hswebfarmework/web/controller/form/DynamicFormController.java @@ -0,0 +1,35 @@ +package org.hswebfarmework.web.controller.form; + +import org.hswebframework.web.authorization.annotation.Authorize; +import org.hswebframework.web.commons.entity.param.QueryParamEntity; +import org.hswebframework.web.controller.SimpleGenericEntityController; +import org.hswebfarmework.web.entity.form.DynamicFormEntity; +import org.hswebframework.web.logging.AccessLogger; +import org.hswebfarmework.web.service.form.DynamicFormService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 动态表单 + * + * @author hsweb-generator-online + */ +@RestController +@RequestMapping("${hsweb.web.mappings.dynamicForm:dynamicForm}") +@Authorize(permission = "dynamicForm") +@AccessLogger("动态表单") +public class DynamicFormController implements SimpleGenericEntityController { + + private DynamicFormService dynamicFormService; + + @Autowired + public void setDynamicFormService(DynamicFormService dynamicFormService) { + this.dynamicFormService = dynamicFormService; + } + + @Override + public DynamicFormService getService() { + return dynamicFormService; + } +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/pom.xml new file mode 100644 index 000000000..d3205d6f0 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/pom.xml @@ -0,0 +1,27 @@ + + + + hsweb-system-dynamic-form-dao + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-dao-api + + + + org.hswebframework.web + hsweb-system-dynamic-form-entity + ${project.version} + + + org.hswebframework.web + hsweb-commons-dao-api + ${project.version} + + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormColumnDao.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormColumnDao.java new file mode 100644 index 000000000..6168c23d2 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormColumnDao.java @@ -0,0 +1,11 @@ +package org.hswebfarmework.web.dao.form; + +import org.hswebframework.web.dao.CrudDao; +import org.hswebfarmework.web.entity.form.DynamicFormColumnEntity; + +/** +* 动态表单 DAO接口 +* @author hsweb-generator-online + */ +public interface DynamicFormColumnDao extends CrudDao { +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormDao.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormDao.java new file mode 100644 index 000000000..360bc9ac8 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-api/src/main/java/org/hswebfarmework/web/dao/form/DynamicFormDao.java @@ -0,0 +1,11 @@ +package org.hswebfarmework.web.dao.form; + +import org.hswebframework.web.dao.CrudDao; +import org.hswebfarmework.web.entity.form.DynamicFormEntity; + +/** +* 动态表单 DAO接口 +* @author hsweb-generator-online + */ +public interface DynamicFormDao extends CrudDao { +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/pom.xml new file mode 100644 index 000000000..e8bb024b6 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/pom.xml @@ -0,0 +1,26 @@ + + + + hsweb-system-dynamic-form-dao + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-dao-mybatis + + + + org.hswebframework.web + hsweb-system-dynamic-form-dao-api + ${project.version} + + + org.hswebframework.web + hsweb-commons-dao-mybatis + ${project.version} + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormColumnMapper.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormColumnMapper.xml new file mode 100644 index 000000000..12bb361ae --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormColumnMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from s_dyn_form_column where u_id =#{id} + + + + + + + + + + + + + + + + diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormMapper.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormMapper.xml new file mode 100644 index 000000000..c3e79a7d0 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/hsweb-system-dynamic-form-dao-mybatis/src/main/resources/org/hswebfarmework/web/dao/mybatis/mappers/form/DynamicFormMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from s_dyn_form where u_id =#{id} + + + + + + + + + + + + + + + + diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/pom.xml new file mode 100644 index 000000000..b9374df2e --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-dao/pom.xml @@ -0,0 +1,18 @@ + + + + hsweb-system-dynamic-form + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-dao + pom + + hsweb-system-dynamic-form-dao-api + hsweb-system-dynamic-form-dao-mybatis + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/pom.xml new file mode 100644 index 000000000..96a94fb6c --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/pom.xml @@ -0,0 +1,22 @@ + + + + hsweb-system-dynamic-form + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-entity + + + + org.hswebframework.web + hsweb-commons-entity + ${project.version} + + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormColumnEntity.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormColumnEntity.java new file mode 100644 index 000000000..3f184968f --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormColumnEntity.java @@ -0,0 +1,173 @@ +package org.hswebfarmework.web.entity.form; + +import org.hswebframework.web.commons.entity.GenericEntity; + +/** + * 动态表单 实体 + * + * @author hsweb-generator-online + */ +public interface DynamicFormColumnEntity extends GenericEntity { + /*------------------------------------------- + | 属性名常量 | + ===========================================*/ + /** + * 表单ID + */ + String formId = "formId"; + /** + * 字段名称 + */ + String name = "name"; + /** + * 数据库列 + */ + String columnName = "columnName"; + /** + * 备注 + */ + String describe = "describe"; + /** + * 别名 + */ + String alias = "alias"; + /** + * java类型 + */ + String javaType = "javaType"; + /** + * jdbc类型 + */ + String jdbcType = "jdbcType"; + /** + * 数据类型 + */ + String dataType = "dataType"; + /** + * 长度 + */ + String length = "length"; + /** + * 精度 + */ + String precision = "precision"; + /** + * 小数点位数 + */ + String scale = "scale"; + /** + * 其他配置 + */ + String properties = "properties"; + + /** + * @return 表单ID + */ + String getFormId(); + + /** + * @param formId 表单ID + */ + void setFormId(String formId); + + /** + * @return 字段名称 + */ + String getName(); + + /** + * @param name 字段名称 + */ + void setName(String name); + + /** + * @return 数据库列 + */ + String getColumnName(); + + /** + * @param columnName 数据库列 + */ + void setColumnName(String columnName); + + /** + * @return 备注 + */ + String getDescribe(); + + /** + * @param describe 备注 + */ + void setDescribe(String describe); + + /** + * @return 别名 + */ + String getAlias(); + + /** + * @param alias 别名 + */ + void setAlias(String alias); + + /** + * @return java类型 + */ + String getJavaType(); + + /** + * @param javaType java类型 + */ + void setJavaType(String javaType); + + /** + * @return jdbc类型 + */ + String getJdbcType(); + + /** + * @param jdbcType jdbc类型 + */ + void setJdbcType(String jdbcType); + + /** + * @return 数据类型 + */ + String getDataType(); + + /** + * @param dataType 数据类型 + */ + void setDataType(String dataType); + + /** + * @return 长度 + */ + Integer getLength(); + + /** + * @param length 长度 + */ + void setLength(Integer length); + + /** + * @return 精度 + */ + Integer getPrecision(); + + /** + * @param precision 精度 + */ + void setPrecision(Integer precision); + + /** + * @return 小数点位数 + */ + Integer getScale(); + + /** + * @param scale 小数点位数 + */ + void setScale(Integer scale); + +} \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormEntity.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormEntity.java new file mode 100644 index 000000000..13f78fdc9 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/DynamicFormEntity.java @@ -0,0 +1,196 @@ +package org.hswebfarmework.web.entity.form; +import org.hswebframework.web.commons.entity.GenericEntity; + +/** +* 动态表单 实体 +* @author hsweb-generator-online +*/ +public interface DynamicFormEntity extends GenericEntity{ + /*------------------------------------------- + | 属性名常量 | + ===========================================*/ + /** + * 表单名称 + */ + String name="name"; + /** + * 数据库表名 + */ + String tableName="tableName"; + /** + * 备注 + */ + String descibe="descibe"; + /** + * 版本 + */ + String version="version"; + /** + * 创建人id + */ + String creatorId="creatorId"; + /** + * 创建时间 + */ + String createTime="createTime"; + /** + * 修改时间 + */ + String updateTime="updateTime"; + /** + * 是否已发布 + */ + String deployed="deployed"; + /** + * 别名 + */ + String alias="alias"; + /** + * 触发器 + */ + String triggers="triggers"; + /** + * 表链接 + */ + String correlations="correlations"; + /** + * 数据源id,为空使用默认数据源 + */ + String dataSourceId="dataSourceId"; + /** + * 其他配置 + */ + String properties="properties"; + /** + * 表单类型 + */ + String type="type"; + + /** + * @return 表单名称 + */ + String getName(); + + /** + * @param name 表单名称 + */ + void setName(String name); + /** + * @return 数据库表名 + */ + String getTableName(); + + /** + * @param tableName 数据库表名 + */ + void setTableName(String tableName); + /** + * @return 备注 + */ + String getDescibe(); + + /** + * @param descibe 备注 + */ + void setDescibe(String descibe); + /** + * @return 版本 + */ + Long getVersion(); + + /** + * @param version 版本 + */ + void setVersion(Long version); + /** + * @return 创建人id + */ + String getCreatorId(); + + /** + * @param creatorId 创建人id + */ + void setCreatorId(String creatorId); + /** + * @return 创建时间 + */ + Long getCreateTime(); + + /** + * @param createTime 创建时间 + */ + void setCreateTime(Long createTime); + /** + * @return 修改时间 + */ + Long getUpdateTime(); + + /** + * @param updateTime 修改时间 + */ + void setUpdateTime(Long updateTime); + /** + * @return 是否已发布 + */ + Boolean isDeployed(); + + /** + * @param deployed 是否已发布 + */ + void setDeployed(Boolean deployed); + /** + * @return 别名 + */ + String getAlias(); + + /** + * @param alias 别名 + */ + void setAlias(String alias); + /** + * @return 触发器 + */ + String getTriggers(); + + /** + * @param triggers 触发器 + */ + void setTriggers(String triggers); + /** + * @return 表链接 + */ + String getCorrelations(); + + /** + * @param correlations 表链接 + */ + void setCorrelations(String correlations); + /** + * @return 数据源id,为空使用默认数据源 + */ + String getDataSourceId(); + + /** + * @param dataSourceId 数据源id,为空使用默认数据源 + */ + void setDataSourceId(String dataSourceId); + /** + * @return 其他配置 + */ + String getProperties(); + + /** + * @param properties 其他配置 + */ + void setProperties(String properties); + /** + * @return 表单类型 + */ + String getType(); + + /** + * @param type 表单类型 + */ + void setType(String type); + +} \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormColumnEntity.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormColumnEntity.java new file mode 100644 index 000000000..0155b6b0b --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormColumnEntity.java @@ -0,0 +1,189 @@ +package org.hswebfarmework.web.entity.form; + +import org.hswebframework.web.commons.entity.SimpleGenericEntity; + +/** + * 动态表单 + * + * @author hsweb-generator-online + */ +public class SimpleDynamicFormColumnEntity extends SimpleGenericEntity implements DynamicFormColumnEntity { + //表单ID + private String formId; + //字段名称 + private String name; + //数据库列 + private String columnName; + //备注 + private String describe; + //别名 + private String alias; + //java类型 + private String javaType; + //jdbc类型 + private String jdbcType; + //数据类型 + private String dataType; + //长度 + private Integer length; + //精度 + private Integer precision; + //小数点位数 + private Integer scale; + //其他配置 + private String properties; + + /** + * @return 表单ID + */ + public String getFormId() { + return this.formId; + } + + /** + * @param formId 表单ID + */ + public void setFormId(String formId) { + this.formId = formId; + } + + /** + * @return 字段名称 + */ + public String getName() { + return this.name; + } + + /** + * @param name 字段名称 + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return 数据库列 + */ + public String getColumnName() { + return this.columnName; + } + + /** + * @param columnName 数据库列 + */ + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + /** + * @return 备注 + */ + public String getDescribe() { + return this.describe; + } + + /** + * @param describe 备注 + */ + public void setDescribe(String describe) { + this.describe = describe; + } + + /** + * @return 别名 + */ + public String getAlias() { + return this.alias; + } + + /** + * @param alias 别名 + */ + public void setAlias(String alias) { + this.alias = alias; + } + + /** + * @return java类型 + */ + public String getJavaType() { + return this.javaType; + } + + /** + * @param javaType java类型 + */ + public void setJavaType(String javaType) { + this.javaType = javaType; + } + + /** + * @return jdbc类型 + */ + public String getJdbcType() { + return this.jdbcType; + } + + /** + * @param jdbcType jdbc类型 + */ + public void setJdbcType(String jdbcType) { + this.jdbcType = jdbcType; + } + + /** + * @return 数据类型 + */ + public String getDataType() { + return this.dataType; + } + + /** + * @param dataType 数据类型 + */ + public void setDataType(String dataType) { + this.dataType = dataType; + } + + /** + * @return 长度 + */ + public Integer getLength() { + return this.length; + } + + /** + * @param length 长度 + */ + public void setLength(Integer length) { + this.length = length; + } + + /** + * @return 精度 + */ + public Integer getPrecision() { + return this.precision; + } + + /** + * @param precision 精度 + */ + public void setPrecision(Integer precision) { + this.precision = precision; + } + + /** + * @return 小数点位数 + */ + public Integer getScale() { + return this.scale; + } + + /** + * @param scale 小数点位数 + */ + public void setScale(Integer scale) { + this.scale = scale; + } +} \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormEntity.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormEntity.java new file mode 100644 index 000000000..f14b52582 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-entity/src/main/java/org/hswebfarmework/web/entity/form/SimpleDynamicFormEntity.java @@ -0,0 +1,220 @@ +package org.hswebfarmework.web.entity.form; +import org.hswebframework.web.commons.entity.SimpleGenericEntity; + +/** +* 动态表单 +* @author hsweb-generator-online +*/ +public class SimpleDynamicFormEntity extends SimpleGenericEntity implements DynamicFormEntity{ + //表单名称 + private String name; + //数据库表名 + private String tableName; + //备注 + private String descibe; + //版本 + private Long version; + //创建人id + private String creatorId; + //创建时间 + private Long createTime; + //修改时间 + private Long updateTime; + //是否已发布 + private Boolean deployed; + //别名 + private String alias; + //触发器 + private String triggers; + //表链接 + private String correlations; + //数据源id,为空使用默认数据源 + private String dataSourceId; + //其他配置 + private String properties; + //表单类型 + private String type; + + /** + * @return 表单名称 + */ + public String getName(){ + return this.name; + } + + /** + * @param name 表单名称 + */ + public void setName(String name){ + this.name=name; + } + /** + * @return 数据库表名 + */ + public String getTableName(){ + return this.tableName; + } + + /** + * @param tableName 数据库表名 + */ + public void setTableName(String tableName){ + this.tableName=tableName; + } + /** + * @return 备注 + */ + public String getDescibe(){ + return this.descibe; + } + + /** + * @param descibe 备注 + */ + public void setDescibe(String descibe){ + this.descibe=descibe; + } + /** + * @return 版本 + */ + public Long getVersion(){ + return this.version; + } + + /** + * @param version 版本 + */ + public void setVersion(Long version){ + this.version=version; + } + /** + * @return 创建人id + */ + public String getCreatorId(){ + return this.creatorId; + } + + /** + * @param creatorId 创建人id + */ + public void setCreatorId(String creatorId){ + this.creatorId=creatorId; + } + /** + * @return 创建时间 + */ + public Long getCreateTime(){ + return this.createTime; + } + + /** + * @param createTime 创建时间 + */ + public void setCreateTime(Long createTime){ + this.createTime=createTime; + } + /** + * @return 修改时间 + */ + public Long getUpdateTime(){ + return this.updateTime; + } + + /** + * @param updateTime 修改时间 + */ + public void setUpdateTime(Long updateTime){ + this.updateTime=updateTime; + } + /** + * @return 是否已发布 + */ + public Boolean isDeployed(){ + return this.deployed; + } + + /** + * @param deployed 是否已发布 + */ + public void setDeployed(Boolean deployed){ + this.deployed=deployed; + } + /** + * @return 别名 + */ + public String getAlias(){ + return this.alias; + } + + /** + * @param alias 别名 + */ + public void setAlias(String alias){ + this.alias=alias; + } + /** + * @return 触发器 + */ + public String getTriggers(){ + return this.triggers; + } + + /** + * @param triggers 触发器 + */ + public void setTriggers(String triggers){ + this.triggers=triggers; + } + /** + * @return 表链接 + */ + public String getCorrelations(){ + return this.correlations; + } + + /** + * @param correlations 表链接 + */ + public void setCorrelations(String correlations){ + this.correlations=correlations; + } + /** + * @return 数据源id,为空使用默认数据源 + */ + public String getDataSourceId(){ + return this.dataSourceId; + } + + /** + * @param dataSourceId 数据源id,为空使用默认数据源 + */ + public void setDataSourceId(String dataSourceId){ + this.dataSourceId=dataSourceId; + } + /** + * @return 其他配置 + */ + public String getProperties(){ + return this.properties; + } + + /** + * @param properties 其他配置 + */ + public void setProperties(String properties){ + this.properties=properties; + } + /** + * @return 表单类型 + */ + public String getType(){ + return this.type; + } + + /** + * @param type 表单类型 + */ + public void setType(String type){ + this.type=type; + } +} \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/pom.xml new file mode 100644 index 000000000..d6aa1289b --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/pom.xml @@ -0,0 +1,26 @@ + + + + hsweb-system-dynamic-form-service + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-service-api + + + + org.hswebframework.web + hsweb-commons-service-api + ${project.version} + + + org.hswebframework.web + hsweb-system-dynamic-form-dao-api + ${project.version} + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormColumnService.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormColumnService.java new file mode 100644 index 000000000..189e9dfc3 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormColumnService.java @@ -0,0 +1,13 @@ +package org.hswebfarmework.web.service.form; + +import org.hswebfarmework.web.entity.form.DynamicFormColumnEntity; +import org.hswebframework.web.service.CrudService; + +/** + * 动态表单 服务类 + * + * @author hsweb-generator-online + */ +public interface DynamicFormColumnService extends CrudService { + +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormService.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormService.java new file mode 100644 index 000000000..5ebdb6257 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-api/src/main/java/org/hswebfarmework/web/service/form/DynamicFormService.java @@ -0,0 +1,13 @@ +package org.hswebfarmework.web.service.form; + +import org.hswebfarmework.web.entity.form.DynamicFormEntity; +import org.hswebframework.web.service.CrudService; + +/** + * 动态表单 服务类 + * + * @author hsweb-generator-online + */ +public interface DynamicFormService extends CrudService { + +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/pom.xml new file mode 100644 index 000000000..2b2e7352c --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/pom.xml @@ -0,0 +1,26 @@ + + + + hsweb-system-dynamic-form-service + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-service-simple + + + + org.hswebframework.web + hsweb-commons-service-simple + ${project.version} + + + org.hswebframework.web + hsweb-system-dynamic-form-service-api + ${project.version} + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormColumnService.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormColumnService.java new file mode 100644 index 000000000..8f80b518b --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormColumnService.java @@ -0,0 +1,30 @@ +package org.hswebfarmework.web.service.form.simple; + +import org.hswebfarmework.web.dao.form.DynamicFormColumnDao; +import org.hswebfarmework.web.entity.form.DynamicFormColumnEntity; +import org.hswebframework.web.service.GenericEntityService; +import org.hswebframework.web.id.IDGenerator; +import org.hswebfarmework.web.service.form.DynamicFormColumnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 默认的服务实现 + * + * @author hsweb-generator-online + */ +@Service("dynamicFormColumnService") +public class SimpleDynamicFormColumnService extends GenericEntityService + implements DynamicFormColumnService { + @Autowired + private DynamicFormColumnDao dynamicFormColumnDao; + @Override + protected IDGenerator getIDGenerator() { + return IDGenerator.MD5; + } + @Override + public DynamicFormColumnDao getDao() { + return dynamicFormColumnDao; + } + +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormService.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormService.java new file mode 100644 index 000000000..1f4b92551 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/hsweb-system-dynamic-form-service-simple/src/main/java/org/hswebfarmework/web/service/form/simple/SimpleDynamicFormService.java @@ -0,0 +1,30 @@ +package org.hswebfarmework.web.service.form.simple; + +import org.hswebfarmework.web.dao.form.DynamicFormDao; +import org.hswebfarmework.web.entity.form.DynamicFormEntity; +import org.hswebframework.web.service.GenericEntityService; +import org.hswebframework.web.id.IDGenerator; +import org.hswebfarmework.web.service.form.DynamicFormService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 默认的服务实现 + * + * @author hsweb-generator-online + */ +@Service("dynamicFormService") +public class SimpleDynamicFormService extends GenericEntityService + implements DynamicFormService { + @Autowired + private DynamicFormDao dynamicFormDao; + @Override + protected IDGenerator getIDGenerator() { + return IDGenerator.MD5; + } + @Override + public DynamicFormDao getDao() { + return dynamicFormDao; + } + +} diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/pom.xml new file mode 100644 index 000000000..bfa2b928a --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-service/pom.xml @@ -0,0 +1,18 @@ + + + + hsweb-system-dynamic-form + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-service + pom + + hsweb-system-dynamic-form-service-api + hsweb-system-dynamic-form-service-simple + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml new file mode 100644 index 000000000..4a816b3d2 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml @@ -0,0 +1,78 @@ + + + + hsweb-system-dynamic-form + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-dynamic-form-starter + + + + + + src/main/resources + true + + + + + + + org.hswebframework.web + hsweb-system-form-service-simple + ${project.version} + + + + org.hswebframework.web + hsweb-system-form-dao-mybatis + ${project.version} + + + + org.hswebframework.web + hsweb-system-form-controller + ${project.version} + + + + com.h2database + h2 + test + + + + com.alibaba + druid + 1.0.26 + test + + + + org.hswebframework.web + hsweb-spring-boot-starter + ${hsweb.framework.version} + test + + + + org.hswebframework.web + hsweb-tests + ${hsweb.framework.version} + test + + + + javax.servlet + servlet-api + 2.5 + test + + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/src/main/resources/hsweb-starter.js b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/src/main/resources/hsweb-starter.js new file mode 100644 index 000000000..d8c867619 --- /dev/null +++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/src/main/resources/hsweb-starter.js @@ -0,0 +1,69 @@ +//组件信息 +var info = { + groupId: "${project.groupId}", + artifactId: "${project.artifactId}", + version: "${project.version}", + website: "https://github.com/hs-web/hsweb-framework", + author: "admin@hsweb.me", + comment: "动态表单" +}; + +//版本更新信息 +var versions = [ + // { + // version: "3.0.2", + // upgrade: function (context) { + // java.lang.System.out.println("更新到3.0.2了"); + // } + // } +]; +var JDBCType = java.sql.JDBCType; +function install(context) { + var database = context.database; + database.createOrAlter("s_dyn_form") + .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit() + .addColumn().name("name").alias("name").comment("表单名称").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("table_name").alias("tableName").comment("数据库表名").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("describe").alias("describe").comment("备注").jdbcType(java.sql.JDBCType.VARCHAR).length(512).commit() + .addColumn().name("type").alias("type").comment("表单类型").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("version").alias("version").comment("版本").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit() + .addColumn().name("is_deployed").alias("isDeployed").comment("是否已发布").jdbcType(java.sql.JDBCType.DECIMAL).length(1, 0).commit() + .addColumn().name("alias").alias("alias").comment("别名").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("triggers").alias("triggers").comment("触发器").jdbcType(java.sql.JDBCType.CLOB).commit() + .addColumn().name("correlations").alias("correlations").comment("表链接").jdbcType(java.sql.JDBCType.CLOB).commit() + .addColumn().name("data_source_id").alias("dataSourceId").comment("数据源id,为空使用默认数据源").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("creator_id").alias("creatorId").comment("创建人id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("create_time").alias("createTime").comment("创建时间").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit() + .addColumn().name("update_time").alias("updateTime").comment("修改时间").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit() + .addColumn().name("properties").alias("properties").comment("其他配置").jdbcType(java.sql.JDBCType.CLOB).commit() + .comment("动态表单").commit(); + + database.createOrAlter("s_dyn_form_column") + .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit() + .addColumn().name("form_id").alias("formId").comment("表单ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("name").alias("name").comment("字段名称").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("column_name").alias("columnName").comment("数据库列").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("describe").alias("describe").comment("备注").jdbcType(java.sql.JDBCType.VARCHAR).length(512).commit() + .addColumn().name("alias").alias("alias").comment("别名").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit() + .addColumn().name("java_type").alias("javaType").comment("java类型").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit() + .addColumn().name("jdbc_type").alias("jdbcType").comment("jdbc类型").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit() + .addColumn().name("data_type").alias("dataType").comment("数据类型").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit() + .addColumn().name("length").alias("length").comment("长度").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit() + .addColumn().name("precision").alias("precision").comment("精度").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit() + .addColumn().name("scale").alias("scale").comment("小数点位数").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit() + .addColumn().name("properties").alias("properties").comment("其他配置").jdbcType(java.sql.JDBCType.CLOB).commit() + .comment("动态表单列").commit(); +} +//设置依赖 +dependency.setup(info) + .onInstall(install) + .onUpgrade(function (context) { //更新时执行 + var upgrader = context.upgrader; + upgrader.filter(versions) + .upgrade(function (newVer) { + newVer.upgrade(context); + }); + }) + .onUninstall(function (context) { //卸载时执行 + + }); \ No newline at end of file diff --git a/hsweb-system/hsweb-system-dynamic-form/pom.xml b/hsweb-system/hsweb-system-dynamic-form/pom.xml index 132b2cddb..c10537bbf 100644 --- a/hsweb-system/hsweb-system-dynamic-form/pom.xml +++ b/hsweb-system/hsweb-system-dynamic-form/pom.xml @@ -10,6 +10,14 @@ 4.0.0 hsweb-system-dynamic-form + pom + + hsweb-system-dynamic-form-dao + hsweb-system-dynamic-form-service + hsweb-system-dynamic-form-controller + hsweb-system-dynamic-form-entity + hsweb-system-dynamic-form-starter + \ No newline at end of file