Browse Source

商品类型相关初次提交

qxp192083 5 năm trước cách đây
mục cha
commit
c91bccb84a
26 tập tin đã thay đổi với 1432 bổ sung3 xóa
  1. 6 1
      dgtly-admin/pom.xml
  2. 2 0
      dgtly-goods/dgtly-goods-admin/pom.xml
  3. 125 0
      dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeAttributeController.java
  4. 125 0
      dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeController.java
  5. 43 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/add.html
  6. 106 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/attribute.html
  7. 44 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/edit.html
  8. 37 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/add.html
  9. 38 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/edit.html
  10. 106 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/type.html
  11. 2 0
      dgtly-goods/dgtly-goods-api/pom.xml
  12. 6 1
      dgtly-goods/dgtly-goods-common/pom.xml
  13. 84 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsType.java
  14. 84 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsTypeAttribute.java
  15. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeAttributeMapper.java
  16. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeMapper.java
  17. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsTypeAttributeService.java
  18. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsTypeService.java
  19. 97 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeAttributeServiceImpl.java
  20. 97 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeServiceImpl.java
  21. 89 0
      dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeAttributeMapper.xml
  22. 87 0
      dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeMapper.xml
  23. 0 1
      dgtly-goods/pom.xml
  24. 2 0
      dgtly-member/dgtly-member-admin/pom.xml
  25. 2 0
      dgtly-member/dgtly-member-api/pom.xml
  26. 6 0
      pom.xml

+ 6 - 1
dgtly-admin/pom.xml

@@ -78,7 +78,12 @@
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-generator</artifactId>
         </dependency>
-
+        <!-- 商品管理-->
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>dgtly-goods-admin</artifactId>
+            <version>4.0.0</version>
+        </dependency>
 
     </dependencies>
 

+ 2 - 0
dgtly-goods/dgtly-goods-admin/pom.xml

@@ -10,6 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>dgtly-goods-admin</artifactId>
+
     <dependencies>
         <!--管理端核心类-->
         <dependency>
@@ -36,6 +37,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-goods-common</artifactId>
+            <version>4.0.0</version>
         </dependency>
 
     </dependencies>

+ 125 - 0
dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeAttributeController.java

@@ -0,0 +1,125 @@
+package com.dgtly.goods.controller;
+
+import java.util.List;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.goods.domain.GoodsTypeAttribute;
+import com.dgtly.goods.service.IGoodsTypeAttributeService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+@Controller
+@RequestMapping("/system/attribute")
+public class GoodsTypeAttributeController extends BaseController
+{
+    private String prefix = "goods/attribute";
+
+    @Autowired
+    private IGoodsTypeAttributeService goodsTypeAttributeService;
+
+    @RequiresPermissions("system:attribute:view")
+    @GetMapping()
+    public String attribute()
+    {
+        return prefix + "/attribute";
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @RequiresPermissions("system:attribute:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        startPage();
+        List<GoodsTypeAttribute> list = goodsTypeAttributeService.selectGoodsTypeAttributeList(goodsTypeAttribute);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @RequiresPermissions("system:attribute:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        List<GoodsTypeAttribute> list = goodsTypeAttributeService.selectGoodsTypeAttributeList(goodsTypeAttribute);
+        ExcelUtil<GoodsTypeAttribute> util = new ExcelUtil<GoodsTypeAttribute>(GoodsTypeAttribute.class);
+        return util.exportExcel(list, "attribute");
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存【请填写功能名称】
+     */
+    @RequiresPermissions("system:attribute:add")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        return toAjax(goodsTypeAttributeService.insertGoodsTypeAttribute(goodsTypeAttribute));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap)
+    {
+        GoodsTypeAttribute goodsTypeAttribute = goodsTypeAttributeService.selectGoodsTypeAttributeById(id);
+        mmap.put("goodsTypeAttribute", goodsTypeAttribute);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存【请填写功能名称】
+     */
+    @RequiresPermissions("system:attribute:edit")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        return toAjax(goodsTypeAttributeService.updateGoodsTypeAttribute(goodsTypeAttribute));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @RequiresPermissions("system:attribute:remove")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(goodsTypeAttributeService.deleteGoodsTypeAttributeByIds(ids));
+    }
+}

+ 125 - 0
dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeController.java

@@ -0,0 +1,125 @@
+package com.dgtly.goods.controller;
+
+import java.util.List;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.goods.domain.GoodsType;
+import com.dgtly.goods.service.IGoodsTypeService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 商品分类列Controller
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+@Controller
+@RequestMapping("/system/type")
+public class GoodsTypeController extends BaseController
+{
+    private String prefix = "system/type";
+
+    @Autowired
+    private IGoodsTypeService goodsTypeService;
+
+    @RequiresPermissions("system:type:view")
+    @GetMapping()
+    public String type()
+    {
+        return prefix + "/type";
+    }
+
+    /**
+     * 查询商品分类列列表
+     */
+    @RequiresPermissions("system:type:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(GoodsType goodsType)
+    {
+        startPage();
+        List<GoodsType> list = goodsTypeService.selectGoodsTypeList(goodsType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品分类列列表
+     */
+    @RequiresPermissions("system:type:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(GoodsType goodsType)
+    {
+        List<GoodsType> list = goodsTypeService.selectGoodsTypeList(goodsType);
+        ExcelUtil<GoodsType> util = new ExcelUtil<GoodsType>(GoodsType.class);
+        return util.exportExcel(list, "type");
+    }
+
+    /**
+     * 新增商品分类列
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存商品分类列
+     */
+    @RequiresPermissions("system:type:add")
+    @Log(title = "商品分类列", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(GoodsType goodsType)
+    {
+        return toAjax(goodsTypeService.insertGoodsType(goodsType));
+    }
+
+    /**
+     * 修改商品分类列
+     */
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap)
+    {
+        GoodsType goodsType = goodsTypeService.selectGoodsTypeById(id);
+        mmap.put("goodsType", goodsType);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存商品分类列
+     */
+    @RequiresPermissions("system:type:edit")
+    @Log(title = "商品分类列", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(GoodsType goodsType)
+    {
+        return toAjax(goodsTypeService.updateGoodsType(goodsType));
+    }
+
+    /**
+     * 删除商品分类列
+     */
+    @RequiresPermissions("system:type:remove")
+    @Log(title = "商品分类列", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(goodsTypeService.deleteGoodsTypeByIds(ids));
+    }
+}

+ 43 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/add.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增【请填写功能名称】')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-attribute-add">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">所属商品分类goods_type的id:</label>
+                <div class="col-sm-8">
+                    <input name="typeId" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">属性名:</label>
+                <div class="col-sm-8">
+                    <input name="name" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">字段排序:</label>
+                <div class="col-sm-8">
+                    <input name="sort" class="form-control" type="text">
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/attribute"
+        $("#form-attribute-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-attribute-add').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 106 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/attribute.html

@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('【请填写功能名称】列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>所属商品分类goods_type的id:</p>
+                                <input type="text" name="typeId"/>
+                            </li>
+                            <li>
+                                <p>属性名:</p>
+                                <input type="text" name="name"/>
+                            </li>
+                            <li>
+                                <p>字段排序:</p>
+                                <input type="text" name="sort"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:attribute:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:attribute:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:attribute:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:attribute:export">
+                    <i class="fa fa-download"></i> 导出
+                 </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('system:attribute:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:attribute:remove')}]];
+        var prefix = ctx + "system/attribute";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "【请填写功能名称】",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'id', 
+                    title : '字段排序',
+                    visible: false
+                },
+                {
+                    field : 'typeId', 
+                    title : '所属商品分类goods_type的id'
+                },
+                {
+                    field : 'name', 
+                    title : '属性名'
+                },
+                {
+                    field : 'sort', 
+                    title : '字段排序'
+                },
+                {
+                    field : 'remark', 
+                    title : '备注'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+    </script>
+</body>
+</html>

+ 44 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/attribute/edit.html

@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改【请填写功能名称】')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-attribute-edit" th:object="${goodsTypeAttribute}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">所属商品分类goods_type的id:</label>
+                <div class="col-sm-8">
+                    <input name="typeId" th:field="*{typeId}" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">属性名:</label>
+                <div class="col-sm-8">
+                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">字段排序:</label>
+                <div class="col-sm-8">
+                    <input name="sort" th:field="*{sort}" class="form-control" type="text">
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/attribute";
+        $("#form-attribute-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-attribute-edit').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 37 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/add.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增商品分类列')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-type-add">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">类型名称:</label>
+                <div class="col-sm-8">
+                    <input name="name" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">父属性id:</label>
+                <div class="col-sm-8">
+                    <input name="parentId" class="form-control" type="text" required>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/type"
+        $("#form-type-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-type-add').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 38 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/edit.html

@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改商品分类列')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-type-edit" th:object="${goodsType}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">类型名称:</label>
+                <div class="col-sm-8">
+                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">父属性id:</label>
+                <div class="col-sm-8">
+                    <input name="parentId" th:field="*{parentId}" class="form-control" type="text" required>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/type";
+        $("#form-type-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-type-edit').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 106 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/type.html

@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('商品分类列列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>类型名称:</p>
+                                <input type="text" name="name"/>
+                            </li>
+                            <li>
+                                <p>父属性id:</p>
+                                <input type="text" name="parentId"/>
+                            </li>
+                            <li>
+                                <p>祖级列表:</p>
+                                <input type="text" name="ancestors"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:type:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:type:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:type:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:type:export">
+                    <i class="fa fa-download"></i> 导出
+                 </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('system:type:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('system:type:remove')}]];
+        var prefix = ctx + "system/type";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "商品分类列",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'id', 
+                    title : '祖级列表',
+                    visible: false
+                },
+                {
+                    field : 'name', 
+                    title : '类型名称'
+                },
+                {
+                    field : 'parentId', 
+                    title : '父属性id'
+                },
+                {
+                    field : 'ancestors', 
+                    title : '祖级列表'
+                },
+                {
+                    field : 'remark', 
+                    title : '备注'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+    </script>
+</body>
+</html>

+ 2 - 0
dgtly-goods/dgtly-goods-api/pom.xml

@@ -15,6 +15,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-apiframework</artifactId>
+            <version>4.0.0</version>
         </dependency>
         <!--常用公共类-->
         <dependency>
@@ -24,6 +25,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-goods-common</artifactId>
+            <version>4.0.0</version>
         </dependency>
     </dependencies>
 

+ 6 - 1
dgtly-goods/dgtly-goods-common/pom.xml

@@ -10,6 +10,11 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>dgtly-goods-common</artifactId>
-
+    <dependencies>
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>dgtly-common</artifactId>
+        </dependency>
+    </dependencies>
 
 </project>

+ 84 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsType.java

@@ -0,0 +1,84 @@
+package com.dgtly.goods.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 商品分类列对象 goods_type
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public class GoodsType extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 类型名称 */
+    @Excel(name = "类型名称")
+    private String name;
+
+    /** 父属性id */
+    @Excel(name = "父属性id")
+    private Long parentId;
+
+    /** 祖级列表 */
+    @Excel(name = "祖级列表")
+    private String ancestors;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setParentId(Long parentId) 
+    {
+        this.parentId = parentId;
+    }
+
+    public Long getParentId() 
+    {
+        return parentId;
+    }
+    public void setAncestors(String ancestors) 
+    {
+        this.ancestors = ancestors;
+    }
+
+    public String getAncestors() 
+    {
+        return ancestors;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("parentId", getParentId())
+            .append("ancestors", getAncestors())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 84 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsTypeAttribute.java

@@ -0,0 +1,84 @@
+package com.dgtly.goods.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 goods_type_attribute
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public class GoodsTypeAttribute extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 所属商品分类goods_type的id */
+    @Excel(name = "所属商品分类goods_type的id")
+    private Long typeId;
+
+    /** 属性名 */
+    @Excel(name = "属性名")
+    private String name;
+
+    /** 字段排序(999最大排最前) */
+    @Excel(name = "字段排序", readConverterExp = "9=99最大排最前")
+    private Long sort;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTypeId(Long typeId) 
+    {
+        this.typeId = typeId;
+    }
+
+    public Long getTypeId() 
+    {
+        return typeId;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setSort(Long sort) 
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort() 
+    {
+        return sort;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("typeId", getTypeId())
+            .append("name", getName())
+            .append("sort", getSort())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeAttributeMapper.java

@@ -0,0 +1,61 @@
+package com.dgtly.goods.mapper;
+
+import com.dgtly.goods.domain.GoodsTypeAttribute;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface GoodsTypeAttributeMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 【请填写功能名称】
+     */
+    public GoodsTypeAttribute selectGoodsTypeAttributeById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<GoodsTypeAttribute> selectGoodsTypeAttributeList(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeAttributeById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeAttributeByIds(String[] ids);
+}

+ 61 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeMapper.java

@@ -0,0 +1,61 @@
+package com.dgtly.goods.mapper;
+
+import com.dgtly.goods.domain.GoodsType;
+import java.util.List;
+
+/**
+ * 商品分类列Mapper接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface GoodsTypeMapper 
+{
+    /**
+     * 查询商品分类列
+     * 
+     * @param id 商品分类列ID
+     * @return 商品分类列
+     */
+    public GoodsType selectGoodsTypeById(Long id);
+
+    /**
+     * 查询商品分类列列表
+     * 
+     * @param goodsType 商品分类列
+     * @return 商品分类列集合
+     */
+    public List<GoodsType> selectGoodsTypeList(GoodsType goodsType);
+
+    /**
+     * 新增商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    public int insertGoodsType(GoodsType goodsType);
+
+    /**
+     * 修改商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    public int updateGoodsType(GoodsType goodsType);
+
+    /**
+     * 删除商品分类列
+     * 
+     * @param id 商品分类列ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeById(Long id);
+
+    /**
+     * 批量删除商品分类列
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeByIds(String[] ids);
+}

+ 61 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsTypeAttributeService.java

@@ -0,0 +1,61 @@
+package com.dgtly.goods.service;
+
+import com.dgtly.goods.domain.GoodsTypeAttribute;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface IGoodsTypeAttributeService 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 【请填写功能名称】
+     */
+    public GoodsTypeAttribute selectGoodsTypeAttributeById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<GoodsTypeAttribute> selectGoodsTypeAttributeList(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeAttributeByIds(String ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeAttributeById(Long id);
+}

+ 61 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsTypeService.java

@@ -0,0 +1,61 @@
+package com.dgtly.goods.service;
+
+import com.dgtly.goods.domain.GoodsType;
+import java.util.List;
+
+/**
+ * 商品分类列Service接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface IGoodsTypeService 
+{
+    /**
+     * 查询商品分类列
+     * 
+     * @param id 商品分类列ID
+     * @return 商品分类列
+     */
+    public GoodsType selectGoodsTypeById(Long id);
+
+    /**
+     * 查询商品分类列列表
+     * 
+     * @param goodsType 商品分类列
+     * @return 商品分类列集合
+     */
+    public List<GoodsType> selectGoodsTypeList(GoodsType goodsType);
+
+    /**
+     * 新增商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    public int insertGoodsType(GoodsType goodsType);
+
+    /**
+     * 修改商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    public int updateGoodsType(GoodsType goodsType);
+
+    /**
+     * 批量删除商品分类列
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeByIds(String ids);
+
+    /**
+     * 删除商品分类列信息
+     * 
+     * @param id 商品分类列ID
+     * @return 结果
+     */
+    public int deleteGoodsTypeById(Long id);
+}

+ 97 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeAttributeServiceImpl.java

@@ -0,0 +1,97 @@
+package com.dgtly.goods.service.impl;
+
+import java.util.List;
+import com.dgtly.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.goods.mapper.GoodsTypeAttributeMapper;
+import com.dgtly.goods.domain.GoodsTypeAttribute;
+import com.dgtly.goods.service.IGoodsTypeAttributeService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+@Service
+public class GoodsTypeAttributeServiceImpl implements IGoodsTypeAttributeService 
+{
+    @Autowired
+    private GoodsTypeAttributeMapper goodsTypeAttributeMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public GoodsTypeAttribute selectGoodsTypeAttributeById(Long id)
+    {
+        return goodsTypeAttributeMapper.selectGoodsTypeAttributeById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<GoodsTypeAttribute> selectGoodsTypeAttributeList(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        return goodsTypeAttributeMapper.selectGoodsTypeAttributeList(goodsTypeAttribute);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        goodsTypeAttribute.setCreateTime(DateUtils.getNowDate());
+        return goodsTypeAttributeMapper.insertGoodsTypeAttribute(goodsTypeAttribute);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param goodsTypeAttribute 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateGoodsTypeAttribute(GoodsTypeAttribute goodsTypeAttribute)
+    {
+        goodsTypeAttribute.setUpdateTime(DateUtils.getNowDate());
+        return goodsTypeAttributeMapper.updateGoodsTypeAttribute(goodsTypeAttribute);
+    }
+
+    /**
+     * 删除【请填写功能名称】对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsTypeAttributeByIds(String ids)
+    {
+        return goodsTypeAttributeMapper.deleteGoodsTypeAttributeByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsTypeAttributeById(Long id)
+    {
+        return goodsTypeAttributeMapper.deleteGoodsTypeAttributeById(id);
+    }
+}

+ 97 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeServiceImpl.java

@@ -0,0 +1,97 @@
+package com.dgtly.goods.service.impl;
+
+import java.util.List;
+import com.dgtly.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.goods.mapper.GoodsTypeMapper;
+import com.dgtly.goods.domain.GoodsType;
+import com.dgtly.goods.service.IGoodsTypeService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 商品分类列Service业务层处理
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+@Service
+public class GoodsTypeServiceImpl implements IGoodsTypeService 
+{
+    @Autowired
+    private GoodsTypeMapper goodsTypeMapper;
+
+    /**
+     * 查询商品分类列
+     * 
+     * @param id 商品分类列ID
+     * @return 商品分类列
+     */
+    @Override
+    public GoodsType selectGoodsTypeById(Long id)
+    {
+        return goodsTypeMapper.selectGoodsTypeById(id);
+    }
+
+    /**
+     * 查询商品分类列列表
+     * 
+     * @param goodsType 商品分类列
+     * @return 商品分类列
+     */
+    @Override
+    public List<GoodsType> selectGoodsTypeList(GoodsType goodsType)
+    {
+        return goodsTypeMapper.selectGoodsTypeList(goodsType);
+    }
+
+    /**
+     * 新增商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    @Override
+    public int insertGoodsType(GoodsType goodsType)
+    {
+        goodsType.setCreateTime(DateUtils.getNowDate());
+        return goodsTypeMapper.insertGoodsType(goodsType);
+    }
+
+    /**
+     * 修改商品分类列
+     * 
+     * @param goodsType 商品分类列
+     * @return 结果
+     */
+    @Override
+    public int updateGoodsType(GoodsType goodsType)
+    {
+        goodsType.setUpdateTime(DateUtils.getNowDate());
+        return goodsTypeMapper.updateGoodsType(goodsType);
+    }
+
+    /**
+     * 删除商品分类列对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsTypeByIds(String ids)
+    {
+        return goodsTypeMapper.deleteGoodsTypeByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除商品分类列信息
+     * 
+     * @param id 商品分类列ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsTypeById(Long id)
+    {
+        return goodsTypeMapper.deleteGoodsTypeById(id);
+    }
+}

+ 89 - 0
dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeAttributeMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dgtly.goods.mapper.GoodsTypeAttributeMapper">
+    
+    <resultMap type="GoodsTypeAttribute" id="GoodsTypeAttributeResult">
+        <result property="id"    column="id"    />
+        <result property="typeId"    column="type_id"    />
+        <result property="name"    column="name"    />
+        <result property="sort"    column="sort"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectGoodsTypeAttributeVo">
+        select id, type_id, name, sort, create_time, create_by, update_time, update_by, remark from goods_type_attribute
+    </sql>
+
+    <select id="selectGoodsTypeAttributeList" parameterType="GoodsTypeAttribute" resultMap="GoodsTypeAttributeResult">
+        <include refid="selectGoodsTypeAttributeVo"/>
+        <where>  
+            <if test="typeId != null "> and type_id = #{typeId}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+        </where>
+    </select>
+    
+    <select id="selectGoodsTypeAttributeById" parameterType="Long" resultMap="GoodsTypeAttributeResult">
+        <include refid="selectGoodsTypeAttributeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertGoodsTypeAttribute" parameterType="GoodsTypeAttribute">
+        insert into goods_type_attribute
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null ">id,</if>
+            <if test="typeId != null ">type_id,</if>
+            <if test="name != null  and name != ''">name,</if>
+            <if test="sort != null ">sort,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="createBy != null  and createBy != ''">create_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+            <if test="updateBy != null  and updateBy != ''">update_by,</if>
+            <if test="remark != null  and remark != ''">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null ">#{id},</if>
+            <if test="typeId != null ">#{typeId},</if>
+            <if test="name != null  and name != ''">#{name},</if>
+            <if test="sort != null ">#{sort},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="createBy != null  and createBy != ''">#{createBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
+            <if test="remark != null  and remark != ''">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateGoodsTypeAttribute" parameterType="GoodsTypeAttribute">
+        update goods_type_attribute
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="typeId != null ">type_id = #{typeId},</if>
+            <if test="name != null  and name != ''">name = #{name},</if>
+            <if test="sort != null ">sort = #{sort},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null  and remark != ''">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteGoodsTypeAttributeById" parameterType="Long">
+        delete from goods_type_attribute where id = #{id}
+    </delete>
+
+    <delete id="deleteGoodsTypeAttributeByIds" parameterType="String">
+        delete from goods_type_attribute where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 87 - 0
dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeMapper.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dgtly.goods.mapper.GoodsTypeMapper">
+    
+    <resultMap type="GoodsType" id="GoodsTypeResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="parentId"    column="parent_id"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectGoodsTypeVo">
+        select id, name, parent_id, ancestors, create_time, create_by, update_time, update_by, remark from goods_type
+    </sql>
+
+    <select id="selectGoodsTypeList" parameterType="GoodsType" resultMap="GoodsTypeResult">
+        <include refid="selectGoodsTypeVo"/>
+        <where>  
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="parentId != null "> and parent_id = #{parentId}</if>
+            <if test="ancestors != null  and ancestors != ''"> and ancestors = #{ancestors}</if>
+        </where>
+    </select>
+    
+    <select id="selectGoodsTypeById" parameterType="Long" resultMap="GoodsTypeResult">
+        <include refid="selectGoodsTypeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertGoodsType" parameterType="GoodsType" useGeneratedKeys="true" keyProperty="id">
+        insert into goods_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="name != null  and name != ''">name,</if>
+            <if test="parentId != null ">parent_id,</if>
+            <if test="ancestors != null  and ancestors != ''">ancestors,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="createBy != null  and createBy != ''">create_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+            <if test="updateBy != null  and updateBy != ''">update_by,</if>
+            <if test="remark != null  and remark != ''">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="name != null  and name != ''">#{name},</if>
+            <if test="parentId != null ">#{parentId},</if>
+            <if test="ancestors != null  and ancestors != ''">#{ancestors},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="createBy != null  and createBy != ''">#{createBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
+            <if test="remark != null  and remark != ''">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateGoodsType" parameterType="GoodsType">
+        update goods_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null  and name != ''">name = #{name},</if>
+            <if test="parentId != null ">parent_id = #{parentId},</if>
+            <if test="ancestors != null  and ancestors != ''">ancestors = #{ancestors},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null  and remark != ''">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteGoodsTypeById" parameterType="Long">
+        delete from goods_type where id = #{id}
+    </delete>
+
+    <delete id="deleteGoodsTypeByIds" parameterType="String">
+        delete from goods_type where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 0 - 1
dgtly-goods/pom.xml

@@ -15,7 +15,6 @@
         <module>dgtly-goods-admin</module>
         <module>dgtly-goods-api</module>
         <module>dgtly-goods-common</module>
-        <module>dgtly-goods-common</module>
     </modules>
 
 

+ 2 - 0
dgtly-member/dgtly-member-admin/pom.xml

@@ -16,6 +16,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-framework</artifactId>
+            <version>4.0.0</version>
         </dependency>
 
         <!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
@@ -38,6 +39,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-member-common</artifactId>
+            <version>4.0.0</version>
         </dependency>
     </dependencies>
 </project>

+ 2 - 0
dgtly-member/dgtly-member-api/pom.xml

@@ -15,6 +15,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-apiframework</artifactId>
+            <version>4.0.0</version>
         </dependency>
         <!--常用公共类-->
         <dependency>
@@ -24,6 +25,7 @@
         <dependency>
             <groupId>com.dgtly</groupId>
             <artifactId>dgtly-member-common</artifactId>
+            <version>4.0.0</version>
         </dependency>
     </dependencies>
 

+ 6 - 0
pom.xml

@@ -202,6 +202,12 @@
 	            <artifactId>dgtly-common</artifactId>
 	            <version>${dgtly.version}</version>
 	        </dependency>
+			<!-- 商品模块-->
+			<dependency>
+				<groupId>com.dgtly</groupId>
+				<artifactId>dgtly-goods</artifactId>
+				<version>${dgtly.version}</version>
+			</dependency>
 
 
         </dependencies>