فهرست منبع

增加数据字典功能

zhouhao 8 سال پیش
والد
کامیت
80bfaa928f
36فایلهای تغییر یافته به همراه2317 افزوده شده و 0 حذف شده
  1. 49 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/pom.xml
  2. 58 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/src/main/java/org/hswebframework/web/controller/dictionary/DictionaryController.java
  3. 57 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/src/main/java/org/hswebframework/web/controller/dictionary/DictionaryParserController.java
  4. 45 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/pom.xml
  5. 28 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryDao.java
  6. 27 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryItemDao.java
  7. 27 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryParserDao.java
  8. 44 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/pom.xml
  9. 72 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryItemMapper.xml
  10. 66 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryMapper.xml
  11. 69 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryParserMapper.xml
  12. 36 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/pom.xml
  13. 40 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/pom.xml
  14. 102 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryEntity.java
  15. 160 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryItemEntity.java
  16. 138 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryParserEntity.java
  17. 137 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryEntity.java
  18. 170 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryItemEntity.java
  19. 171 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryParserEntity.java
  20. 42 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/pom.xml
  21. 29 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryItemService.java
  22. 34 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParser.java
  23. 28 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParserBuilder.java
  24. 32 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParserService.java
  25. 30 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryService.java
  26. 42 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/pom.xml
  27. 48 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryItemService.java
  28. 55 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryParserService.java
  29. 49 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryService.java
  30. 34 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/pom.xml
  31. 91 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml
  32. 92 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/main/resources/hsweb-starter.js
  33. 86 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryParserTests.java
  34. 91 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryTests.java
  35. 13 0
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/resources/application.yml
  36. 25 0
      hsweb-system/hsweb-system-dictionary/pom.xml

+ 49 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+
+<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-dictionary</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-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-dictionary-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>

+ 58 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/src/main/java/org/hswebframework/web/controller/dictionary/DictionaryController.java

@@ -0,0 +1,58 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+
+package org.hswebframework.web.controller.dictionary;
+
+import org.hswebframework.web.authorization.annotation.Authorize;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.GenericEntityController;
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+import org.hswebframework.web.logging.AccessLogger;
+import org.hswebframework.web.service.dictionary.DictionaryService;
+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.dictionary:dictionary}")
+@Authorize(permission = "dictionary")
+@AccessLogger("数据字典")
+public class DictionaryController implements GenericEntityController<DictionaryEntity<DictionaryItemEntity>, String, QueryParamEntity, DictionaryEntity> {
+
+    private DictionaryService dictionaryService;
+
+    @Override
+    public DictionaryEntity<DictionaryItemEntity> modelToEntity(DictionaryEntity model, DictionaryEntity entity) {
+        return model;
+    }
+
+    @Autowired
+    public void setDictionaryService(DictionaryService dictionaryService) {
+        this.dictionaryService = dictionaryService;
+    }
+
+    @Override
+    public DictionaryService getService() {
+        return dictionaryService;
+    }
+}

+ 57 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-controller/src/main/java/org/hswebframework/web/controller/dictionary/DictionaryParserController.java

@@ -0,0 +1,57 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+
+package org.hswebframework.web.controller.dictionary;
+
+import org.hswebframework.web.authorization.annotation.Authorize;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.GenericEntityController;
+import org.hswebframework.web.entity.dictionary.DictionaryParserEntity;
+import org.hswebframework.web.logging.AccessLogger;
+import org.hswebframework.web.service.dictionary.DictionaryParserService;
+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.dictionary-parser:dictionary-parser}")
+@Authorize(permission = "dictionary-parser")
+@AccessLogger("数据字典解析配置")
+public class DictionaryParserController implements GenericEntityController<DictionaryParserEntity, String, QueryParamEntity, DictionaryParserEntity> {
+
+    private DictionaryParserService dictionaryParserService;
+
+    @Override
+    public DictionaryParserEntity modelToEntity(DictionaryParserEntity model, DictionaryParserEntity entity) {
+        return model;
+    }
+
+    @Autowired
+    public void setDictionaryParserService(DictionaryParserService dictionaryParserService) {
+        this.dictionaryParserService = dictionaryParserService;
+    }
+
+    @Override
+    public DictionaryParserService getService() {
+        return dictionaryParserService;
+    }
+}

+ 45 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/pom.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 
+  ~   Copyright 2016 http://www.hswebframework.org
+  ~  
+  ~   Licensed under the Apache License, Version 2.0 (the "License");
+  ~   you may not use this file except in compliance with the License.
+  ~   You may obtain a copy of the License at
+  ~  
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~  
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~   See the License for the specific language governing permissions and
+  ~   limitations under the License.
+  ~  
+  -->
+
+<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-dictionary-dao</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-dao-api</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-system-dictionary-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>

+ 28 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryDao.java

@@ -0,0 +1,28 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.dao.dictionary;
+
+import org.hswebframework.web.dao.CrudDao;
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+
+/**
+*  数据字典 DAO接口
+*  @author hsweb-generator-online
+ */
+public interface DictionaryDao extends CrudDao<DictionaryEntity<DictionaryItemEntity>,String> {
+}

+ 27 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryItemDao.java

@@ -0,0 +1,27 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.dao.dictionary;
+
+import org.hswebframework.web.dao.CrudDao;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+
+/**
+*  数据字典选项 DAO接口
+*  @author hsweb-generator-online
+ */
+public interface DictionaryItemDao extends CrudDao<DictionaryItemEntity,String> {
+}

+ 27 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-api/src/main/java/org/hswebframework/web/dao/dictionary/DictionaryParserDao.java

@@ -0,0 +1,27 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.dao.dictionary;
+
+import org.hswebframework.web.dao.CrudDao;
+import org.hswebframework.web.entity.dictionary.DictionaryParserEntity;
+
+/**
+*  数据字典解析配置 DAO接口
+*  @author hsweb-generator-online
+ */
+public interface DictionaryParserDao extends CrudDao<DictionaryParserEntity,String> {
+}

+ 44 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/pom.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 
+  ~   Copyright 2016 http://www.hswebframework.org
+  ~  
+  ~   Licensed under the Apache License, Version 2.0 (the "License");
+  ~   you may not use this file except in compliance with the License.
+  ~   You may obtain a copy of the License at
+  ~  
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~  
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~   See the License for the specific language governing permissions and
+  ~   limitations under the License.
+  ~  
+  -->
+
+<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-dictionary-dao</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-dao-mybatis</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-system-dictionary-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>

+ 72 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryItemMapper.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hswebframework.web.dao.dictionary.DictionaryItemDao">
+    <resultMap id="DictionaryItemResultMap" type="org.hswebframework.web.entity.dictionary.SimpleDictionaryItemEntity">
+        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+            <result property="dictId" column="dict_id" javaType="String" jdbcType="VARCHAR"/>
+            <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+            <result property="value" column="value" javaType="String" jdbcType="VARCHAR"/>
+            <result property="text" column="text" javaType="String" jdbcType="VARCHAR"/>
+            <result property="valueType" column="value_type" javaType="String" jdbcType="VARCHAR"/>
+            <result property="enabled" column="enabled" javaType="Long" jdbcType="DECIMAL"/>
+            <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
+            <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
+            <result property="treeCode" column="tree_code" javaType="String" jdbcType="VARCHAR"/>
+            <result property="searchCode" column="search_code" javaType="String" jdbcType="VARCHAR"/>
+            <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
+            <result property="level" column="level" javaType="Long" jdbcType="DECIMAL"/>
+    </resultMap>
+
+    <!--用于动态生成sql所需的配置-->
+    <sql id="config">
+        <bind name="resultMapId" value="'DictionaryItemResultMap'"/>
+        <bind name="tableName" value="'s_dict_item'"/>
+    </sql>
+  
+    <insert id="insert" parameterType="org.hswebframework.web.entity.dictionary.SimpleDictionaryItemEntity" >
+        <include refid="config"/>
+        <include refid="BasicMapper.buildInsertSql"/>
+    </insert>
+
+    <delete id="deleteByPk" parameterType="String">
+        delete from s_dict_item 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="DictionaryItemResultMap">
+        <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>

+ 66 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryMapper.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hswebframework.web.dao.dictionary.DictionaryDao">
+    <resultMap id="DictionaryResultMap" type="org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity">
+        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+            <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+            <result property="classifiedId" column="classified_id" javaType="String" jdbcType="VARCHAR"/>
+            <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" javaType="Long" jdbcType="DECIMAL"/>
+            <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
+            <result property="enabled" column="enabled" javaType="Boolean" jdbcType="DECIMAL"/>
+    </resultMap>
+
+    <!--用于动态生成sql所需的配置-->
+    <sql id="config">
+        <bind name="resultMapId" value="'DictionaryResultMap'"/>
+        <bind name="tableName" value="'s_dictionary'"/>
+    </sql>
+  
+    <insert id="insert" parameterType="org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity" >
+        <include refid="config"/>
+        <include refid="BasicMapper.buildInsertSql"/>
+    </insert>
+
+    <delete id="deleteByPk" parameterType="String">
+        delete from s_dictionary 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="DictionaryResultMap">
+        <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>

+ 69 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryParserMapper.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hswebframework.web.dao.dictionary.DictionaryParserDao">
+    <resultMap id="DictionaryParserResultMap" type="org.hswebframework.web.entity.dictionary.SimpleDictionaryParserEntity">
+        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+            <result property="valueToTextParser" column="v_t_parser" javaType="String" jdbcType="CLOB"/>
+            <result property="textToValueParser" column="t_v_parser" javaType="String" jdbcType="CLOB"/>
+            <result property="onError" column="on_error" javaType="String" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" javaType="Long" jdbcType="DECIMAL"/>
+            <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" javaType="Long" jdbcType="DECIMAL"/>
+            <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+            <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
+            <result property="classifiedId" column="classified_id" javaType="String" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!--用于动态生成sql所需的配置-->
+    <sql id="config">
+        <bind name="resultMapId" value="'DictionaryParserResultMap'"/>
+        <bind name="tableName" value="'s_dict_parser'"/>
+    </sql>
+  
+    <insert id="insert" parameterType="org.hswebframework.web.entity.dictionary.SimpleDictionaryParserEntity" >
+        <include refid="config"/>
+        <include refid="BasicMapper.buildInsertSql"/>
+    </insert>
+
+    <delete id="deleteByPk" parameterType="String">
+        delete from s_dict_parser 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="DictionaryParserResultMap">
+        <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>

+ 36 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/pom.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 
+  ~   Copyright 2016 http://www.hswebframework.org
+  ~  
+  ~   Licensed under the Apache License, Version 2.0 (the "License");
+  ~   you may not use this file except in compliance with the License.
+  ~   You may obtain a copy of the License at
+  ~  
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~  
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~   See the License for the specific language governing permissions and
+  ~   limitations under the License.
+  ~  
+  -->
+
+<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-dictionary</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-dao</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>hsweb-system-dictionary-dao-api</module>
+        <module>hsweb-system-dictionary-dao-mybatis</module>
+    </modules>
+</project>

+ 40 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/pom.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 
+  ~   Copyright 2016 http://www.hswebframework.org
+  ~  
+  ~   Licensed under the Apache License, Version 2.0 (the "License");
+  ~   you may not use this file except in compliance with the License.
+  ~   You may obtain a copy of the License at
+  ~  
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~  
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~   See the License for the specific language governing permissions and
+  ~   limitations under the License.
+  ~  
+  -->
+
+<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-dictionary</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-entity</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-commons-entity</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 102 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryEntity.java

@@ -0,0 +1,102 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.GenericEntity;
+import org.hswebframework.web.commons.entity.RecordCreationEntity;
+
+import java.util.List;
+
+/**
+ * 数据字典 实体
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryEntity<ITEM extends DictionaryItemEntity> extends GenericEntity<String>, RecordCreationEntity {
+ /*-------------------------------------------
+    |               属性名常量               |
+    ===========================================*/
+    /**
+     * 字典名称
+     */
+    String name         = "name";
+    /**
+     * 分类id
+     */
+    String classifiedId = "classifiedId";
+    /**
+     * 说明
+     */
+    String describe     = "describe";
+    /**
+     * 创建时间
+     */
+    String createTime   = "createTime";
+    /**
+     * 创建人id
+     */
+    String creatorId    = "creatorId";
+    /**
+     * 是否启用
+     */
+    String enabled      = "enabled";
+
+    /**
+     * @return 字典名称
+     */
+    String getName();
+
+    /**
+     * 设置 字典名称
+     */
+    void setName(String name);
+
+    /**
+     * @return 分类id
+     */
+    String getClassifiedId();
+
+    /**
+     * 设置 分类id
+     */
+    void setClassifiedId(String classifiedId);
+
+    /**
+     * @return 说明
+     */
+    String getDescribe();
+
+    /**
+     * 设置 说明
+     */
+    void setDescribe(String describe);
+
+    /**
+     * @return 是否启用
+     */
+    Boolean isEnabled();
+
+    /**
+     * 设置 是否启用
+     */
+    void setEnabled(Boolean enabled);
+
+    List<ITEM> getItems();
+
+    void setItems(List<ITEM> items);
+
+}

+ 160 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryItemEntity.java

@@ -0,0 +1,160 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.TreeSortSupportEntity;
+
+/**
+ * 数据字典选项 实体
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryItemEntity extends TreeSortSupportEntity<String> {
+ /*-------------------------------------------
+    |               属性名常量               |
+    ===========================================*/
+    /**
+     * 字典id
+     */
+    String dictId     = "dictId";
+    /**
+     * 名称
+     */
+    String name       = "name";
+    /**
+     * 字典值
+     */
+    String value      = "value";
+    /**
+     * 字典文本
+     */
+    String text       = "text";
+    /**
+     * 字典值类型
+     */
+    String valueType  = "valueType";
+    /**
+     * 是否启用
+     */
+    String enabled    = "enabled";
+    /**
+     * 说明
+     */
+    String describe   = "describe";
+    /**
+     * 父级选项
+     */
+    String parentId   = "parentId";
+    /**
+     * 树编码
+     */
+    String treeCode   = "treeCode";
+    /**
+     * 快速搜索码
+     */
+    String searchCode = "searchCode";
+    /**
+     * 排序索引
+     */
+    String sortIndex  = "sortIndex";
+    /**
+     * 树结构层级
+     */
+    String level      = "level";
+
+    /**
+     * @return 字典id
+     */
+    String getDictId();
+
+    /**
+     * 设置 字典id
+     */
+    void setDictId(String dictId);
+
+    /**
+     * @return 名称
+     */
+    String getName();
+
+    /**
+     * 设置 名称
+     */
+    void setName(String name);
+
+    /**
+     * @return 字典值
+     */
+    String getValue();
+
+    /**
+     * 设置 字典值
+     */
+    void setValue(String value);
+
+    /**
+     * @return 字典文本
+     */
+    String getText();
+
+    /**
+     * 设置 字典文本
+     */
+    void setText(String text);
+
+    /**
+     * @return 字典值类型
+     */
+    String getValueType();
+
+    /**
+     * 设置 字典值类型
+     */
+    void setValueType(String valueType);
+
+    /**
+     * @return 是否启用
+     */
+    Long getEnabled();
+
+    /**
+     * 设置 是否启用
+     */
+    void setEnabled(Long enabled);
+
+    /**
+     * @return 说明
+     */
+    String getDescribe();
+
+    /**
+     * 设置 说明
+     */
+    void setDescribe(String describe);
+
+    /**
+     * @return 快速搜索码
+     */
+    String getSearchCode();
+
+    /**
+     * 设置 快速搜索码
+     */
+    void setSearchCode(String searchCode);
+
+
+}

+ 138 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryParserEntity.java

@@ -0,0 +1,138 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.GenericEntity;
+import org.hswebframework.web.commons.entity.RecordCreationEntity;
+
+/**
+ * 数据字典解析配置 实体
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryParserEntity extends GenericEntity<String>, RecordCreationEntity {
+ /*-------------------------------------------
+    |               属性名常量               |
+    ===========================================*/
+    /**
+     * 值到文本转换方式
+     */
+    String valueToTextParser = "valueToTextParser";
+    /**
+     * 文本到值转换方式
+     */
+    String textToValueParser = "textToValueParser";
+    /**
+     * 转换失败时的操作
+     */
+    String onError           = "onError";
+    /**
+     * 创建时间
+     */
+    String createTime        = "createTime";
+    /**
+     * 创建人id
+     */
+    String creatorId         = "creatorId";
+    /**
+     * 更新时间
+     */
+    String updateTime        = "updateTime";
+    /**
+     * 名称
+     */
+    String name              = "name";
+    /**
+     * 说明
+     */
+    String describe          = "describe";
+    /**
+     * 分类id
+     */
+    String classifiedId      = "classifiedId";
+
+    /**
+     * @return 值到文本转换方式
+     */
+    String getValueToTextParser();
+
+    /**
+     * 设置 值到文本转换方式
+     */
+    void setValueToTextParser(String valueToTextParser);
+
+    /**
+     * @return 文本到值转换方式
+     */
+    String getTextToValueParser();
+
+    /**
+     * 设置 文本到值转换方式
+     */
+    void setTextToValueParser(String textToValueParser);
+
+    /**
+     * @return 转换失败时的操作
+     */
+    String getOnError();
+
+    /**
+     * 设置 转换失败时的操作
+     */
+    void setOnError(String onError);
+
+    /**
+     * @return 更新时间
+     */
+    Long getUpdateTime();
+
+    /**
+     * 设置 更新时间
+     */
+    void setUpdateTime(Long updateTime);
+
+    /**
+     * @return 名称
+     */
+    String getName();
+
+    /**
+     * 设置 名称
+     */
+    void setName(String name);
+
+    /**
+     * @return 说明
+     */
+    String getDescribe();
+
+    /**
+     * 设置 说明
+     */
+    void setDescribe(String describe);
+
+    /**
+     * @return 分类id
+     */
+    String getClassifiedId();
+
+    /**
+     * 设置 分类id
+     */
+    void setClassifiedId(String classifiedId);
+
+}

+ 137 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryEntity.java

@@ -0,0 +1,137 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.SimpleGenericEntity;
+
+import java.util.List;
+
+/**
+ * 数据字典
+ *
+ * @author hsweb-generator-online
+ */
+public class SimpleDictionaryEntity extends SimpleGenericEntity<String> implements DictionaryEntity<SimpleDictionaryItemEntity> {
+    //字典名称
+    private String                           name;
+    //分类id
+    private String                           classifiedId;
+    //说明
+    private String                           describe;
+    //创建时间
+    private Long                             createTime;
+    //创建人id
+    private String                           creatorId;
+    //是否启用
+    private Boolean                          enabled;
+    //字段选项
+    private List<SimpleDictionaryItemEntity> items;
+
+    /**
+     * @return 字典名称
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * 设置 字典名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return 分类id
+     */
+    public String getClassifiedId() {
+        return this.classifiedId;
+    }
+
+    /**
+     * 设置 分类id
+     */
+    public void setClassifiedId(String classifiedId) {
+        this.classifiedId = classifiedId;
+    }
+
+    /**
+     * @return 说明
+     */
+    public String getDescribe() {
+        return this.describe;
+    }
+
+    /**
+     * 设置 说明
+     */
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    /**
+     * @return 创建时间
+     */
+    public Long getCreateTime() {
+        return this.createTime;
+    }
+
+    /**
+     * 设置 创建时间
+     */
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * @return 创建人id
+     */
+    public String getCreatorId() {
+        return this.creatorId;
+    }
+
+    /**
+     * 设置 创建人id
+     */
+    public void setCreatorId(String creatorId) {
+        this.creatorId = creatorId;
+    }
+
+    /**
+     * @return 是否启用
+     */
+    public Boolean isEnabled() {
+        return this.enabled;
+    }
+
+    /**
+     * 设置 是否启用
+     */
+    public void setEnabled(Boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    @Override
+    public List<SimpleDictionaryItemEntity> getItems() {
+        return items;
+    }
+
+    @Override
+    public void setItems(List<SimpleDictionaryItemEntity> items) {
+        this.items = items;
+    }
+}

+ 170 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryItemEntity.java

@@ -0,0 +1,170 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.SimpleTreeSortSupportEntity;
+
+import java.util.List;
+
+/**
+ * 数据字典选项
+ *
+ * @author hsweb-generator-online
+ */
+public class SimpleDictionaryItemEntity extends SimpleTreeSortSupportEntity<String> implements DictionaryItemEntity {
+    //字典id
+    private String dictId;
+    //名称
+    private String name;
+    //字典值
+    private String value;
+    //字典文本
+    private String text;
+    //字典值类型
+    private String valueType;
+    //是否启用
+    private Long   enabled;
+    //说明
+    private String describe;
+    //快速搜索码
+    private String searchCode;
+
+    private List<SimpleDictionaryItemEntity> children;
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<SimpleDictionaryItemEntity> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<SimpleDictionaryItemEntity> children) {
+        this.children = children;
+    }
+
+    /**
+     * @return 字典id
+     */
+    public String getDictId() {
+        return this.dictId;
+    }
+
+    /**
+     * 设置 字典id
+     */
+    public void setDictId(String dictId) {
+        this.dictId = dictId;
+    }
+
+    /**
+     * @return 名称
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * 设置 名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return 字典值
+     */
+    public String getValue() {
+        return this.value;
+    }
+
+    /**
+     * 设置 字典值
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * @return 字典文本
+     */
+    public String getText() {
+        return this.text;
+    }
+
+    /**
+     * 设置 字典文本
+     */
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    /**
+     * @return 字典值类型
+     */
+    public String getValueType() {
+        return this.valueType;
+    }
+
+    /**
+     * 设置 字典值类型
+     */
+    public void setValueType(String valueType) {
+        this.valueType = valueType;
+    }
+
+    /**
+     * @return 是否启用
+     */
+    public Long getEnabled() {
+        return this.enabled;
+    }
+
+    /**
+     * 设置 是否启用
+     */
+    public void setEnabled(Long enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * @return 说明
+     */
+    public String getDescribe() {
+        return this.describe;
+    }
+
+    /**
+     * 设置 说明
+     */
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    /**
+     * @return 快速搜索码
+     */
+    public String getSearchCode() {
+        return this.searchCode;
+    }
+
+    /**
+     * 设置 快速搜索码
+     */
+    public void setSearchCode(String searchCode) {
+        this.searchCode = searchCode;
+    }
+
+}

+ 171 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryParserEntity.java

@@ -0,0 +1,171 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.entity.dictionary;
+
+import org.hswebframework.web.commons.entity.SimpleGenericEntity;
+
+/**
+ * 数据字典解析配置
+ *
+ * @author hsweb-generator-online
+ */
+public class SimpleDictionaryParserEntity extends SimpleGenericEntity<String> implements DictionaryParserEntity {
+    //值到文本转换方式
+    private String valueToTextParser;
+    //文本到值转换方式
+    private String textToValueParser;
+    //转换失败时的操作
+    private String onError;
+    //创建时间
+    private Long   createTime;
+    //创建人id
+    private String creatorId;
+    //更新时间
+    private Long   updateTime;
+    //名称
+    private String name;
+    //说明
+    private String describe;
+    //分类id
+    private String classifiedId;
+
+    /**
+     * @return 值到文本转换方式
+     */
+    public String getValueToTextParser() {
+        return this.valueToTextParser;
+    }
+
+    /**
+     * 设置 值到文本转换方式
+     */
+    public void setValueToTextParser(String valueToTextParser) {
+        this.valueToTextParser = valueToTextParser;
+    }
+
+    /**
+     * @return 文本到值转换方式
+     */
+    public String getTextToValueParser() {
+        return this.textToValueParser;
+    }
+
+    /**
+     * 设置 文本到值转换方式
+     */
+    public void setTextToValueParser(String textToValueParser) {
+        this.textToValueParser = textToValueParser;
+    }
+
+    /**
+     * @return 转换失败时的操作
+     */
+    public String getOnError() {
+        return this.onError;
+    }
+
+    /**
+     * 设置 转换失败时的操作
+     */
+    public void setOnError(String onError) {
+        this.onError = onError;
+    }
+
+    /**
+     * @return 创建时间
+     */
+    public Long getCreateTime() {
+        return this.createTime;
+    }
+
+    /**
+     * 设置 创建时间
+     */
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * @return 创建人id
+     */
+    public String getCreatorId() {
+        return this.creatorId;
+    }
+
+    /**
+     * 设置 创建人id
+     */
+    public void setCreatorId(String creatorId) {
+        this.creatorId = creatorId;
+    }
+
+    /**
+     * @return 更新时间
+     */
+    public Long getUpdateTime() {
+        return this.updateTime;
+    }
+
+    /**
+     * 设置 更新时间
+     */
+    public void setUpdateTime(Long updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * @return 名称
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * 设置 名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return 说明
+     */
+    public String getDescribe() {
+        return this.describe;
+    }
+
+    /**
+     * 设置 说明
+     */
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    /**
+     * @return 分类id
+     */
+    public String getClassifiedId() {
+        return this.classifiedId;
+    }
+
+    /**
+     * 设置 分类id
+     */
+    public void setClassifiedId(String classifiedId) {
+        this.classifiedId = classifiedId;
+    }
+}

+ 42 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/pom.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<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-dictionary-service</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-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-dictionary-dao-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>

+ 29 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryItemService.java

@@ -0,0 +1,29 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary;
+
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+import org.hswebframework.web.service.CrudService;
+
+/**
+ *  数据字典选项 服务类
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryItemService extends CrudService<DictionaryItemEntity, String> {
+
+}

+ 34 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParser.java

@@ -0,0 +1,34 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *
+ */
+
+package org.hswebframework.web.service.dictionary;
+
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+
+import java.io.Serializable;
+import java.util.Optional;
+
+/**
+ * @author zhouhao
+ */
+public interface DictionaryParser<V, T> extends Serializable {
+    Optional<V> textToValue(DictionaryEntity<? extends DictionaryItemEntity> dict, T text);
+
+    Optional<T> valueToText(DictionaryEntity<? extends DictionaryItemEntity> dict, V value);
+}

+ 28 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParserBuilder.java

@@ -0,0 +1,28 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *
+ */
+
+package org.hswebframework.web.service.dictionary;
+
+/**
+ * @author zhouhao
+ */
+public interface DictionaryParserBuilder {
+    DictionaryParser<Object, String> buildValueToTextParser(String config);
+
+    DictionaryParser<String, Object> buildTextToValueParser(String config);
+}

+ 32 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryParserService.java

@@ -0,0 +1,32 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary;
+
+import org.hswebframework.web.entity.dictionary.DictionaryParserEntity;
+import org.hswebframework.web.service.CrudService;
+
+/**
+ * 数据字典解析配置 服务类
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryParserService extends CrudService<DictionaryParserEntity, String> {
+
+    <V, T> DictionaryParser<V, T> getParser(String parserId);
+
+
+}

+ 30 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-api/src/main/java/org/hswebframework/web/service/dictionary/DictionaryService.java

@@ -0,0 +1,30 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary;
+
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+import org.hswebframework.web.service.CrudService;
+
+/**
+ *  数据字典 服务类
+ *
+ * @author hsweb-generator-online
+ */
+public interface DictionaryService extends CrudService<DictionaryEntity<DictionaryItemEntity>, String> {
+
+}

+ 42 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/pom.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<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-dictionary-service</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-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-dictionary-service-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>

+ 48 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryItemService.java

@@ -0,0 +1,48 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary.simple;
+
+import org.hswebframework.web.dao.dictionary.DictionaryItemDao;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+import org.hswebframework.web.id.IDGenerator;
+import org.hswebframework.web.service.AbstractTreeSortService;
+import org.hswebframework.web.service.dictionary.DictionaryItemService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 默认的服务实现
+ *
+ * @author hsweb-generator-online
+ */
+@Service("dictionaryItemService")
+public class SimpleDictionaryItemService extends AbstractTreeSortService<DictionaryItemEntity, String>
+        implements DictionaryItemService {
+    @Autowired
+    private DictionaryItemDao dictionaryItemDao;
+
+    @Override
+    protected IDGenerator<String> getIDGenerator() {
+        return IDGenerator.MD5;
+    }
+
+    @Override
+    public DictionaryItemDao getDao() {
+        return dictionaryItemDao;
+    }
+
+}

+ 55 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryParserService.java

@@ -0,0 +1,55 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary.simple;
+
+import org.hswebframework.web.dao.dictionary.DictionaryParserDao;
+import org.hswebframework.web.entity.dictionary.DictionaryParserEntity;
+import org.hswebframework.web.id.IDGenerator;
+import org.hswebframework.web.service.GenericEntityService;
+import org.hswebframework.web.service.dictionary.DictionaryParser;
+import org.hswebframework.web.service.dictionary.DictionaryParserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 默认的服务实现
+ *
+ * @author hsweb-generator-online
+ */
+@Service("dictionaryParserService")
+public class SimpleDictionaryParserService extends GenericEntityService<DictionaryParserEntity, String>
+        implements DictionaryParserService {
+    @Autowired
+    private DictionaryParserDao dictionaryParserDao;
+
+    @Override
+    protected IDGenerator<String> getIDGenerator() {
+        return IDGenerator.MD5;
+    }
+
+    @Override
+    public DictionaryParserDao getDao() {
+        return dictionaryParserDao;
+    }
+
+    @Override
+    public <V, T> DictionaryParser<V, T> getParser(String parserId) {
+        // TODO: 17-3-9
+        return null;
+    }
+
+}

+ 49 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/hsweb-system-dictionary-service-simple/src/main/java/org/hswebframework/web/service/dictionary/simple/SimpleDictionaryService.java

@@ -0,0 +1,49 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *  
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  
+ */
+package org.hswebframework.web.service.dictionary.simple;
+
+import org.hswebframework.web.dao.dictionary.DictionaryDao;
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
+import org.hswebframework.web.id.IDGenerator;
+import org.hswebframework.web.service.GenericEntityService;
+import org.hswebframework.web.service.dictionary.DictionaryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 默认的服务实现
+ *
+ * @author hsweb-generator-online
+ */
+@Service("dictionaryService")
+public class SimpleDictionaryService extends GenericEntityService<DictionaryEntity<DictionaryItemEntity>, String>
+        implements DictionaryService {
+    @Autowired
+    private DictionaryDao dictionaryDao;
+
+    @Override
+    protected IDGenerator<String> getIDGenerator() {
+        return IDGenerator.MD5;
+    }
+
+    @Override
+    public DictionaryDao getDao() {
+        return dictionaryDao;
+    }
+
+}

+ 34 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-service/pom.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+<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-dictionary</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-service</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>hsweb-system-dictionary-service-api</module>
+        <module>hsweb-system-dictionary-service-simple</module>
+    </modules>
+</project>

+ 91 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+
+<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-dictionary</artifactId>
+        <groupId>org.hswebframework.web</groupId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>hsweb-system-dictionary-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-dictionary-service-simple</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-system-dictionary-dao-mybatis</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-system-dictionary-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>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hswebframework.web</groupId>
+            <artifactId>hsweb-tests</artifactId>
+            <version>${project.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>

+ 92 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/main/resources/hsweb-starter.js

@@ -0,0 +1,92 @@
+/*
+ * Copyright 2016 http://www.hswebframework.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+//组件信息
+var info = {
+    groupId: "${project.groupId}",
+    artifactId: "${project.artifactId}",
+    version: "${project.version}",
+    website: "https://github.com/hs-web/hsweb-framework/tree/master/hsweb-system/hsweb-system-dictionary",
+    author: "zh.sqy@qq.com",
+    comment: "数据字典"
+};
+
+//版本更新信息
+var versions = [
+    // {
+    //     version: "3.0.0",
+    //     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_dictionary")
+        .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(64).commit()
+        .addColumn().name("classified_id").alias("classifiedId").comment("分类id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
+        .addColumn().name("create_time").alias("createTime").comment("创建时间").jdbcType(java.sql.JDBCType.DECIMAL).length(32,0).commit()
+        .addColumn().name("creator_id").alias("creatorId").comment("创建人id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4,0).commit()
+        .comment("数据字典").commit();
+
+    database.createOrAlter("s_dict_item")
+        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
+        .addColumn().name("dict_id").alias("dictId").comment("字典id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("name").alias("name").comment("名称").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
+        .addColumn().name("value").alias("value").comment("字典值").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
+        .addColumn().name("text").alias("text").comment("字典文本").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
+        .addColumn().name("value_type").alias("valueType").comment("字典值类型").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
+        .addColumn().name("is_enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4,0).commit()
+        .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
+        .addColumn().name("parent_id").alias("parentId").comment("父级选项").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("tree_code").alias("treeCode").comment("树编码").jdbcType(java.sql.JDBCType.VARCHAR).length(3000).commit()
+        .addColumn().name("search_code").alias("searchCode").comment("快速搜索码").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
+        .addColumn().name("sort_index").alias("sortIndex").comment("排序索引").jdbcType(java.sql.JDBCType.DECIMAL).length(32,0).commit()
+        .addColumn().name("level").alias("level").comment("树结构层级").jdbcType(java.sql.JDBCType.DECIMAL).length(32,0).commit()
+        .comment("数据字典解析配置").commit();
+
+    database.createOrAlter("s_dict_parser")
+        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
+        .addColumn().name("v_t_parser").alias("valueToTextParser").comment("值到文本转换方式").jdbcType(java.sql.JDBCType.CLOB).commit()
+        .addColumn().name("t_v_parser").alias("textToValueParser").comment("文本到值转换方式").jdbcType(java.sql.JDBCType.CLOB).commit()
+        .addColumn().name("on_error").alias("onError").comment("转换失败时的操作").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("creator_id").alias("creatorId").comment("创建人id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
+        .addColumn().name("update_time").alias("updateTime").comment("更新时间").jdbcType(java.sql.JDBCType.DECIMAL).length(32,0).commit()
+        .addColumn().name("name").alias("name").comment("名称").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
+        .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
+        .addColumn().name("classified_id").alias("classifiedId").comment("分类id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).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) { //卸载时执行
+
+    });

+ 86 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryParserTests.java

@@ -0,0 +1,86 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *
+ */
+
+package org.hswebframework.web.starter.dictionary;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import org.hswebframework.web.entity.dictionary.DictionaryParserEntity;
+import org.hswebframework.web.entity.dictionary.SimpleDictionaryParserEntity;
+import org.hswebframework.web.starter.convert.FastJsonHttpMessageConverter;
+import org.hswebframework.web.tests.SimpleWebApplicationTests;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+
+/**
+ * TODO 完善单元测试
+ *
+ * @author hsweb-generator-online
+ */
+public class DictionaryParserTests extends SimpleWebApplicationTests {
+
+    @Autowired
+    private FastJsonHttpMessageConverter fastJsonHttpMessageConverter;
+
+    @Test
+    public void testCrud() throws Exception {
+        DictionaryParserEntity entity = entityFactory.newInstance(DictionaryParserEntity.class);
+        //todo 设置测试属性
+        entity.setName("test");
+        entity.setClassifiedId("1");
+        // test add data
+        String requestBody = JSON.toJSONString(entity);
+        JSONObject result = testPost("/dictionary-parser").setUp(setup -> setup.contentType(MediaType.APPLICATION_JSON).content(requestBody)).exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+        String id = result.getString("result");
+        Assert.assertNotNull(id);
+        entity.setId(id);
+        // test get data
+        result = testGet("/dictionary-parser/" + id).exec().resultAsJson();
+        entity = result.getObject("result", entityFactory.getInstanceType(DictionaryParserEntity.class));
+
+        Assert.assertEquals(200, result.get("status"));
+        Assert.assertNotNull(result.getJSONObject("result"));
+
+        Assert.assertEquals(fastJsonHttpMessageConverter.converter(entity),
+                fastJsonHttpMessageConverter.converter(result.getObject("result", entityFactory.getInstanceType(DictionaryParserEntity.class))));
+        //todo 修改测试属性
+        DictionaryParserEntity newEntity = entityFactory.newInstance(DictionaryParserEntity.class);
+        newEntity.setName("test");
+        newEntity.setClassifiedId("aasd");
+        result = testPut("/dictionary-parser/" + id)
+                .setUp(setup ->
+                        setup.contentType(MediaType.APPLICATION_JSON)
+                                .content(JSON.toJSONString(newEntity)))
+                .exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+
+        result = testGet("/dictionary-parser/" + id).exec().resultAsJson();
+        result = result.getJSONObject("result");
+        Assert.assertNotNull(result);
+
+        result = testDelete("/dictionary-parser/" + id).exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+
+        result = testGet("/dictionary-parser/" + id).exec().resultAsJson();
+        Assert.assertEquals(404, result.get("status"));
+    }
+}

+ 91 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryTests.java

@@ -0,0 +1,91 @@
+/*
+ *  Copyright 2016 http://www.hswebframework.org
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *
+ */
+
+package org.hswebframework.web.starter.dictionary;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import org.hswebframework.web.entity.dictionary.DictionaryEntity;
+import org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity;
+import org.hswebframework.web.starter.convert.FastJsonHttpMessageConverter;
+import org.hswebframework.web.tests.SimpleWebApplicationTests;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+
+/**
+ * TODO 完善单元测试
+ *
+ * @author hsweb-generator-online
+ */
+public class DictionaryTests extends SimpleWebApplicationTests {
+
+    @Autowired
+    private FastJsonHttpMessageConverter fastJsonHttpMessageConverter;
+
+    @Test
+    public void testCrud() throws Exception {
+        DictionaryEntity entity = entityFactory.newInstance(DictionaryEntity.class);
+        //todo 设置测试属性
+        entity.setName("test");
+        entity.setCreatorId("admin");
+        entity.setCreateTime(System.currentTimeMillis());
+        entity.setId("test");
+        entity.setDescribe("test");
+        entity.setClassifiedId("test");
+        entity.setEnabled(true);
+        // test add data
+        String requestBody = JSON.toJSONString(entity);
+        JSONObject result = testPost("/dictionary").setUp(setup -> setup.contentType(MediaType.APPLICATION_JSON).content(requestBody)).exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+        String id = result.getString("result");
+        Assert.assertNotNull(id);
+        entity.setId(id);
+        // test get data
+        result = testGet("/dictionary/" + id).exec().resultAsJson();
+        entity = result.getObject("result", entityFactory.getInstanceType(DictionaryEntity.class));
+
+        Assert.assertEquals(200, result.get("status"));
+        Assert.assertNotNull(result.getJSONObject("result"));
+
+        Assert.assertEquals(fastJsonHttpMessageConverter.converter(entity),
+                fastJsonHttpMessageConverter.converter(result.getObject("result", entityFactory.getInstanceType(DictionaryEntity.class))));
+        //todo 修改测试属性
+        DictionaryEntity newEntity = entityFactory.newInstance(DictionaryEntity.class);
+        newEntity.setName("test");
+
+        result = testPut("/dictionary/" + id)
+                .setUp(setup ->
+                        setup.contentType(MediaType.APPLICATION_JSON)
+                                .content(JSON.toJSONString(newEntity)))
+                .exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+
+        result = testGet("/dictionary/" + id).exec().resultAsJson();
+        result = result.getJSONObject("result");
+        Assert.assertNotNull(result);
+
+        result = testDelete("/dictionary/" + id).exec().resultAsJson();
+        Assert.assertEquals(200, result.get("status"));
+
+        result = testGet("/dictionary/" + id).exec().resultAsJson();
+        Assert.assertEquals(404, result.get("status"));
+    }
+}

+ 13 - 0
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/resources/application.yml

@@ -0,0 +1,13 @@
+spring:
+    aop:
+        auto: true
+    datasource:
+       url : jdbc:h2:mem:dictionary_test_mem
+       username : sa
+       password :
+       type: com.alibaba.druid.pool.DruidDataSource
+       driver-class-name : org.h2.Driver
+hsweb:
+    app:
+      name: 数据字典测试
+      version: 3.0.0

+ 25 - 0
hsweb-system/hsweb-system-dictionary/pom.xml

@@ -1,4 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 http://www.hswebframework.org
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~  See the License for the specific language governing permissions and
+  ~  limitations under the License.
+  ~
+  -->
+
 <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">
@@ -10,6 +27,14 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>hsweb-system-dictionary</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>hsweb-system-dictionary-dao</module>
+        <module>hsweb-system-dictionary-service</module>
+        <module>hsweb-system-dictionary-controller</module>
+        <module>hsweb-system-dictionary-entity</module>
+        <module>hsweb-system-dictionary-starter</module>
+    </modules>
 
 
 </project>