Browse Source

qxp提交

qxp192083 5 years ago
parent
commit
26c06c087c
44 changed files with 1820 additions and 693 deletions
  1. 0 1
      dgtly-admin/src/main/java/com/dgtly/web/controller/common/CommonController.java
  2. 26 38
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysCompanyController.java
  3. 2 1
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysProfileController.java
  4. 5 4
      dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysUserController.java
  5. 16 8
      dgtly-admin/src/main/resources/templates/system/company/add.html
  6. 2 2
      dgtly-admin/src/main/resources/templates/system/company/company.html
  7. 51 0
      dgtly-admin/src/main/resources/templates/system/company/tree.html
  8. 0 132
      dgtly-admin/src/main/resources/templates/visitor/youtuVisitorList.html
  9. 0 105
      dgtly-admin/src/main/resources/templates/youtu/logs/add.html
  10. 0 106
      dgtly-admin/src/main/resources/templates/youtu/logs/edit.html
  11. 0 149
      dgtly-admin/src/main/resources/templates/youtu/logs/logs.html
  12. 17 0
      dgtly-common/src/main/java/com/dgtly/common/utils/ShiroSaltUtil.java
  13. 1 10
      dgtly-framework/src/main/java/com/dgtly/framework/util/ShiroUtils.java
  14. 125 0
      dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsInfoController.java
  15. 44 15
      dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeController.java
  16. 260 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/add.html
  17. 115 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/edit.html
  18. 122 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/info.html
  19. 76 8
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/add.html
  20. 18 4
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/edit.html
  21. 49 0
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/tree.html
  22. 16 16
      dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/type.html
  23. 238 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsInfo.java
  24. 12 1
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsType.java
  25. 6 6
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsTypeAttribute.java
  26. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsInfoMapper.java
  27. 10 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeAttributeMapper.java
  28. 7 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/mapper/GoodsTypeMapper.java
  29. 61 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsInfoService.java
  30. 10 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/IGoodsTypeService.java
  31. 98 0
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsInfoServiceImpl.java
  32. 62 3
      dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeServiceImpl.java
  33. 141 0
      dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsInfoMapper.xml
  34. 15 27
      dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeAttributeMapper.xml
  35. 28 5
      dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeMapper.xml
  36. 6 32
      dgtly-system/src/main/java/com/dgtly/system/domain/SysCompany.java
  37. 1 1
      dgtly-system/src/main/java/com/dgtly/system/mapper/SysUserMapper.java
  38. 18 0
      dgtly-system/src/main/java/com/dgtly/system/service/ISysCompanyService.java
  39. 1 1
      dgtly-system/src/main/java/com/dgtly/system/service/ISysUserService.java
  40. 84 0
      dgtly-system/src/main/java/com/dgtly/system/service/impl/SysCompanyServiceImpl.java
  41. 2 2
      dgtly-system/src/main/java/com/dgtly/system/service/impl/SysUserServiceImpl.java
  42. 6 13
      dgtly-system/src/main/resources/mapper/system/SysCompanyMapper.xml
  43. 4 1
      dgtly-system/src/main/resources/mapper/system/SysDeptMapper.xml
  44. 4 2
      dgtly-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 0 - 1
dgtly-admin/src/main/java/com/dgtly/web/controller/common/CommonController.java

@@ -77,7 +77,6 @@ public class CommonController
     {
         try
         {
-
             // 上传文件路径
             String filePath = Global.getUploadPath();
             // 上传并返回新文件名称

+ 26 - 38
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysCompanyController.java

@@ -4,6 +4,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.dgtly.common.constant.UserConstants;
+import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import com.dgtly.framework.util.ShiroUtils;
 import com.dgtly.system.domain.SysDept;
@@ -113,45 +114,11 @@ public class SysCompanyController extends BaseController
     @PostMapping("/add")
     @ResponseBody
     @Transactional
-    public AjaxResult addSave(SysCompany sysCompany)
+    public AjaxResult addSave(SysCompany sysCompany,SysUser user)
     {
-        SysUser localuser =  ShiroUtils.getSysUser();
-        if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(sysCompany.getLoginName(),localuser.getCompanyId())))
-        {
-            return error("新增用户'" + sysCompany.getLoginName() + "'失败,登录账号已存在");
-        }else if (sysCompany.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH
-            || sysCompany.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH)
-        {
-            return error("密码长度为6-19,请重新设置!!");
-        }else if (sysCompany.getAuthorizeId()==null)
-        {
-            return error("优图权限组编号不能为空!!");
-        }
-
-        int rows = sysCompanyService.insertSysCompany(sysCompany);
-
-        if(rows>0){
-            //创建公司主体部门
-            SysDept dept = new SysDept();
-            dept.setCompanyId(sysCompany.getId()+0l);
-            dept.setDeptName(sysCompany.getCompany());
-            dept.setCreateBy(localuser.getUserId().toString());
-            deptService.insertDept(dept);
-            //创建管理员账号
-            SysUser user = new SysUser();
-            user.setUserName(sysCompany.getLoginName());
-            user.setSex("1");
-            Long[] roles = {1l};
-            user.setLoginName(sysCompany.getLoginName());
-            user.setPassword(sysCompany.getPassword());
-            user.setRoleIds(roles);
-            user.setDeptId(dept.getDeptId());
-            user.setCompanyId(sysCompany.getId()+0l);
-            user.setSalt(ShiroUtils.randomSalt());
-            user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
-            user.setCreateBy(ShiroUtils.getLoginName());
-            rows = userService.insertUser(user);
-        }
+        sysCompany.setCreateBy(ShiroUtils.getLoginName());
+        user.setCreateBy(ShiroUtils.getLoginName());
+        int rows = sysCompanyService.addCompany(sysCompany,user);
         return toAjax(rows);
     }
 
@@ -189,4 +156,25 @@ public class SysCompanyController extends BaseController
     {
         return toAjax(sysCompanyService.deleteSysCompanyByIds(ids));
     }
+
+
+    /**
+     * 查询公司表列表
+     */
+    @GetMapping("/tree")
+    public Object select(SysCompany sysCompany)
+    {
+
+        return prefix + "/tree";
+    };
+    /**
+     * 查询公司表列表
+     */
+    @GetMapping("/treeData")
+    @ResponseBody
+    public Object treeData(SysCompany sysCompany)
+    {
+        List<Ztree> list = sysCompanyService.selectSysCompanyTree(sysCompany);
+        return list;
+    }
 }

+ 2 - 1
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysProfileController.java

@@ -1,5 +1,6 @@
 package com.dgtly.web.controller.system;
 
+import com.dgtly.common.utils.ShiroSaltUtil;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -84,7 +85,7 @@ public class SysProfileController extends BaseController
         SysUser user = ShiroUtils.getSysUser();
         if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword))
         {
-            user.setSalt(ShiroUtils.randomSalt());
+            user.setSalt(ShiroSaltUtil.randomSalt());
             user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
             if (userService.resetUserPwd(user) > 0)
             {

+ 5 - 4
dgtly-admin/src/main/java/com/dgtly/web/controller/system/SysUserController.java

@@ -6,6 +6,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.dgtly.common.exception.BusinessException;
+import com.dgtly.common.utils.ShiroSaltUtil;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import com.dgtly.system.domain.SysCompany;
 import com.dgtly.system.domain.SysDept;
@@ -134,7 +135,7 @@ public class SysUserController extends BaseController
     {
         SysUser localUser = ShiroUtils.getSysUser();
         user.setCompanyId(localUser.getCompanyId());
-        if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName(),localUser.getCompanyId())))
+        if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
         {
             return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
         }
@@ -151,7 +152,7 @@ public class SysUserController extends BaseController
         {
             return error("密码长度为6-19,请重新设置!!");
         }
-        user.setSalt(ShiroUtils.randomSalt());
+        user.setSalt(ShiroSaltUtil.randomSalt());
         user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
         user.setCreateBy(ShiroUtils.getLoginName());
         int userId = userService.insertUser(user);
@@ -215,7 +216,7 @@ public class SysUserController extends BaseController
     public AjaxResult resetPwdSave(SysUser user)
     {
         userService.checkUserAllowed(user);
-        user.setSalt(ShiroUtils.randomSalt());
+        user.setSalt(ShiroSaltUtil.randomSalt());
         user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
         if (userService.resetUserPwd(user) > 0)
         {
@@ -254,7 +255,7 @@ public class SysUserController extends BaseController
     public String checkLoginNameUnique(SysUser user)
     {
 
-        return userService.checkLoginNameUnique(user.getLoginName(),ShiroUtils.getSysUser().getCompanyId());
+        return userService.checkLoginNameUnique(user.getLoginName());
     }
 
     /**

+ 16 - 8
dgtly-admin/src/main/resources/templates/system/company/add.html

@@ -7,13 +7,25 @@
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
         <form class="form-horizontal m" id="form-company-add">
             <div class="form-group">
-                <label class="col-sm-3 control-label">公司名称:</label>
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>公司名称:</label>
                 <div class="col-sm-8">
-                    <input name="company" id="company" class="form-control" type="text" required>
+                    <input name="companyName" id="companyName" class="form-control" type="text" required>
                 </div>
             </div>
             <div class="form-group">
-                <label class="col-sm-3 control-label">管理员账号:</label>
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>管理员名称:</label>
+                <div class="col-sm-8">
+                    <input name="userName" id="userName" class="form-control" type="text" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>管理员手机号:</label>
+                <div class="col-sm-8">
+                    <input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>管理员账号:</label>
                 <div class="col-sm-8">
                     <input name="loginName" id="loginName" class="form-control" type="text" required>
                 </div>
@@ -36,7 +48,7 @@
 
         function submitHandler() {
             if ($.validate.form()) {
-                if($("#company").val()==""){
+                if($("#companyName").val()==""){
                     alert("")
                     return;
                 }
@@ -48,10 +60,6 @@
                     alert("")
                     return;
                 }
-                if($("#authorizeId").val()==""){
-                    alert("")
-                    return;
-                }
                 $.operate.save(prefix + "/add", $('#form-company-add').serialize());
             }
         }

+ 2 - 2
dgtly-admin/src/main/resources/templates/system/company/company.html

@@ -12,7 +12,7 @@
                         <ul>
                             <li>
                                 <p>公司名称:</p>
-                                <input type="text" name="company"/>
+                                <input type="text" name="companyName"/>
                             </li>
                             <li>
                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@@ -65,7 +65,7 @@
                     visible: false
                 },
                 {
-                    field : 'company', 
+                    field : 'companyName',
                     title : '公司名称'
                 },
                     {

+ 51 - 0
dgtly-admin/src/main/resources/templates/system/company/tree.html

@@ -0,0 +1,51 @@
+<!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('公司选择列表')" />
+    <th:block th:include="include :: ztree-css" />
+</head>
+<style>
+    body{height:auto;font-family: "Microsoft YaHei";}
+    button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
+</style>
+<body class="hold-transition box box-main">
+    <input id="treeId" type="hidden">
+    <input id="treeName" type="hidden">
+    <div class="wrapper">
+        <div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
+            <label id="btnShow" title="显示搜索" style="display:none;">︾</label>
+            <label id="btnHide" title="隐藏搜索">︽</label>
+        </div>
+    </div>
+    <div class="treeSearchInput" id="search">
+        <label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
+        <button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
+    </div>
+    <div class="treeExpandCollapse">
+        <a href="#" onclick="$.tree.expand()">展开</a> /
+        <a href="#" onclick="$.tree.collapse()">折叠</a>
+    </div>
+    <div id="tree" class="ztree treeselect"></div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: ztree-js" />
+    <script th:inline="javascript">
+        var prefix = ctx + "system/company";
+
+        $(function() {
+            var options = {
+                url: prefix + "/treeData",
+                modalName: "公司表",
+                expandLevel: 2,
+                onClick: zOnClick
+            };
+            $.tree.init(options);
+        });
+        function zOnClick(event, treeId, treeNode) {
+            var treeId = treeNode.id;
+            var treeName = treeNode.name;
+            $("#treeId").val(treeId);
+            $("#treeName").val(treeName);
+        }
+    </script>
+</body>
+</html>

+ 0 - 132
dgtly-admin/src/main/resources/templates/visitor/youtuVisitorList.html

@@ -1,132 +0,0 @@
-<!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('访客信息')" />
-    <th:block th:include="include :: select2-css" />
-</head>
-<body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <input name="deptId" style="display: none;" id="treeId"/>
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                访客姓名:<input type="text" name="visitorName"/>
-                            </li>
-                            <li>
-                            访客单位:<input name="visitorDept"  id="visitorDept" type="text">
-                        </li>
-                            <li>
-                                访客电话:<input name="visitorPhne"  id="visitorPhone" type="text">
-                            </li>
-                            <li>
-                                受访人姓名:<input name="inviteName"  id="inviteName" type="text">
-                            </li>
-                            <li class="select-time">
-                                <label>开始日期: </label>
-                                <input type="text" name="start" class="time-input" data-type="date" data-format="yyyy-MM-dd"/>
-                                <label>结束日期: </label>
-                                <input type="text" name="end" class="time-input" data-type="date" data-format="yyyy-MM-dd"/>
-                            </li>
-                            <li>
-                                受访状态:<input name="openStatus"  id="openStatus" type="text">
-                            </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="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
-        </div>
-    </div>
-    <th:block th:include="include :: footer" />
-    <th:block th:include="include :: select2-js" />
-    <script th:inline="javascript">
-
-
-        var prefix = ctx+"visitor";
-        console.log(prefix);
-
-        $(function() {
-            var options = {
-                url: prefix + "/searchAllInviteVisitorList",
-                exportUrl: prefix + "/searchAllInviteVisitorList",
-                modalName: "访客信息",
-                columns: [{
-                    checkbox: false
-                },
-                {
-                    field : 'id', 
-                    title : '主键',
-                    visible: false
-                },
-                {
-                    field : 'visitorName',
-                    title : '访客姓名'
-                },
-                {
-                    field : 'visitorSum',
-                    title : '访客人数'
-                },
-                {
-                    field : 'visitorPhone',
-                    title : '联系方式'
-                },
-                {
-                    field : 'visitorDatetime',
-                    title : '访问时间'
-                } ,
-                {
-                    field : 'visitorReason',
-                    title : '访问是由'
-                },
-                {
-                    field : 'inviteName',
-                    title : '受访人姓名'
-                },
-                {
-                    field : 'openStatus',
-                    title : '访问状态'
-                }
-               ]
-            };
-            $.table.init(options);
-        });
-
-        /*用户管理-新增-选择部门树*/
-        // function selectDeptTree() {
-        //     var treeId = $("#treeId").val();
-        //     var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
-        //     var url = ctx + "system/dept/selectDeptTree/" + deptId;
-        //     var options = {
-        //         title: '选择部门',
-        //         width: "380",
-        //         url: url,
-        //         callBack: doSubmit
-        //     };
-        //     $.modal.openOptions(options);
-        // }
-
-        function doSubmit(index, layero){
-            var tree = layero.find("iframe")[0].contentWindow.$._tree;
-            if ($.tree.notAllowParents(tree)) {
-                var body = layer.getChildFrame('body', index);
-                $("#treeId").val(body.find('#treeId').val());
-                $("#treeName").val(body.find('#treeName').val());
-                layer.close(index);
-            }
-        }
-
-    </script>
-</body>
-</html>

+ 0 - 105
dgtly-admin/src/main/resources/templates/youtu/logs/add.html

@@ -1,105 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-    <th:block th:include="include :: header('新增优图开门信息表')" />
-    <th:block th:include="include :: datetimepicker-css" />
-</head>
-<body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-logs-add">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备ID:</label>
-                <div class="col-sm-8">
-                    <input name="deviceId" 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="deviceName" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">人员ID:</label>
-                <div class="col-sm-8">
-                    <input name="personId" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">终端机显示出来的人名:</label>
-                <div class="col-sm-8">
-                    <input name="displayName" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">终端机显示出来的人ID:</label>
-                <div class="col-sm-8">
-                    <input name="displayId" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门时间的时间戳:</label>
-                <div class="col-sm-8">
-                    <div class="input-group date">
-                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
-                        <input name="openTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
-                    </div>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门类型:0 - 未知;1 - 人脸识别开门;2 - 密码开门:</label>
-                <div class="col-sm-8">
-                    <select name="openType" class="form-control m-b">
-                        <option value="">所有</option>
-                    </select>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门结果:0 - 识别成功;1 - 活体检测失败;2 - 提特征比对失败;:</label>
-                <div class="col-sm-8">
-                    <input name="openResult" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">人员所属于的组织:</label>
-                <div class="col-sm-8">
-                    <input name="orgs" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">组织ID:</label>
-                <div class="col-sm-8">
-                    <input name="orgsId" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">组织名称:</label>
-                <div class="col-sm-8">
-                    <input name="orgsName" class="form-control" type="text">
-                </div>
-            </div>
-        </form>
-    </div>
-    <th:block th:include="include :: footer" />
-    <th:block th:include="include :: datetimepicker-js" />
-    <script type="text/javascript">
-        var prefix = ctx + "youtu/logs"
-        $("#form-logs-add").validate({
-            focusCleanup: true
-        });
-
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/add", $('#form-logs-add').serialize());
-            }
-        }
-
-        $("input[name='openTime']").datetimepicker({
-            format: "yyyy-mm-dd",
-            minView: "month",
-            autoclose: true
-        });
-    </script>
-</body>
-</html>

+ 0 - 106
dgtly-admin/src/main/resources/templates/youtu/logs/edit.html

@@ -1,106 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-    <th:block th:include="include :: header('修改优图开门信息表')" />
-    <th:block th:include="include :: datetimepicker-css" />
-</head>
-<body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-logs-edit" th:object="${youtuLogs}">
-            <input name="deviceId" th:field="*{deviceId}" type="hidden">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备ID:</label>
-                <div class="col-sm-8">
-                    <input name="deviceId" th:field="*{deviceId}" 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="deviceName" th:field="*{deviceName}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">人员ID:</label>
-                <div class="col-sm-8">
-                    <input name="personId" th:field="*{personId}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">终端机显示出来的人名:</label>
-                <div class="col-sm-8">
-                    <input name="displayName" th:field="*{displayName}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">终端机显示出来的人ID:</label>
-                <div class="col-sm-8">
-                    <input name="displayId" th:field="*{displayId}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门时间的时间戳:</label>
-                <div class="col-sm-8">
-                    <div class="input-group date">
-                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
-                        <input name="openTime" th:value="${#dates.format(youtuLogs.openTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
-                    </div>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门类型:0 - 未知;1 - 人脸识别开门;2 - 密码开门:</label>
-                <div class="col-sm-8">
-                    <select name="openType" class="form-control m-b">
-                        <option value="">所有</option>
-                    </select>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">开门结果:0 - 识别成功;1 - 活体检测失败;2 - 提特征比对失败;:</label>
-                <div class="col-sm-8">
-                    <input name="openResult" th:field="*{openResult}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">人员所属于的组织:</label>
-                <div class="col-sm-8">
-                    <input name="orgs" th:field="*{orgs}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">组织ID:</label>
-                <div class="col-sm-8">
-                    <input name="orgsId" th:field="*{orgsId}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">组织名称:</label>
-                <div class="col-sm-8">
-                    <input name="orgsName" th:field="*{orgsName}" class="form-control" type="text">
-                </div>
-            </div>
-        </form>
-    </div>
-    <th:block th:include="include :: footer" />
-    <th:block th:include="include :: datetimepicker-js" />
-    <script type="text/javascript">
-        var prefix = ctx + "youtu/logs";
-        $("#form-logs-edit").validate({
-            focusCleanup: true
-        });
-
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/edit", $('#form-logs-edit').serialize());
-            }
-        }
-
-        $("input[name='openTime']").datetimepicker({
-            format: "yyyy-mm-dd",
-            minView: "month",
-            autoclose: true
-        });
-    </script>
-</body>
-</html>

+ 0 - 149
dgtly-admin/src/main/resources/templates/youtu/logs/logs.html

@@ -1,149 +0,0 @@
-<!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="deviceName"/>
-                            </li>
-                            <li>
-                                <p>人员名称:</p>
-                                <input type="text" name="userName"/>
-                            </li>
-                            <li>
-                                <p>部门:</p>
-                                <input type="text" name="deptName"/>
-                            </li>
-                            <li>
-                                <p>开门类型:</p>
-                                <select name="openType">
-                                    <option value="">所有</option>
-                                    <option value="0">未知</option>
-                                    <option value="1">人脸识别开门</option>
-                                    <option value="2">密码开门</option>
-                                </select>
-                            </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="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('youtu:logs:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('youtu:logs:remove')}]];
-        var prefix = ctx + "youtu/logs";
-
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                modalName: "优图开门信息表",
-                columns: [{
-                    checkbox: true
-                },
-                {
-                    field : 'deviceId', 
-                    title : '设备ID',
-                    visible: false
-                },
-                {
-                    field : 'deviceName', 
-                    title : '设备名称'
-                },
-                    {
-                        field : 'deptName',
-                        title : '部门'
-                    },
-                {
-                    field : 'userName',
-                    title : '人员'
-                },
-                    {
-                        field : 'phonenumber',
-                        title : '电话'
-                    },
-
-                {
-                    field : 'displayName', 
-                    title : '终端机显示出来的人名',
-                    visible: false
-                },
-                {
-                    field : 'displayId', 
-                    title : '终端机显示出来的人ID',
-                    visible: false
-                },
-                {
-                    field : 'openTime', 
-                    title : '开门时间'
-                },
-                {
-                    field : 'openType', 
-                    title : '开门类型:',
-                    formatter: function(value, row, index) {
-                        if(value==0){
-                            return "未知"
-                        }else if(value==1){
-                            return "人脸识别开门"
-                        }else if(value==2){
-                            return "密码开门"
-                        }
-                    }
-                },
-                {
-                    field : 'openResult', 
-                    title : '开门结果:',
-                    visible: false,
-                    formatter: function(value, row, index) {
-                        if(value==0){
-                            return "识别成功"
-                        }else if(value==1){
-                            return "活体检测失败"
-                        }else if(value==2){
-                            return "提特征比对失败"
-                        }
-                    }
-                },
-                {
-                    field : 'orgs', 
-                    title : '人员所属于的组织',
-                    visible: false
-                },
-                {
-                    field : 'orgsId', 
-                    title : '组织ID',
-                    visible: false
-                },
-                {
-                    field : 'orgsName', 
-                    title : '组织名称',
-                    visible: false
-                }]
-            };
-            $.table.init(options);
-        });
-    </script>
-</body>
-</html>

+ 17 - 0
dgtly-common/src/main/java/com/dgtly/common/utils/ShiroSaltUtil.java

@@ -0,0 +1,17 @@
+package com.dgtly.common.utils;
+
+import org.apache.shiro.crypto.SecureRandomNumberGenerator;
+
+public class ShiroSaltUtil {
+
+    /**
+     * 生成随机盐
+     */
+    public static String randomSalt()
+    {
+        // 一个Byte占两个字节,此处生成的3字节,字符串长度为6
+        SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator();
+        String hex = secureRandom.nextBytes(3).toHex();
+        return hex;
+    }
+}

+ 1 - 10
dgtly-framework/src/main/java/com/dgtly/framework/util/ShiroUtils.java

@@ -96,14 +96,5 @@ public class ShiroUtils
         return String.valueOf(getSubject().getSession().getId());
     }
 
-    /**
-     * 生成随机盐
-     */
-    public static String randomSalt()
-    {
-        // 一个Byte占两个字节,此处生成的3字节,字符串长度为6
-        SecureRandomNumberGenerator secureRandom = new SecureRandomNumberGenerator();
-        String hex = secureRandom.nextBytes(3).toHex();
-        return hex;
-    }
+
 }

+ 125 - 0
dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsInfoController.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.GoodsInfo;
+import com.dgtly.goods.service.IGoodsInfoService;
+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("/goods/info")
+public class GoodsInfoController extends BaseController
+{
+    private String prefix = "goods/info";
+
+    @Autowired
+    private IGoodsInfoService goodsInfoService;
+
+    @RequiresPermissions("goods:info:view")
+    @GetMapping()
+    public String info()
+    {
+        return prefix + "/info";
+    }
+
+    /**
+     * 查询商品基础详情列表
+     */
+    @RequiresPermissions("goods:info:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(GoodsInfo goodsInfo)
+    {
+        startPage();
+        List<GoodsInfo> list = goodsInfoService.selectGoodsInfoList(goodsInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出商品基础详情列表
+     */
+    @RequiresPermissions("goods:info:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(GoodsInfo goodsInfo)
+    {
+        List<GoodsInfo> list = goodsInfoService.selectGoodsInfoList(goodsInfo);
+        ExcelUtil<GoodsInfo> util = new ExcelUtil<GoodsInfo>(GoodsInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 新增商品基础详情
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存商品基础详情
+     */
+    @RequiresPermissions("goods:info:add")
+    @Log(title = "商品基础详情", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(GoodsInfo goodsInfo)
+    {
+        return toAjax(goodsInfoService.insertGoodsInfo(goodsInfo));
+    }
+
+    /**
+     * 修改商品基础详情
+     */
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Long id, ModelMap mmap)
+    {
+        GoodsInfo goodsInfo = goodsInfoService.selectGoodsInfoById(id);
+        mmap.put("goodsInfo", goodsInfo);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存商品基础详情
+     */
+    @RequiresPermissions("goods:info:edit")
+    @Log(title = "商品基础详情", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(GoodsInfo goodsInfo)
+    {
+        return toAjax(goodsInfoService.updateGoodsInfo(goodsInfo));
+    }
+
+    /**
+     * 删除商品基础详情
+     */
+    @RequiresPermissions("goods:info:remove")
+    @Log(title = "商品基础详情", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(goodsInfoService.deleteGoodsInfoByIds(ids));
+    }
+}

+ 44 - 15
dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsTypeController.java

@@ -8,6 +8,7 @@ import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.framework.util.ShiroUtils;
 import com.dgtly.system.domain.SysDept;
+import com.dgtly.system.domain.SysMenu;
 import com.dgtly.system.domain.SysUser;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +43,8 @@ public class GoodsTypeController extends BaseController
     @Autowired
     private IGoodsTypeService goodsTypeService;
 
+
+
     @RequiresPermissions("goods:type:view")
     @GetMapping()
     public String type()
@@ -55,7 +58,7 @@ public class GoodsTypeController extends BaseController
     @RequiresPermissions("goods:type:list")
     @PostMapping("/list")
     @ResponseBody
-    public List<GoodsType> list(GoodsType goodsType)
+    public Object list(GoodsType goodsType)
     {
         List<GoodsType> list = goodsTypeService.selectGoodsTypeList(goodsType);
         return list;
@@ -72,24 +75,40 @@ public class GoodsTypeController extends BaseController
     }
 
     /**
-     * 导出商品分类列列表
+     * 选择部门树
      */
-    @RequiresPermissions("goods:type:export")
-    @PostMapping("/export")
-    @ResponseBody
-    public AjaxResult export(GoodsType goodsType)
+    @GetMapping("/selectTypeTree/{typeId}")
+    public String selectTypeTree(@PathVariable("typeId") Long typeId, ModelMap mmap)
     {
-        List<GoodsType> list = goodsTypeService.selectGoodsTypeList(goodsType);
-        ExcelUtil<GoodsType> util = new ExcelUtil<GoodsType>(GoodsType.class);
-        return util.exportExcel(list, "type");
+        GoodsType gt= goodsTypeService.selectGoodsTypeById(typeId);
+        if(gt==null){
+            gt = new GoodsType();
+            gt = goodsTypeService.selectGoodsTypeList(gt).get(0);
+        }
+        mmap.put("type",gt );
+        return prefix + "/tree";
     }
 
+
+
     /**
-     * 新增商品分类列
+     * 新增商品分类
      */
-    @GetMapping("/add")
-    public String add()
+    @GetMapping("/add/{parentId}")
+    public String add(@PathVariable("parentId") Long parentId,ModelMap mmap)
     {
+        GoodsType type = null;
+        if (0L != parentId)
+        {
+            type = goodsTypeService.selectGoodsTypeById(parentId);
+        }
+        else
+        {
+            type = new GoodsType();
+            type.setId(0L);
+            type.setName("根目录目录");
+        }
+        mmap.put("type", type);
         return prefix + "/add";
     }
 
@@ -133,11 +152,21 @@ public class GoodsTypeController extends BaseController
      */
     @RequiresPermissions("goods:type:remove")
     @Log(title = "商品分类列", businessType = BusinessType.DELETE)
-    @PostMapping( "/remove")
+    @GetMapping( "/remove/{id}")
     @ResponseBody
-    public AjaxResult remove(String ids)
+    public AjaxResult remove(@PathVariable("id")Long id)
     {
-        return toAjax(goodsTypeService.deleteGoodsTypeByIds(ids));
+        GoodsType paramGoodsTyep = new GoodsType();
+        paramGoodsTyep.setAncestors(id.toString());
+        if (goodsTypeService.selectGoodsTypeCount(paramGoodsTyep) > 1)
+        {
+            return AjaxResult.error(300,"存在子菜单,不允许删除");
+        }
+       /* if (menuService.selectCountRoleMenuByMenuId(id) > 0)
+        {
+            return AjaxResult.error(300,"分类已有商品,不允许删除");
+        }*/
+        return toAjax(goodsTypeService.deleteGoodsTypeById(id));
     }
 
 

+ 260 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/add.html

@@ -0,0 +1,260 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增商品基础详情')" />
+    <th:block th:include="include :: summernote-css" />
+    <th:block th:include="include :: datetimepicker-css" />
+    <th:block th:include="include :: jasny-bootstrap-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-info-add">
+            <div class="row">
+                <div class="form-group">
+                    <label class="col-sm-1 control-label"><span style="color: red; ">*</span>商品名称:</label>
+                    <div class="col-sm-4">
+                        <input name="name" class="form-control" type="text" required>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                    <div class="form-group">
+                        <input id="fmzFile" name="fmzFile" type="hidden"/>
+                        <label class="col-sm-1 control-label"><span style="color: red; ">*</span>封面图:</label>
+                        <div class="col-sm-10">
+                            <div class="fileinput fileinput-new" data-provides="fileinput">
+                                <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;">
+                                    <img th:src="@{/img/profile.jpg}">
+                                </div>
+                                <div id="fmz" class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">
+
+                                </div>
+                                <div>
+                                    <span class="btn btn-white btn-file"><span class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span><input type="file"></span>
+                                    <a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+            </div>
+
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <input name="typeId" type="hidden" id="input_typeId">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>所属分类:</label>
+                        <div class="col-sm-8">
+                            <div class="input-group">
+                                <input name="typeName" onclick="selectTypeTree()" id="input_typeTreeName" type="text" placeholder="请选择所属分类" class="form-control"
+                                       readonly="readonly" required>
+                                <span class="input-group-addon"><i class="fa fa-search"></i></span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <input name="companyId" type="hidden" id="input_companyId">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>所属公司:</label>
+                        <div class="col-sm-8">
+                            <div class="input-group">
+                                <input name="companyName" onclick="selectCompanyList()" id="input_companyTreeName" type="text" placeholder="请选择所属公司" class="form-control"
+                                       readonly="readonly" required>
+                                <span class="input-group-addon"><i class="fa fa-search"></i></span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>生产地点:</label>
+                        <div class="col-sm-8">
+                            <textarea name="producedAddress" class="form-control"></textarea>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>仓库地址:</label>
+                        <div class="col-sm-8">
+                            <textarea name="warehouseAddress" class="form-control"></textarea>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group ">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>生产日期:</label>
+                        <div class="col-sm-8">
+                            <div class="input-group date">
+                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                                <input name="producedTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>配送方式:</label>
+                        <div class="col-sm-8">
+                            <input name="delivery"  class="form-control" placeholder="请输入配送方式" type="text">
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group ">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>上架标志:</label>
+                        <div class="col-sm-8">
+                            <input name="putawayFlag" class="form-control" type="text" required>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label"><span style="color: red; ">*</span>单重:</label>
+                        <div class="col-sm-8">
+                            <input name="weight" class="form-control" type="text">
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="form-group">
+                    <label class="col-sm-1 control-label"><span style="color: red; ">*</span>描述:</label>
+                    <div class="col-sm-10">
+                        <input id="input_describe" name="describe" type="hidden">
+                        <div class="summernote"></div>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: summernote-js" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <th:block th:include="include :: jasny-bootstrap-js" />
+    <script type="text/javascript">
+        var prefix = ctx + "goods/info"
+
+        $('.summernote').summernote({
+            placeholder: '请输入内容',
+            height : 192,
+            lang : 'zh-CN',
+            followingToolbar: false,
+            callbacks: {
+                onImageUpload: function (files) {
+                    sendFile(files[0], this);
+                }
+            }
+        });
+        $("#form-info-add").validate({
+            focusCleanup: true
+        });
+
+        /************************上传文件******************************/
+        function sendFile(file, obj) {
+            var data = new FormData();
+            data.append("file", file);
+            $.ajax({
+                type: "POST",
+                url: ctx + "common/upload",
+                data: data,
+                cache: false,
+                contentType: false,
+                processData: false,
+                dataType: 'json',
+                success: function(result) {
+                    if (result.code == web_status.SUCCESS) {
+                        $(obj).summernote('editor.insertImage', result.url, result.fileName);
+                    } else {
+                        $.modal.alertError(result.msg);
+                    }
+                },
+                error: function(error) {
+                    $.modal.alertWarning("图片上传失败。");
+                }
+            });
+        }
+        /*********************提交*********************************/
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-info-add').serialize());
+            }
+        }
+
+        $("input[name='producedTime']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+
+        /******************选择分类树**********************************/
+        function selectTypeTree() {
+            var typeId = "0";
+            var url = ctx + "goods/type/selectTypeTree/" + typeId;
+            var options1 = {
+                title: '选择商品类型',
+                width: "380",
+                url: url,
+                callBack: selectType
+            };
+            $.modal.openOptions(options1);
+        }
+        function selectType(index, layero){
+            var tree = layero.find("iframe")[0].contentWindow.$._tree;
+            var body = layer.getChildFrame('body', index);
+            $("#input_typeId").val(body.find('#treeId').val());
+            $("#input_typeTreeName").val(body.find('#treeName').val());
+            getTypyAttributu($("#input_typeId").val());
+            layer.close(index);
+        }
+        function getTypyAttributu(id){
+            $.ajax({
+                type: "POST",
+                url: ctx + "common/upload",
+                data: data,
+                cache: false,
+                contentType: false,
+                processData: false,
+                dataType: 'json',
+                success: function(result) {
+                    if (result.code == web_status.SUCCESS) {
+                        $(obj).summernote('editor.insertImage', result.url, result.fileName);
+                    } else {
+                        $.modal.alertError(result.msg);
+                    }
+                },
+                error: function(error) {
+                    $.modal.alertWarning("图片上传失败。");
+                }
+            });
+        }
+
+        /******************选择公司列表**********************************/
+        function selectCompanyList() {
+            var url = ctx + "system/company/tree";
+            var options2 = {
+                title: '选择公司',
+                width: "700",
+                url: url,
+                callBack: selectCompany
+            };
+            $.modal.openOptions(options2);
+        }
+        function selectCompany(index, layero){
+            debugger
+            var tree = layero.find("iframe")[0].contentWindow.$._tree;
+            var body = layer.getChildFrame('body', index);
+            $("#input_companyId").val(body.find('#treeId').val());
+            $("#input_companyTreeName").val(body.find('#treeName').val());
+            layer.close(index);
+        }
+    </script>
+</body>
+</html>

+ 115 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/edit.html

@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改商品基础详情')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-info-edit" th:object="${goodsInfo}">
+            <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="companyId" th:field="*{companyId}" 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="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="price" th:field="*{price}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">封面图片:</label>
+                <div class="col-sm-8">
+                    <textarea name="cover" class="form-control">[[*{cover}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">轮播图,号分隔:</label>
+                <div class="col-sm-8">
+                    <textarea name="slideshow" class="form-control">[[*{slideshow}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">编辑器生成的详细描述html:</label>
+                <div class="col-sm-8">
+                    <textarea name="describe" class="form-control" required>[[*{describe}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">配送方式:</label>
+                <div class="col-sm-8">
+                    <textarea name="delivery" class="form-control">[[*{delivery}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">生产日期:</label>
+                <div class="col-sm-8">
+                    <div class="input-group date">
+                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        <input name="producedTime" th:value="${#dates.format(goodsInfo.producedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">生产地点:</label>
+                <div class="col-sm-8">
+                    <textarea name="producedAddress" class="form-control">[[*{producedAddress}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">供货仓库地址:</label>
+                <div class="col-sm-8">
+                    <textarea name="warehouseAddress" class="form-control">[[*{warehouseAddress}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">单重:</label>
+                <div class="col-sm-8">
+                    <input name="weight" th:field="*{weight}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">上架标志:</label>
+                <div class="col-sm-8">
+                    <input name="putawayFlag" th:field="*{putawayFlag}" class="form-control" type="text" required>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script type="text/javascript">
+        var prefix = ctx + "system/info";
+        $("#form-info-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
+            }
+        }
+
+        $("input[name='producedTime']").datetimepicker({
+            format: "yyyy-mm-dd",
+            minView: "month",
+            autoclose: true
+        });
+    </script>
+</body>
+</html>

+ 122 - 0
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/info.html

@@ -0,0 +1,122 @@
+<!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="companyId"/>
+                            </li>
+                            <li>
+                                <p>所属类型id:</p>
+                                <input type="text" name="typeId"/>
+                            </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.addFull()" shiro:hasPermission="goods:info:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="goods:info:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="goods:info:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="goods:info: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('goods:info:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('goods:info:remove')}]];
+        var prefix = ctx + "goods/info";
+
+        $(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 : 'companyId', 
+                    title : '所属公司id'
+                },
+                {
+                    field : 'typeId', 
+                    title : '所属类型id'
+                },
+                {
+                    field : 'price', 
+                    title : '一口价'
+                },
+                {
+                    field : 'cover', 
+                    title : '封面图片'
+                },
+                {
+                    field : 'producedTime', 
+                    title : '生产日期'
+                },
+                {
+                    field : 'weight', 
+                    title : '单重'
+                },
+                {
+                    field : 'putawayFlag', 
+                    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>

+ 76 - 8
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/add.html

@@ -5,35 +5,103 @@
 </head>
 <body class="white-bg">
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-type-add">
+        <input name="parentId" type="hidden" id="treeId" th:value="${type.id}"/>
+        <form class="form-horizontal m" id="form-type-add" >
             <div class="form-group">    
-                <label class="col-sm-3 control-label">类型名称:</label>
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>类型名称:</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="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>所属分类:</label>
                 <div class="col-sm-8">
-                    <input name="parentId" class="form-control" type="text" required>
+                    <div class="input-group">
+                        <input name="deptName" onclick="selectTypeTree()" id="treeName" type="text" placeholder="请选择所属分类" class="form-control"
+                               th:value="${type.name}" readonly="readonly" required>
+                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
+                    </div>
                 </div>
             </div>
+            <h4 class="form-header h4">属性字段 <a class="btn btn-success btn-xs" id="addAttribute"><i class="fa fa-plus"></i>添加</a></h4>
         </form>
+
     </div>
     <th:block th:include="include :: footer" />
     <script type="text/javascript">
-        var prefix = ctx + "goots/type"
+        var prefix = ctx + "goods/type"
+        var attributesIndex = 0;
+        $(function(){
+            $('#addAttribute').click(function(){
+               var str =' <div class="row">' +
+                   '            <div class="col-sm-4">' +
+               '                    <div class="form-group">' +
+               '                        <label class="col-sm-6 control-label"> 属性名:</label>' +
+               '                        <div class="col-sm-6">' +
+               '                            <input name="goodsTypeAttributes['+attributesIndex+'].attributeName" placeholder="请输入属性名称" class="form-control" type="text" maxlength="30" required>' +
+               '                        </div>' +
+               '                    </div>' +
+               '                </div>' +
+               '                <div class="col-sm-4">' +
+               '                    <div class="form-group">' +
+               '                        <label class="col-sm-6 control-label">排序:</label>' +
+               '                        <div class="col-sm-6">' +
+               '                            <div class="input-group">' +
+               '                                <input name="goodsTypeAttributes['+attributesIndex+'].sort" placeholder="请输入排序值" class="form-control" type="text" maxlength="30" required>'+
+               '                            </div>' +
+               '                        </div>' +
+               '                    </div>' +
+               '                </div>' +
+               '                <div class="col-sm-2">' +
+               '                    <div class="form-group">' +
+               '                        <a class="remove btn btn-danger btn-sm" ><i class="fa fa-plus"></i>删除</a>'+
+               '                    </div>' +
+               '                </div>'+
+               '            </div>';
+                $('#form-type-add').append(str);
+                attributesIndex++;
+                $('.remove').on('click',function(){
+                    $(this).parent().parent().parent('.row').remove();
+                });
+            });
+        })
+
+
         $("#form-type-add").validate({
             focusCleanup: true
         });
+        /*选择分类树*/
+        function selectTypeTree() {
+            var treeId = $("#treeId").val();
+            var typeId = $.common.isEmpty(treeId) ? "0" : treeId;
+            var url = ctx + "goods/type/selectTypeTree/" + typeId;
+            var options = {
+                title: '选择',
+                width: "380",
+                url: url,
+                callBack: selectType
+            };
+            $.modal.openOptions(options);
+        }
+        function selectType(index, layero){
+            var tree = layero.find("iframe")[0].contentWindow.$._tree;
+            var body = layer.getChildFrame('body', index);
+            $("#treeId").val(body.find('#treeId').val());
+            $("#treeName").val(body.find('#treeName').val());
+            layer.close(index);
+        }
+
 
         function submitHandler() {
             if ($.validate.form()) {
-                let data  =$('#form-type-add').serialize();
-                data.push("aaaaaa");
+                var data  =$('#form-type-add').serialize();
+                var list = $('#form-attribute-addList').serialize();
+
                 $.operate.save(prefix + "/add", data);
             }
         }
+        function addAttribute() {
+        }
     </script>
 </body>
 </html>

+ 18 - 4
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/type/edit.html

@@ -7,16 +7,30 @@
     <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">
+            <input name="parentId" th:field="*{parentId}" 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>
+            <h4 class="form-header h4">属性字段</h4>
+            <div class="row" th:each="attribute:*{goodsTypeAttributes}" >
+                <div class="col-sm-4">
+                    <div class="form-group">
+                        <label class="col-sm-6 control-label"> 属性名:</label>
+                        <div class="col-sm-6">
+                            <input class="form-control" th:value="${attribute.attributeName}" maxlength="30" required>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-4">
+                    <div class="form-group">
+                        <label class="col-sm-6 control-label"> 排序:</label>
+                        <div class="col-sm-6">
+                            <input class="form-control" th:value="${attribute.sort}" maxlength="30" required>
+                        </div>
+                    </div>
                 </div>
             </div>
         </form>

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

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('部门树选择')" />
+	<th:block th:include="include :: ztree-css" />
+</head>
+<style>
+	body{height:auto;font-family: "Microsoft YaHei";}
+	button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
+</style>
+<body class="hold-transition box box-main">
+	<input id="treeId"   name="treeId"    type="hidden" th:value="${type.id}"/>
+	<input id="treeName" name="treeName"  type="hidden" th:value="${type.name}"/>
+	<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
+		<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
+		<label id="btnHide" title="隐藏搜索">︽</label>
+	</div>
+	<div class="treeSearchInput" id="search">
+		<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
+		<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
+	</div>
+	<div class="treeExpandCollapse">
+		<a href="#" onclick="$.tree.expand()">展开</a> /
+		<a href="#" onclick="$.tree.collapse()">折叠</a>
+	</div>
+	<div id="tree" class="ztree treeselect"></div>
+	</div>
+	<th:block th:include="include :: footer" />
+	<th:block th:include="include :: ztree-js" />
+	<script th:inline="javascript">
+		$(function() {
+			var url = ctx + "goods/type/treeData";
+			var options = {
+		        url: url,
+		        expandLevel: 1,
+		        onClick : zOnClick
+		    };
+			$.tree.init(options);
+		});
+		
+		function zOnClick(event, treeId, treeNode) {
+		    var treeId = treeNode.id;
+		    var treeName = treeNode.name;
+		    $("#treeId").val(treeId);
+		    $("#treeName").val(treeName);
+		}
+	</script>
+</body>
+</html>

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

@@ -14,14 +14,6 @@
                                 <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="$.treeTable.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>
@@ -32,12 +24,12 @@
             </div>
 
             <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="goods:type:add">
+                <a class="btn btn-primary" onclick="$.operate.add(0)" shiro:hasPermission="goods:type:add">
                     <i class="fa fa-plus"></i> 添加
                 </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="goods:type:edit">
+                <!--<a class="btn btn-success single disabled" onclick="$.operate.edit()" shiro:hasPermission="goods:type:edit">
                     <i class="fa fa-edit"></i> 修改
-                </a>
+                </a>-->
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="goods:type:remove">
                     <i class="fa fa-remove"></i> 删除
                 </a>
@@ -49,6 +41,7 @@
     </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
+        var addFlag = [[${@permission.hasPermi('goods:type:add')}]];
         var editFlag = [[${@permission.hasPermi('goods:type:edit')}]];
         var removeFlag = [[${@permission.hasPermi('goods:type:remove')}]];
         var prefix = ctx + "goods/type";
@@ -59,9 +52,9 @@
                 uniqueId: "id",
                 expandColumn:2,
                 url: prefix + "/list",
-                createUrl: prefix + "/add",
+                createUrl: prefix + "/add/{id}",
                 updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
+                removeUrl: prefix + "/remove/{id}",
                 modalName: "商品分类列",
                 columns: [{
                     checkbox: true
@@ -77,11 +70,17 @@
                 },
                 {
                     field : 'parentId', 
-                    title : '父属性id'
+                    title : '父属性id',
+                    visible: false
                 },
                 {
                     field : 'ancestors', 
-                    title : '祖级列表'
+                    title : '祖级列表',
+                    visible: false
+                },
+                {
+                    field : 'attributeNames',
+                    title : '属性字段'
                 },
                 {
                     field : 'remark', 
@@ -92,7 +91,8 @@
                     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-primary btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-plus"></i>添加</a> ');
+                        //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('');
                     }

+ 238 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsInfo.java

@@ -0,0 +1,238 @@
+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;
+import java.util.Date;
+
+/**
+ * 商品基础详情对象 goods_info
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public class GoodsInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 商品名称 */
+    @Excel(name = "商品名称")
+    private String name;
+
+    /** 所属公司id */
+    @Excel(name = "所属公司id")
+    private Long companyId;
+
+    /** 所属类型id */
+    @Excel(name = "所属类型id")
+    private Long typeId;
+
+    /** 一口价 */
+    @Excel(name = "一口价")
+    private Double price;
+
+    /** 封面图片 */
+    @Excel(name = "封面图片")
+    private String cover;
+
+    /** 轮播图,号分隔 */
+    @Excel(name = "轮播图,号分隔")
+    private String slideshow;
+
+    /** 编辑器生成的详细描述html */
+    @Excel(name = "编辑器生成的详细描述html")
+    private String describe;
+
+    /** 配送方式 */
+    @Excel(name = "配送方式")
+    private String delivery;
+
+    /** 生产日期 */
+    @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date producedTime;
+
+    /** 生产地点 */
+    @Excel(name = "生产地点")
+    private String producedAddress;
+
+    /** 供货仓库地址 */
+    @Excel(name = "供货仓库地址")
+    private String warehouseAddress;
+
+    /** 单重 */
+    @Excel(name = "单重")
+    private String weight;
+
+    /** 上架标志(0代表草稿状态 1代表上架) */
+    @Excel(name = "上架标志", readConverterExp = "0=代表草稿状态,1=代表上架")
+    private String putawayFlag;
+
+    /** '删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    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 setCompanyId(Long companyId) 
+    {
+        this.companyId = companyId;
+    }
+
+    public Long getCompanyId() 
+    {
+        return companyId;
+    }
+    public void setTypeId(Long typeId) 
+    {
+        this.typeId = typeId;
+    }
+
+    public Long getTypeId() 
+    {
+        return typeId;
+    }
+    public void setPrice(Double price) 
+    {
+        this.price = price;
+    }
+
+    public Double getPrice() 
+    {
+        return price;
+    }
+    public void setCover(String cover) 
+    {
+        this.cover = cover;
+    }
+
+    public String getCover() 
+    {
+        return cover;
+    }
+    public void setSlideshow(String slideshow) 
+    {
+        this.slideshow = slideshow;
+    }
+
+    public String getSlideshow() 
+    {
+        return slideshow;
+    }
+    public void setDescribe(String describe) 
+    {
+        this.describe = describe;
+    }
+
+    public String getDescribe() 
+    {
+        return describe;
+    }
+    public void setDelivery(String delivery) 
+    {
+        this.delivery = delivery;
+    }
+
+    public String getDelivery() 
+    {
+        return delivery;
+    }
+    public void setProducedTime(Date producedTime) 
+    {
+        this.producedTime = producedTime;
+    }
+
+    public Date getProducedTime() 
+    {
+        return producedTime;
+    }
+    public void setProducedAddress(String producedAddress) 
+    {
+        this.producedAddress = producedAddress;
+    }
+
+    public String getProducedAddress() 
+    {
+        return producedAddress;
+    }
+    public void setWarehouseAddress(String warehouseAddress) 
+    {
+        this.warehouseAddress = warehouseAddress;
+    }
+
+    public String getWarehouseAddress() 
+    {
+        return warehouseAddress;
+    }
+    public void setWeight(String weight) 
+    {
+        this.weight = weight;
+    }
+
+    public String getWeight() 
+    {
+        return weight;
+    }
+    public void setPutawayFlag(String putawayFlag) 
+    {
+        this.putawayFlag = putawayFlag;
+    }
+
+    public String getPutawayFlag() 
+    {
+        return putawayFlag;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("companyId", getCompanyId())
+            .append("typeId", getTypeId())
+            .append("price", getPrice())
+            .append("cover", getCover())
+            .append("slideshow", getSlideshow())
+            .append("describe", getDescribe())
+            .append("delivery", getDelivery())
+            .append("producedTime", getProducedTime())
+            .append("producedAddress", getProducedAddress())
+            .append("warehouseAddress", getWarehouseAddress())
+            .append("weight", getWeight())
+            .append("putawayFlag", getPutawayFlag())
+            .append("delFlag", getDelFlag())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 12 - 1
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/domain/GoodsType.java

@@ -32,9 +32,12 @@ public class GoodsType extends BaseEntity
     @Excel(name = "祖级列表")
     private String ancestors;
 
-    /** 商品属性列表*/
+    /** 商品类型属性列表*/
     private List<GoodsTypeAttribute> goodsTypeAttributes;
 
+    /** 商品类型属性名称列表*/
+    private String attributeNames;
+
 
     public void setId(Long id) 
     {
@@ -80,6 +83,14 @@ public class GoodsType extends BaseEntity
     public void setGoodsTypeAttributes(List<GoodsTypeAttribute> goodsTypeAttributes) {
         this.goodsTypeAttributes = goodsTypeAttributes;
     }
+    public String getAttributeNames() {
+        return attributeNames;
+    }
+
+    public void setAttributeNames(String attributeNames) {
+        this.attributeNames = attributeNames;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@@ -24,7 +24,7 @@ public class GoodsTypeAttribute extends BaseEntity
 
     /** 属性名 */
     @Excel(name = "属性名")
-    private String name;
+    private String attributeName;
 
     /** 字段排序(999最大排最前) */
     @Excel(name = "字段排序", readConverterExp = "9=99最大排最前")
@@ -48,14 +48,14 @@ public class GoodsTypeAttribute extends BaseEntity
     {
         return typeId;
     }
-    public void setName(String name) 
+    public void setAttributeName(String attributeName)
     {
-        this.name = name;
+        this.attributeName = attributeName;
     }
 
-    public String getName() 
+    public String getAttributeName()
     {
-        return name;
+        return attributeName;
     }
     public void setSort(Long sort) 
     {
@@ -72,7 +72,7 @@ public class GoodsTypeAttribute extends BaseEntity
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("typeId", getTypeId())
-            .append("name", getName())
+            .append("name", getAttributeName())
             .append("sort", getSort())
             .append("createTime", getCreateTime())
             .append("createBy", getCreateBy())

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

@@ -0,0 +1,61 @@
+package com.dgtly.goods.mapper;
+
+import com.dgtly.goods.domain.GoodsInfo;
+import java.util.List;
+
+/**
+ * 商品基础详情Mapper接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface GoodsInfoMapper 
+{
+    /**
+     * 查询商品基础详情
+     * 
+     * @param id 商品基础详情ID
+     * @return 商品基础详情
+     */
+    public GoodsInfo selectGoodsInfoById(Long id);
+
+    /**
+     * 查询商品基础详情列表
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 商品基础详情集合
+     */
+    public List<GoodsInfo> selectGoodsInfoList(GoodsInfo goodsInfo);
+
+    /**
+     * 新增商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    public int insertGoodsInfo(GoodsInfo goodsInfo);
+
+    /**
+     * 修改商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    public int updateGoodsInfo(GoodsInfo goodsInfo);
+
+    /**
+     * 删除商品基础详情
+     * 
+     * @param id 商品基础详情ID
+     * @return 结果
+     */
+    public int deleteGoodsInfoById(Long id);
+
+    /**
+     * 批量删除商品基础详情
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsInfoByIds(String[] ids);
+}

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

@@ -1,6 +1,8 @@
 package com.dgtly.goods.mapper;
 
 import com.dgtly.goods.domain.GoodsTypeAttribute;
+import org.apache.ibatis.annotations.Param;
+
 import java.util.List;
 
 /**
@@ -58,4 +60,12 @@ public interface GoodsTypeAttributeMapper
      * @return 结果
      */
     public int deleteGoodsTypeAttributeByIds(String[] ids);
+
+    /**
+     * 批量新增分类属性
+     *
+     * @param goodsTypeAttributes 分类属性列表
+     * @return 结果
+     */
+    public int batchAttribute(@Param("list")List<GoodsTypeAttribute> goodsTypeAttributes,@Param("typeId")Long typeId);
 }

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

@@ -58,4 +58,11 @@ public interface GoodsTypeMapper
      * @return 结果
      */
     public int deleteGoodsTypeByIds(String[] ids);
+
+    /**
+     * 根据条件查询查询数量
+     * @param goodsType
+     * @return
+     */
+    public int selectGoodsTypeCount(GoodsType goodsType);
 }

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

@@ -0,0 +1,61 @@
+package com.dgtly.goods.service;
+
+import com.dgtly.goods.domain.GoodsInfo;
+import java.util.List;
+
+/**
+ * 商品基础详情Service接口
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+public interface IGoodsInfoService 
+{
+    /**
+     * 查询商品基础详情
+     * 
+     * @param id 商品基础详情ID
+     * @return 商品基础详情
+     */
+    public GoodsInfo selectGoodsInfoById(Long id);
+
+    /**
+     * 查询商品基础详情列表
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 商品基础详情集合
+     */
+    public List<GoodsInfo> selectGoodsInfoList(GoodsInfo goodsInfo);
+
+    /**
+     * 新增商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    public int insertGoodsInfo(GoodsInfo goodsInfo);
+
+    /**
+     * 修改商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    public int updateGoodsInfo(GoodsInfo goodsInfo);
+
+    /**
+     * 批量删除商品基础详情
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteGoodsInfoByIds(String ids);
+
+    /**
+     * 删除商品基础详情信息
+     * 
+     * @param id 商品基础详情ID
+     * @return 结果
+     */
+    public int deleteGoodsInfoById(Long id);
+}

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

@@ -66,4 +66,14 @@ public interface IGoodsTypeService
      * @return
      */
     List<Ztree> selectGoodsTypeTree(GoodsType goodsType);
+
+    /**
+     * 根据条件查询查询数量
+     * @param goodsType
+     * @return
+     */
+    public Integer selectGoodsTypeCount(GoodsType goodsType);
+
+
+
 }

+ 98 - 0
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsInfoServiceImpl.java

@@ -0,0 +1,98 @@
+package com.dgtly.goods.service.impl;
+
+import java.util.List;
+import com.dgtly.common.utils.DateUtils;
+import com.dgtly.goods.mapper.GoodsInfoMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.goods.mapper.GoodsInfoMapper;
+import com.dgtly.goods.domain.GoodsInfo;
+import com.dgtly.goods.service.IGoodsInfoService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 商品基础详情Service业务层处理
+ * 
+ * @author dgtly
+ * @date 2020-02-13
+ */
+@Service
+public class GoodsInfoServiceImpl implements IGoodsInfoService 
+{
+    @Autowired
+    private GoodsInfoMapper goodsInfoMapper;
+
+    /**
+     * 查询商品基础详情
+     * 
+     * @param id 商品基础详情ID
+     * @return 商品基础详情
+     */
+    @Override
+    public GoodsInfo selectGoodsInfoById(Long id)
+    {
+        return goodsInfoMapper.selectGoodsInfoById(id);
+    }
+
+    /**
+     * 查询商品基础详情列表
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 商品基础详情
+     */
+    @Override
+    public List<GoodsInfo> selectGoodsInfoList(GoodsInfo goodsInfo)
+    {
+        return goodsInfoMapper.selectGoodsInfoList(goodsInfo);
+    }
+
+    /**
+     * 新增商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    @Override
+    public int insertGoodsInfo(GoodsInfo goodsInfo)
+    {
+        goodsInfo.setCreateTime(DateUtils.getNowDate());
+        return goodsInfoMapper.insertGoodsInfo(goodsInfo);
+    }
+
+    /**
+     * 修改商品基础详情
+     * 
+     * @param goodsInfo 商品基础详情
+     * @return 结果
+     */
+    @Override
+    public int updateGoodsInfo(GoodsInfo goodsInfo)
+    {
+        goodsInfo.setUpdateTime(DateUtils.getNowDate());
+        return goodsInfoMapper.updateGoodsInfo(goodsInfo);
+    }
+
+    /**
+     * 删除商品基础详情对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsInfoByIds(String ids)
+    {
+        return goodsInfoMapper.deleteGoodsInfoByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除商品基础详情信息
+     * 
+     * @param id 商品基础详情ID
+     * @return 结果
+     */
+    @Override
+    public int deleteGoodsInfoById(Long id)
+    {
+        return goodsInfoMapper.deleteGoodsInfoById(id);
+    }
+}

+ 62 - 3
dgtly-goods/dgtly-goods-common/src/main/java/com/dgtly/goods/service/impl/GoodsTypeServiceImpl.java

@@ -5,12 +5,15 @@ import java.util.List;
 
 import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.common.utils.DateUtils;
+import com.dgtly.goods.domain.GoodsTypeAttribute;
+import com.dgtly.goods.mapper.GoodsTypeAttributeMapper;
 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;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 商品分类列Service业务层处理
@@ -23,6 +26,8 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService
 {
     @Autowired
     private GoodsTypeMapper goodsTypeMapper;
+    @Autowired
+    private GoodsTypeAttributeMapper goodsTypeAttributeMapper;
 
     /**
      * 查询商品分类列
@@ -33,7 +38,9 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService
     @Override
     public GoodsType selectGoodsTypeById(Long id)
     {
-        return goodsTypeMapper.selectGoodsTypeById(id);
+        GoodsType gt = goodsTypeMapper.selectGoodsTypeById(id);
+        handleAttributeName(gt);
+        return gt;
     }
 
     /**
@@ -45,7 +52,9 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService
     @Override
     public List<GoodsType> selectGoodsTypeList(GoodsType goodsType)
     {
-        return goodsTypeMapper.selectGoodsTypeList(goodsType);
+        List<GoodsType> goodsTypes = goodsTypeMapper.selectGoodsTypeList(goodsType);
+        handleAttributeName(goodsTypes);
+        return goodsTypes;
     }
 
     /**
@@ -55,10 +64,13 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService
      * @return 结果
      */
     @Override
+    @Transactional
     public int insertGoodsType(GoodsType goodsType)
     {
         goodsType.setCreateTime(DateUtils.getNowDate());
-        return goodsTypeMapper.insertGoodsType(goodsType);
+        int i = goodsTypeMapper.insertGoodsType(goodsType);
+        goodsTypeAttributeMapper.batchAttribute(goodsType.getGoodsTypeAttributes(),goodsType.getId());
+        return i  ;
     }
 
     /**
@@ -110,6 +122,53 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService
         return ztrees;
     }
 
+    /**
+     * 根据条件查询查询数量
+     * @param goodsType
+     * @return
+     */
+    @Override
+    public Integer selectGoodsTypeCount(GoodsType goodsType) {
+        return goodsTypeMapper.selectGoodsTypeCount(goodsType);
+    }
+
+    /**
+     * 处理商品分类属性名称
+     * @param goodsType
+     */
+    public void handleAttributeName(GoodsType goodsType) {
+        String str = "";
+        if(goodsType!=null&&goodsType.getGoodsTypeAttributes()!=null&&goodsType.getGoodsTypeAttributes().size()>0){
+            for (GoodsTypeAttribute gta:goodsType.getGoodsTypeAttributes()) {
+                str+=gta.getAttributeName()+",";
+            }
+            if(str.length()>2){
+                str = str.substring(0,str.length()-2);
+            }
+            goodsType.setAttributeNames(str);
+        }
+
+
+    }
+    /**
+     * 处理商品分类属性名称
+     * @param goodsTypes
+     */
+    public void handleAttributeName(List<GoodsType> goodsTypes) {
+
+        for (GoodsType goodsType:goodsTypes) {
+            String str = "";
+            for (GoodsTypeAttribute gta:goodsType.getGoodsTypeAttributes()) {
+                str+=gta.getAttributeName()+",";
+            }
+            if(str.length()>1){
+                str = str.substring(0,str.length()-1);
+            }
+            goodsType.setAttributeNames(str);
+        }
+
+    }
+
     /**
      * 分类对象转分类树
      *

+ 141 - 0
dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsInfoMapper.xml

@@ -0,0 +1,141 @@
+<?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.GoodsInfoMapper">
+    
+    <resultMap type="GoodsInfo" id="GoodsInfoResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="typeId"    column="type_id"    />
+        <result property="price"    column="price"    />
+        <result property="cover"    column="cover"    />
+        <result property="slideshow"    column="slideshow"    />
+        <result property="describe"    column="describe"    />
+        <result property="delivery"    column="delivery"    />
+        <result property="producedTime"    column="produced_time"    />
+        <result property="producedAddress"    column="produced_address"    />
+        <result property="warehouseAddress"    column="warehouse_address"    />
+        <result property="weight"    column="weight"    />
+        <result property="putawayFlag"    column="putaway_flag"    />
+        <result property="delFlag"    column="del_flag"    />
+        <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="selectGoodsInfoVo">
+        select id, name, company_id, type_id, price, cover, slideshow, describe, delivery, produced_time, produced_address, warehouse_address, weight, putaway_flag, del_flag, create_time, create_by, update_time, update_by, remark from goods_info
+    </sql>
+
+    <select id="selectGoodsInfoList" parameterType="GoodsInfo" resultMap="GoodsInfoResult">
+        <include refid="selectGoodsInfoVo"/>
+        <where>  
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="typeId != null "> and type_id = #{typeId}</if>
+            <if test="price != null "> and price = #{price}</if>
+            <if test="cover != null  and cover != ''"> and cover = #{cover}</if>
+            <if test="slideshow != null  and slideshow != ''"> and slideshow = #{slideshow}</if>
+            <if test="describe != null  and describe != ''"> and describe = #{describe}</if>
+            <if test="delivery != null  and delivery != ''"> and delivery = #{delivery}</if>
+            <if test="producedTime != null "> and produced_time = #{producedTime}</if>
+            <if test="producedAddress != null  and producedAddress != ''"> and produced_address = #{producedAddress}</if>
+            <if test="warehouseAddress != null  and warehouseAddress != ''"> and warehouse_address = #{warehouseAddress}</if>
+            <if test="weight != null  and weight != ''"> and weight = #{weight}</if>
+            <if test="putawayFlag != null  and putawayFlag != ''"> and putaway_flag = #{putawayFlag}</if>
+        </where>
+    </select>
+    
+    <select id="selectGoodsInfoById" parameterType="Long" resultMap="GoodsInfoResult">
+        <include refid="selectGoodsInfoVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertGoodsInfo" parameterType="GoodsInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into goods_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="name != null  and name != ''">name,</if>
+            <if test="companyId != null ">company_id,</if>
+            <if test="typeId != null ">type_id,</if>
+            <if test="price != null ">price,</if>
+            <if test="cover != null  and cover != ''">cover,</if>
+            <if test="slideshow != null  and slideshow != ''">slideshow,</if>
+            <if test="describe != null  and describe != ''">describe,</if>
+            <if test="delivery != null  and delivery != ''">delivery,</if>
+            <if test="producedTime != null ">produced_time,</if>
+            <if test="producedAddress != null  and producedAddress != ''">produced_address,</if>
+            <if test="warehouseAddress != null  and warehouseAddress != ''">warehouse_address,</if>
+            <if test="weight != null  and weight != ''">weight,</if>
+            <if test="putawayFlag != null  and putawayFlag != ''">putaway_flag,</if>
+            <if test="delFlag != null  and delFlag != ''">del_flag,</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="companyId != null ">#{companyId},</if>
+            <if test="typeId != null ">#{typeId},</if>
+            <if test="price != null ">#{price},</if>
+            <if test="cover != null  and cover != ''">#{cover},</if>
+            <if test="slideshow != null  and slideshow != ''">#{slideshow},</if>
+            <if test="describe != null  and describe != ''">#{describe},</if>
+            <if test="delivery != null  and delivery != ''">#{delivery},</if>
+            <if test="producedTime != null ">#{producedTime},</if>
+            <if test="producedAddress != null  and producedAddress != ''">#{producedAddress},</if>
+            <if test="warehouseAddress != null  and warehouseAddress != ''">#{warehouseAddress},</if>
+            <if test="weight != null  and weight != ''">#{weight},</if>
+            <if test="putawayFlag != null  and putawayFlag != ''">#{putawayFlag},</if>
+            <if test="delFlag != null  and delFlag != ''">#{delFlag},</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="updateGoodsInfo" parameterType="GoodsInfo">
+        update goods_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null  and name != ''">name = #{name},</if>
+            <if test="companyId != null ">company_id = #{companyId},</if>
+            <if test="typeId != null ">type_id = #{typeId},</if>
+            <if test="price != null ">price = #{price},</if>
+            <if test="cover != null  and cover != ''">cover = #{cover},</if>
+            <if test="slideshow != null  and slideshow != ''">slideshow = #{slideshow},</if>
+            <if test="describe != null  and describe != ''">describe = #{describe},</if>
+            <if test="delivery != null  and delivery != ''">delivery = #{delivery},</if>
+            <if test="producedTime != null ">produced_time = #{producedTime},</if>
+            <if test="producedAddress != null  and producedAddress != ''">produced_address = #{producedAddress},</if>
+            <if test="warehouseAddress != null  and warehouseAddress != ''">warehouse_address = #{warehouseAddress},</if>
+            <if test="weight != null  and weight != ''">weight = #{weight},</if>
+            <if test="putawayFlag != null  and putawayFlag != ''">putaway_flag = #{putawayFlag},</if>
+            <if test="delFlag != null  and delFlag != ''">del_flag = #{delFlag},</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="deleteGoodsInfoById" parameterType="Long">
+        delete from goods_info where id = #{id}
+    </delete>
+
+    <delete id="deleteGoodsInfoByIds" parameterType="String">
+        delete from goods_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 15 - 27
dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeAttributeMapper.xml

@@ -7,24 +7,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="GoodsTypeAttribute" id="GoodsTypeAttributeResult">
         <result property="id"    column="id"    />
         <result property="typeId"    column="type_id"    />
-        <result property="name"    column="name"    />
+        <result property="attributeName"    column="attribute_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
+        select id, type_id, attribute_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="name != null  and name != ''"> and attribute_name like concat('%', #{attributeName}, '%')</if>
             <if test="sort != null "> and sort = #{sort}</if>
         </where>
     </select>
@@ -39,24 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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="attributeName != null  and attributeName != ''">attribute_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="attributeName != null  and attributeName != ''">#{attribute_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>
 
@@ -64,13 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         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="attributeName != null  and attributeName != ''">attribute_name = #{attributeName},</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>
@@ -85,5 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-    
+
+    <insert id="batchAttribute" parameterType="GoodsTypeAttribute">
+        insert into goods_type_attribute (attribute_name,type_id,sort) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.attributeName},#{typeId},#{item.sort})
+        </foreach>
+
+    </insert>
+
 </mapper>

+ 28 - 5
dgtly-goods/dgtly-goods-common/src/main/resources/mapper/goods/GoodsTypeMapper.xml

@@ -14,27 +14,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="remark"    column="remark"    />
+        <collection  property="goodsTypeAttributes"   javaType="java.util.List"       resultMap="GoodsTypeAttributeResult" />
+    </resultMap>
+
+    <resultMap type="GoodsTypeAttribute" id="GoodsTypeAttributeResult">
+        <result property="id"    column="attributeId"    />
+        <result property="typeId"    column="type_id"    />
+        <result property="attributeName"    column="attribute_name"    />
+        <result property="sort"    column="sort"    />
     </resultMap>
 
     <sql id="selectGoodsTypeVo">
-        select id, name, parent_id, ancestors, create_time, create_by, update_time, update_by, remark from goods_type
+        select gt.id, gt.name, gt.parent_id, gt.ancestors, gt.create_time, gt.create_by, gt.update_time, gt.update_by, gt.remark,
+                gta.id attributeId,gta.type_id,gta.attribute_name,gta.sort
+        from goods_type gt
+        left join goods_type_attribute gta on gta.type_id = gt.id
     </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>
+            <if test="name != null  and name != ''"> and gt.name like concat('%', #{name}, '%')</if>
+            <if test="parentId != null "> and gt.parent_id = #{parentId}</if>
+            <if test="ancestors != null  and ancestors != ''"> and gt.ancestors = #{ancestors}</if>
         </where>
     </select>
     
     <select id="selectGoodsTypeById" parameterType="Long" resultMap="GoodsTypeResult">
         <include refid="selectGoodsTypeVo"/>
-        where id = #{id}
+        where gt.id = #{id}
     </select>
         
     <insert id="insertGoodsType" parameterType="GoodsType" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
+            select LAST_INSERT_ID();
+        </selectKey>
         insert into goods_type
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="name != null  and name != ''">name,</if>
@@ -83,5 +97,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <select id="selectGoodsTypeCount" parameterType="GoodsType" resultType="int" >
+        select  count(1) from goods_type
+        <where>
+            <if test="name != null  and name != ''"> and name = #{name}</if>
+            <if test="parentId != null "> and parent_id = #{parentId}</if>
+            <if test="ancestors != null  and ancestors != ''"> and ancestors like concat('%', #{ancestors}, '%')</if>
+        </where>
+    </select>
     
 </mapper>

+ 6 - 32
dgtly-system/src/main/java/com/dgtly/system/domain/SysCompany.java

@@ -22,9 +22,7 @@ public class SysCompany extends BaseEntity
 
     /** 公司名称 */
     @Excel(name = "公司名称")
-    private String company;
-
-    private Integer authorizeId;
+    private String companyName;
 
     private Integer status;//公司状态
 
@@ -56,49 +54,25 @@ public class SysCompany extends BaseEntity
     {
         return id;
     }
-    public void setCompany(String company) 
+    public void setCompanyName(String companyName)
     {
-        this.company = company;
+        this.companyName = companyName;
     }
 
-    public String getCompany() 
+    public String getCompanyName()
     {
-        return company;
+        return companyName;
     }
 
-    public Integer getAuthorizeId() {
-        return authorizeId;
-    }
 
-    public void setAuthorizeId(Integer authorizeId) {
-        this.authorizeId = authorizeId;
-    }
 
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("company", getCompany())
+            .append("company", getCompanyName())
             .append("createTime", getCreateTime())
             .toString();
     }
-    //创建公司时创建的用户账号密码
-    private String loginName;
-    private String password;
-
-    public String getLoginName() {
-        return loginName;
-    }
 
-    public void setLoginName(String loginName) {
-        this.loginName = loginName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
 }

+ 1 - 1
dgtly-system/src/main/java/com/dgtly/system/mapper/SysUserMapper.java

@@ -114,7 +114,7 @@ public interface SysUserMapper
      * @param loginName 登录名称
      * @return 结果
      */
-    public int checkLoginNameUnique(@Param("loginName") String loginName,@Param("companyId") Long companyId);
+    public int checkLoginNameUnique(@Param("loginName") String loginName);
 
     /**
      * 校验手机号码是否唯一

+ 18 - 0
dgtly-system/src/main/java/com/dgtly/system/service/ISysCompanyService.java

@@ -1,6 +1,9 @@
 package com.dgtly.system.service;
 
+import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.system.domain.SysCompany;
+import com.dgtly.system.domain.SysUser;
+
 import java.util.List;
 
 /**
@@ -58,4 +61,19 @@ public interface ISysCompanyService
      * @return 结果
      */
     public int deleteSysCompanyById(Long id);
+
+    /**
+     * 创建公司同事创建用户
+     * @param sysCompany
+     * @param user
+     * @return
+     */
+    public int addCompany(SysCompany sysCompany, SysUser user);
+
+    /**
+     * 公司列表转tree
+     * @param sysCompany
+     * @return
+     */
+    public List<Ztree> selectSysCompanyTree(SysCompany sysCompany);
 }

+ 1 - 1
dgtly-system/src/main/java/com/dgtly/system/service/ISysUserService.java

@@ -129,7 +129,7 @@ public interface ISysUserService
      * @param loginName 登录名称
      * @return 结果
      */
-    public String checkLoginNameUnique(String loginName,Long companyId);
+    public String checkLoginNameUnique(String loginName);
 
     /**
      * 校验手机号码是否唯一

+ 84 - 0
dgtly-system/src/main/java/com/dgtly/system/service/impl/SysCompanyServiceImpl.java

@@ -1,13 +1,28 @@
 package com.dgtly.system.service.impl;
 
+import java.beans.Transient;
+import java.util.ArrayList;
 import java.util.List;
+
+import com.dgtly.common.constant.UserConstants;
+import com.dgtly.common.core.domain.Ztree;
+import com.dgtly.common.exception.BusinessException;
 import com.dgtly.common.utils.DateUtils;
+import com.dgtly.common.utils.ShiroSaltUtil;
+import com.dgtly.common.utils.StringUtils;
+import com.dgtly.common.utils.security.EncryptPassWordClass;
+import com.dgtly.system.domain.SysDept;
+import com.dgtly.system.domain.SysUser;
+import com.dgtly.system.service.ISysConfigService;
+import com.dgtly.system.service.ISysDeptService;
+import com.dgtly.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.system.mapper.SysCompanyMapper;
 import com.dgtly.system.domain.SysCompany;
 import com.dgtly.system.service.ISysCompanyService;
 import com.dgtly.common.core.text.Convert;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 公司表Service业务层处理
@@ -21,6 +36,14 @@ public class SysCompanyServiceImpl implements ISysCompanyService
     @Autowired
     private SysCompanyMapper sysCompanyMapper;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+    @Autowired
+    private ISysDeptService sysDeptService;
+    @Autowired
+    private ISysConfigService sysConfigService;
+
     /**
      * 查询公司表
      * 
@@ -94,4 +117,65 @@ public class SysCompanyServiceImpl implements ISysCompanyService
     {
         return sysCompanyMapper.deleteSysCompanyById(id);
     }
+
+    @Override
+    @Transactional
+    public int addCompany(SysCompany sysCompany,SysUser user){
+        if (UserConstants.USER_NAME_NOT_UNIQUE.equals(sysUserService.checkLoginNameUnique(user.getLoginName())))
+        {
+            throw  new BusinessException("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
+        }else if (user.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH
+                || user.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH)
+        {
+            throw new BusinessException("密码长度为6-19,请重新设置!!");
+        }
+
+        sysCompanyMapper.insertSysCompany(sysCompany);
+        //创建公司主体部门
+        SysDept dept = new SysDept();
+        dept.setCompanyId(sysCompany.getId());
+        dept.setDeptName(sysCompany.getCompanyName());
+        /*父节点为100 总体结构*/
+        dept.setParentId(100L);
+        dept.setCreateBy(sysCompany.getCreateBy());
+        sysDeptService.insertDept(dept);
+        //创建管理员账号
+        user.setSex("1");
+        Long[] roles = {Long.parseLong(sysConfigService.selectConfigByKey("company.manager.roleId"))};
+        user.setRoleIds(roles);
+        user.setDeptId(dept.getDeptId());
+        user.setCompanyId(sysCompany.getId()+0l);
+        user.setSalt(ShiroSaltUtil.randomSalt());
+        user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
+        user.setCreateBy(sysCompany.getCreateBy());
+        int rows = sysUserService.insertUser(user);
+        return rows;
+    }
+
+    @Override
+    public List<Ztree> selectSysCompanyTree(SysCompany sysCompany) {
+        List<SysCompany> companies=sysCompanyMapper.selectSysCompanyList(sysCompany);
+
+        return initZtree(companies);
+    }
+
+    public List<Ztree> initZtree(List<SysCompany> companies)
+    {
+
+        List<Ztree> ztrees = new ArrayList<Ztree>();
+        for (SysCompany company : companies)
+        {
+            if (UserConstants.DEPT_NORMAL.equals(company.getStatus().toString())&&company.getId()!=1L)
+            {
+                Ztree ztree = new Ztree();
+                ztree.setId(company.getId());
+                ztree.setpId(0L);
+                ztree.setName(company.getCompanyName());
+                ztree.setTitle(company.getCompanyName());
+
+                ztrees.add(ztree);
+            }
+        }
+        return ztrees;
+    }
 }

+ 2 - 2
dgtly-system/src/main/java/com/dgtly/system/service/impl/SysUserServiceImpl.java

@@ -307,9 +307,9 @@ public class SysUserServiceImpl implements ISysUserService
      * @return
      */
     @Override
-    public String checkLoginNameUnique(String loginName,Long companyId)
+    public String checkLoginNameUnique(String loginName)
     {
-        int count = userMapper.checkLoginNameUnique(loginName,companyId);
+        int count = userMapper.checkLoginNameUnique(loginName);
         if (count > 0)
         {
             return UserConstants.USER_NAME_NOT_UNIQUE;

+ 6 - 13
dgtly-system/src/main/resources/mapper/system/SysCompanyMapper.xml

@@ -6,20 +6,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="SysCompany" id="SysCompanyResult">
         <result property="id"    column="id"    />
-        <result property="company"    column="company"    />
-        <result property="authorizeId"    column="authorize_id"    />
+        <result property="companyName"    column="company_name"    />
         <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
     </resultMap>
 
     <sql id="selectSysCompanyVo">
-        select id, company,authorize_id,status,create_time from sys_company
+        select id, company_name,status,create_time from sys_company
     </sql>
 
     <select id="selectSysCompanyList" parameterType="SysCompany" resultMap="SysCompanyResult">
         <include refid="selectSysCompanyVo"/>
         <where>  
-            <if test="company != null  and company != ''"> and company = #{company}</if>
+            <if test="companyName != null  and companyName != ''"> and company_name = #{companyName}</if>
         </where>
     </select>
     
@@ -31,14 +29,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertSysCompany" parameterType="SysCompany" useGeneratedKeys="true" keyProperty="id">
         insert into sys_company
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="company != null  and company != ''">company,</if>
-            <if test="authorizeId != null">authorize_id,</if>
-            <if test="createTime != null ">create_time,</if>
+            <if test="companyName != null  and companyName != ''">company_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="company != null  and company != ''">#{company},</if>
-            <if test="authorizeId != null">#{authorizeId},</if>
-            <if test="createTime != null ">#{createTime},</if>
+            <if test="companyName != null  and companyName != ''">#{companyName},</if>
          </trim>
     </insert>
 
@@ -46,8 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update sys_company
         <trim prefix="SET" suffixOverrides=",">
             <if test="status != null">status = #{status},</if>
-            <if test="company != null  and company != ''">company = #{company},</if>
-            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="companyName != null  and companyName != ''">company _name= #{companyName},</if>
         </trim>
         where id = #{id}
     </update>

+ 4 - 1
dgtly-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -86,7 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		select * from sys_dept where find_in_set(#{deptId}, ancestors)
 	</select>
 	
-	<insert id="insertDept" parameterType="SysDept">
+	<insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
+		<selectKey keyProperty="deptId" order="AFTER" resultType="java.lang.Long">
+			select LAST_INSERT_ID();
+		</selectKey>
  		insert into sys_dept(
  			<if test="deptId != null and deptId != 0">dept_id,</if>
 			<if test="companyId != null and companyId != 0">company_id,</if>

+ 4 - 2
dgtly-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<resultMap id="companyResult" type="SysCompany">
 		<id     property="id"   column="id"     />
-		<result property="company" column="company"   />
+		<result property="companyName" column="company_name"   />
 	</resultMap>
 	
 	<resultMap id="RoleResult" type="SysRole">
@@ -54,7 +54,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 	
 	<sql id="selectUserVo">
-        select  u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark,
+        select  u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt, u.status,
+        		u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark,
+        		c.company_name,
        		    d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
        		    r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
 		from sys_user u