mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-31 01:43:08 +08:00
新增动态表单,未完成
This commit is contained in:
@@ -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<Auth
|
||||
}
|
||||
if (entity.getDetails() != null) {
|
||||
for (AuthorizationSettingDetailEntity detail : entity.getDetails()) {
|
||||
tryValidate(detail, CreateGroup.class);
|
||||
detail.setId(getIDGenerator().generate());
|
||||
detail.setSettingId(id);
|
||||
detail.setStatus(STATUS_ENABLED);
|
||||
tryValidate(detail, CreateGroup.class);
|
||||
authorizationSettingDetailDao.insert(detail);
|
||||
}
|
||||
}
|
||||
@@ -160,6 +158,7 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
|
||||
detail.setId(getIDGenerator().generate());
|
||||
detail.setSettingId(id);
|
||||
detail.setStatus(STATUS_ENABLED);
|
||||
tryValidate(detail, CreateGroup.class);
|
||||
authorizationSettingDetailDao.insert(detail);
|
||||
}
|
||||
}
|
||||
@@ -169,7 +168,10 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
public int deleteByPk(String id) {
|
||||
Objects.requireNonNull(id, "id can not be null");
|
||||
authorizationSettingMenuService.deleteBySettingId(id);
|
||||
DefaultDSLDeleteService.createDelete(authorizationSettingDetailDao)
|
||||
.where(AuthorizationSettingDetailEntity.settingId, id).exec();
|
||||
return super.deleteByPk(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-controller</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-dynamic-form-service-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -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<DynamicFormColumnEntity, String, QueryParamEntity> {
|
||||
|
||||
private DynamicFormColumnService dynamicFormColumnService;
|
||||
|
||||
@Autowired
|
||||
public void setDynamicFormColumnService(DynamicFormColumnService dynamicFormColumnService) {
|
||||
this.dynamicFormColumnService = dynamicFormColumnService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicFormColumnService getService() {
|
||||
return dynamicFormColumnService;
|
||||
}
|
||||
}
|
||||
@@ -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<DynamicFormEntity, String, QueryParamEntity> {
|
||||
|
||||
private DynamicFormService dynamicFormService;
|
||||
|
||||
@Autowired
|
||||
public void setDynamicFormService(DynamicFormService dynamicFormService) {
|
||||
this.dynamicFormService = dynamicFormService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicFormService getService() {
|
||||
return dynamicFormService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form-dao</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-dao-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-dynamic-form-entity</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-dao-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -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<DynamicFormColumnEntity,String> {
|
||||
}
|
||||
@@ -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<DynamicFormEntity,String> {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form-dao</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-dao-mybatis</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-dynamic-form-dao-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-dao-mybatis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.hswebfarmework.web.dao.form.DynamicFormColumnDao">
|
||||
<resultMap id="DynamicFormColumnResultMap" type="org.hswebfarmework.web.entity.form.SimpleDynamicFormColumnEntity">
|
||||
<id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="formId" column="form_id" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="columnName" column="column_name" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="alias" column="alias" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="javaType" column="java_type" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="jdbcType" column="jdbc_type" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="dataType" column="data_type" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="length" column="length" javaType="Integer" jdbcType="DECIMAL"/>
|
||||
<result property="precision" column="precision" javaType="Integer" jdbcType="DECIMAL"/>
|
||||
<result property="scale" column="scale" javaType="Integer" jdbcType="DECIMAL"/>
|
||||
<result property="properties" column="properties" javaType="String" jdbcType="CLOB"/>
|
||||
</resultMap>
|
||||
|
||||
<!--用于动态生成sql所需的配置-->
|
||||
<sql id="config">
|
||||
<bind name="resultMapId" value="'DynamicFormColumnResultMap'"/>
|
||||
<bind name="tableName" value="'S_DYN_FORM_COLUMN'"/>
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="org.hswebfarmework.web.entity.form.DynamicFormColumnEntity">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildInsertSql"/>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByPk" parameterType="String">
|
||||
delete from s_dyn_form_column where u_id =#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildDeleteSql"/>
|
||||
</delete>
|
||||
|
||||
<update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildUpdateSql"/>
|
||||
</update>
|
||||
|
||||
<select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="DynamicFormColumnResultMap">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildSelectSql"/>
|
||||
</select>
|
||||
|
||||
<select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildTotalSql"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.hswebfarmework.web.dao.form.DynamicFormDao">
|
||||
<resultMap id="DynamicFormResultMap" type="org.hswebfarmework.web.entity.form.SimpleDynamicFormEntity">
|
||||
<id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="tableName" column="table_name" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="version" column="version" javaType="Long" jdbcType="DECIMAL"/>
|
||||
<result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" javaType="Long" jdbcType="DECIMAL"/>
|
||||
<result property="updateTime" column="update_time" javaType="Long" jdbcType="DECIMAL"/>
|
||||
<result property="deployed" column="is_deployed" javaType="Boolean" jdbcType="DECIMAL"/>
|
||||
<result property="alias" column="alias" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="triggers" column="triggers" javaType="String" jdbcType="CLOB"/>
|
||||
<result property="correlations" column="correlations" javaType="String" jdbcType="CLOB"/>
|
||||
<result property="dataSourceId" column="data_source_id" javaType="String" jdbcType="VARCHAR"/>
|
||||
<result property="properties" column="properties" javaType="String" jdbcType="CLOB"/>
|
||||
<result property="type" column="type" javaType="String" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--用于动态生成sql所需的配置-->
|
||||
<sql id="config">
|
||||
<bind name="resultMapId" value="'DynamicFormResultMap'"/>
|
||||
<bind name="tableName" value="'s_dyn_form'"/>
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="org.hswebfarmework.web.entity.form.SimpleDynamicFormEntity" >
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildInsertSql"/>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByPk" parameterType="String">
|
||||
delete from s_dyn_form where u_id =#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildDeleteSql"/>
|
||||
</delete>
|
||||
|
||||
<update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildUpdateSql"/>
|
||||
</update>
|
||||
|
||||
<select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="DynamicFormResultMap">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildSelectSql"/>
|
||||
</select>
|
||||
|
||||
<select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
|
||||
<include refid="config"/>
|
||||
<include refid="BasicMapper.buildTotalSql"/>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-dao</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>hsweb-system-dynamic-form-dao-api</module>
|
||||
<module>hsweb-system-dynamic-form-dao-mybatis</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-entity</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-entity</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -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<String> {
|
||||
/*-------------------------------------------
|
||||
| 属性名常量 |
|
||||
===========================================*/
|
||||
/**
|
||||
* 表单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);
|
||||
|
||||
}
|
||||
@@ -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>{
|
||||
/*-------------------------------------------
|
||||
| 属性名常量 |
|
||||
===========================================*/
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -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<String> 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;
|
||||
}
|
||||
}
|
||||
@@ -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<String> 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form-service</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-service-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-service-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-dynamic-form-dao-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -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<DynamicFormColumnEntity, String> {
|
||||
|
||||
}
|
||||
@@ -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<DynamicFormEntity, String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form-service</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-service-simple</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-commons-service-simple</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-dynamic-form-service-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -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<DynamicFormColumnEntity, String>
|
||||
implements DynamicFormColumnService {
|
||||
@Autowired
|
||||
private DynamicFormColumnDao dynamicFormColumnDao;
|
||||
@Override
|
||||
protected IDGenerator<String> getIDGenerator() {
|
||||
return IDGenerator.MD5;
|
||||
}
|
||||
@Override
|
||||
public DynamicFormColumnDao getDao() {
|
||||
return dynamicFormColumnDao;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<DynamicFormEntity, String>
|
||||
implements DynamicFormService {
|
||||
@Autowired
|
||||
private DynamicFormDao dynamicFormDao;
|
||||
@Override
|
||||
protected IDGenerator<String> getIDGenerator() {
|
||||
return IDGenerator.MD5;
|
||||
}
|
||||
@Override
|
||||
public DynamicFormDao getDao() {
|
||||
return dynamicFormDao;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-service</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>hsweb-system-dynamic-form-service-api</module>
|
||||
<module>hsweb-system-dynamic-form-service-simple</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form-starter</artifactId>
|
||||
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-form-service-simple</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-form-dao-mybatis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-system-form-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.0.26</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-spring-boot-starter</artifactId>
|
||||
<version>${hsweb.framework.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hswebframework.web</groupId>
|
||||
<artifactId>hsweb-tests</artifactId>
|
||||
<version>${hsweb.framework.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -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) { //卸载时执行
|
||||
|
||||
});
|
||||
@@ -10,6 +10,14 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hsweb-system-dynamic-form</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>hsweb-system-dynamic-form-dao</module>
|
||||
<module>hsweb-system-dynamic-form-service</module>
|
||||
<module>hsweb-system-dynamic-form-controller</module>
|
||||
<module>hsweb-system-dynamic-form-entity</module>
|
||||
<module>hsweb-system-dynamic-form-starter</module>
|
||||
</modules>
|
||||
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user