Bläddra i källkod

修改last_update_time、晚上系统设置

huangyh 6 år sedan
förälder
incheckning
26d10534c8
36 ändrade filer med 511 tillägg och 178 borttagningar
  1. 63 0
      controllers/gen/SystemController_gen.go
  2. 176 21
      controllers/partial/SystemController.go
  3. 76 79
      engine/system_init.go
  4. 25 4
      entitys/ctrl_context.go
  5. 26 0
      light-apiengine.xml
  6. 6 2
      models/LoginReturnInfo_gen.go
  7. 1 1
      models/SysAttachment_gen.go
  8. 2 2
      models/SysDomain_gen.go
  9. 2 2
      models/SysMenuTree_gen.go
  10. 2 2
      models/SysMenu_gen.go
  11. 4 2
      models/SysOrgTree_gen.go
  12. 4 2
      models/SysOrg_gen.go
  13. 2 2
      models/SysPermission_gen.go
  14. 2 2
      models/SysRoleMenu_gen.go
  15. 2 2
      models/SysRolePermission_gen.go
  16. 2 2
      models/SysRole_gen.go
  17. 2 2
      models/SysUserRole_gen.go
  18. 6 2
      models/SysUser_gen.go
  19. 6 2
      models/UserInfo_gen.go
  20. 15 0
      routers/system.go
  21. 5 5
      sqlconfig/light-apiengine/sys_domain_gen.xml
  22. 5 5
      sqlconfig/light-apiengine/sys_menu_gen.xml
  23. 5 5
      sqlconfig/light-apiengine/sys_org_gen.xml
  24. 5 5
      sqlconfig/light-apiengine/sys_permission_gen.xml
  25. 5 5
      sqlconfig/light-apiengine/sys_role_gen.xml
  26. 5 5
      sqlconfig/light-apiengine/sys_role_menu_gen.xml
  27. 5 5
      sqlconfig/light-apiengine/sys_role_permission_gen.xml
  28. 5 5
      sqlconfig/light-apiengine/sys_user_gen.xml
  29. 5 5
      sqlconfig/light-apiengine/sys_user_role_gen.xml
  30. 7 0
      sqlconfig/system_controller/system_find_domain_page_count.tpl
  31. 8 0
      sqlconfig/system_controller/system_find_domain_page_select.tpl
  32. 1 1
      sqlconfig/system_controller/system_find_menu_page_count.tpl
  33. 1 1
      sqlconfig/system_controller/system_find_menu_page_select.tpl
  34. 9 0
      sqlconfig/system_controller/system_find_org_page_count.tpl
  35. 9 0
      sqlconfig/system_controller/system_find_org_page_select.tpl
  36. 7 0
      sqlconfig/system_controller/system_get_domain_tree.tpl

+ 63 - 0
controllers/gen/SystemController_gen.go

@@ -69,6 +69,18 @@ func (c *SystemController) GetMenuTree(ctx *gin.Context) {
 	partial.System_GetMenuTree(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
 }
 
+// GetDomainTree
+// @Title GetDomainTree
+// @Description 获取菜单树         
+// @Success 200 {object} sysReturn
+// @Failure 403 :id is empty
+// @router /get_domain_tree  [get,post]
+func (c *SystemController) GetDomainTree(ctx *gin.Context) {
+	//
+	db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
+	partial.System_GetDomainTree(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
+}
+
 // FindOrgPage
 // @Title FindOrgPage
 // @Description 获取组织架构分页数         
@@ -105,6 +117,18 @@ func (c *SystemController) FindMenuPage(ctx *gin.Context) {
 	partial.System_FindMenuPage(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
 }
 
+// FindDomainPage
+// @Title FindDomainPage
+// @Description 获取菜单分页数         
+// @Success 200 {object} sysReturn
+// @Failure 403 :id is empty
+// @router /find_domain_page  [get,post]
+func (c *SystemController) FindDomainPage(ctx *gin.Context) {
+	//
+	db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
+	partial.System_FindDomainPage(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
+}
+
 // AddUser
 // @Title AddUser
 // @Description 添加用户         
@@ -281,3 +305,42 @@ func (c *SystemController) UpdateMenu(ctx *gin.Context) {
 	partial.System_UpdateMenu(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
 }
 
+// AddOrg
+// @Title AddOrg
+// @Description 添加组织         
+// @Param	    string  false  "组织"  
+// @Success 200 {object} sysReturn
+// @Failure 403 :id is empty
+// @router /add_org  [post,get,put]
+func (c *SystemController) AddOrg(ctx *gin.Context) {
+	//
+	db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
+	partial.System_AddOrg(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
+}
+
+// DelOrg
+// @Title DelOrg
+// @Description 删除组织         
+// @Param	id    string  false  "组织ID"  
+// @Success 200 {object} sysReturn
+// @Failure 403 :id is empty
+// @router /del_org  [post,get,put]
+func (c *SystemController) DelOrg(ctx *gin.Context) {
+	//
+	db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
+	partial.System_DelOrg(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
+}
+
+// UpdateOrg
+// @Title UpdateOrg
+// @Description 更新组织         
+// @Param	    string  false  "组织"  
+// @Success 200 {object} sysReturn
+// @Failure 403 :id is empty
+// @router /update_org  [post,get,put]
+func (c *SystemController) UpdateOrg(ctx *gin.Context) {
+	//
+	db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
+	partial.System_UpdateOrg(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
+}
+

+ 176 - 21
controllers/partial/SystemController.go

@@ -48,6 +48,22 @@ func System_GetMenuTree(c *entitys.CtrlContext) {
 	}
 }
 
+// _GetDomainTree
+// @Title _GetDomainTree
+// @Description 获取域树
+// @Success 200 {object} Account
+// @Failure 403 :id is empty
+func System_GetDomainTree(c *entitys.CtrlContext) {
+	paramMap_i_t := map[string]interface{}{"sort": "name"}
+	result, err := sysutils.TreeSearch(c.Db, "system", "get_domain_tree", "sys_domain", paramMap_i_t)
+
+	if err == nil {
+		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", result})
+	} else {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+	}
+}
+
 // _FindUserPage
 // @Title _FindUserPage
 // @Description 获取用户分页数
@@ -122,7 +138,11 @@ func System_FindOrgPage(c *entitys.CtrlContext) {
 	page, _ := strconv.Atoi(c.Ctx.DefaultQuery("page", "1"))
 	rows, _ := strconv.Atoi(c.Ctx.DefaultQuery("rows", "10"))
 
-	paramMap_i_t := map[string]interface{}{"page": page, "rows": rows}
+	name := c.Ctx.DefaultQuery("name", "")
+	code := c.Ctx.DefaultQuery("code", "")
+	cn_id := c.Ctx.DefaultQuery("cn_id", "")
+
+	paramMap_i_t := map[string]interface{}{"page": page, "rows": rows, "name": name, "code": code, "cn_id": cn_id}
 	result, err := sysutils.PageSearch(c.Db, "system", "find_org_page", "sys_org", paramMap_i_t)
 	if err == nil {
 		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", result})
@@ -168,7 +188,7 @@ func System_AddUser(c *entitys.CtrlContext) {
 	user.Id = sysutils.NewUUID()
 	user.Name = user.LoginId
 	user.CreateTime = time.Now()
-	user.LastUpdateDate = time.Now()
+	user.LastUpdateTime = time.Now().Unix()
 	user.CreateBy = user_id
 	user.LastUpdateBy = user_id
 	user.DelFlag = 0
@@ -256,11 +276,23 @@ func System_UpdateUser(c *entitys.CtrlContext) {
 // @Success 200 {object} Account
 // @Failure 403 :id is empty
 func System_AddRole(c *entitys.CtrlContext) {
-	name := c.Ctx.Query("name")
-	remark := c.Ctx.Query("remark")
+	var paramObj0 models.SysRole
+	c.Ctx.BindJSON(&paramObj0)
 
-	ret := __none_func_system__(name, remark)
-	if ret {
+	tk, _ := c.Ctx.Get("token")
+	user := tk.(*entitys.Token)
+
+	paramObj0.Id = sysutils.NewUUID()
+	paramObj0.Domain = user.Domain
+	paramObj0.CreateBy = user.UserId
+	paramObj0.LastUpdateBy = user.UserId
+	paramObj0.CreateTime = time.Now()
+	paramObj0.LastUpdateTime = time.Now().Unix()
+	paramObj0.DelFlag = 0
+
+	_, err := c.LocalSqlMapClient("insert_sys_role", &paramObj0).Execute()
+
+	if err == nil {
 		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
 	} else {
 		c.Ctx.JSON(500, sysmodel.SysReturn{500, "", nil})
@@ -274,10 +306,19 @@ func System_AddRole(c *entitys.CtrlContext) {
 // @Success 200 {object} Account
 // @Failure 403 :id is empty
 func System_DelRole(c *entitys.CtrlContext) {
-	id := c.Ctx.Query("id")
+	type Param struct {
+		Id string `json:"id"`
+	}
+	var params []Param
+	c.Ctx.BindJSON(&params)
+	ids := []string{}
+	for _, param := range params {
+		ids = append(ids, param.Id)
+	}
 
-	ret := __none_func_system__(id)
-	if ret {
+	_, err := c.Db.Table(new(models.SysRole)).In("id", ids).Update(map[string]interface{}{"del_flag": 1})
+
+	if err == nil {
 		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
 	} else {
 		c.Ctx.JSON(500, sysmodel.SysReturn{500, "", nil})
@@ -347,6 +388,26 @@ func System_FindMenuPage(c *entitys.CtrlContext) {
 
 }
 
+// _FindDomainPage
+// @Title _FindDomainPage
+// @Description 获取域分页数
+// @Success 200 {object} Account
+// @Failure 403 :id is empty
+func System_FindDomainPage(c *entitys.CtrlContext) {
+
+	page, _ := strconv.Atoi(c.Ctx.DefaultQuery("page", "1"))
+	rows, _ := strconv.Atoi(c.Ctx.DefaultQuery("rows", "10"))
+
+	paramMap_i_t := map[string]interface{}{"page": page, "rows": rows}
+	result, err := sysutils.PageSearch(c.Db, "system", "find_domain_page", "sys_domain", paramMap_i_t)
+	if err == nil {
+		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", result})
+	} else {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+	}
+
+}
+
 // _FindRoleMenu
 // @Title _FindRoleMenu
 // @Description 查找角色权限
@@ -429,19 +490,22 @@ func System_AddMenu(c *entitys.CtrlContext) {
 	paramObj0.CreateBy = user.UserId
 	paramObj0.LastUpdateBy = user.UserId
 	paramObj0.CreateTime = time.Now()
-	paramObj0.LastUpdateDate = time.Now()
+	paramObj0.LastUpdateTime = time.Now().Unix()
 	paramObj0.DelFlag = 0
 
-	parentNodes := []sysmodel.SysMenu{}
-	err := c.Db.SqlMapClient("one_sys_menu", paramObj0.Parent).Find(&parentNodes)
-	if err != nil {
-		c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
-		return
+	if paramObj0.Parent != "" {
+		parentNodes := []sysmodel.SysMenu{}
+		err := c.Db.SqlMapClient("one_sys_menu", paramObj0.Parent).Find(&parentNodes)
+		if err != nil {
+			c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+			return
+		}
+		paramObj0.Inheritance = fmt.Sprintf("|%s%s", paramObj0.Id, parentNodes[0].Inheritance)
+	} else {
+		paramObj0.Inheritance = fmt.Sprintf("|%s|", paramObj0.Id)
 	}
 
-	paramObj0.Inheritance = fmt.Sprintf("|%s%s", paramObj0.Id, parentNodes[0].Inheritance)
-
-	_, err = c.Db.SqlMapClient("insert_sys_menu", &paramObj0).Execute()
+	_, err := c.LocalSqlMapClient("insert_sys_menu", &paramObj0).Execute()
 
 	if err == nil {
 		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
@@ -457,14 +521,24 @@ func System_AddMenu(c *entitys.CtrlContext) {
 // @Success 200 {object} Account
 // @Failure 403 :id is empty
 func System_DelMenu(c *entitys.CtrlContext) {
-	id := c.Ctx.Query("id")
+	type Param struct {
+		Id string `json:"id"`
+	}
+	var params []Param
+	c.Ctx.BindJSON(&params)
+	ids := []string{}
+	for _, param := range params {
+		ids = append(ids, param.Id)
+	}
 
-	ret := __none_func_system__(id)
-	if ret {
+	_, err := c.Db.Table(new(models.SysMenu)).In("id", ids).Update(map[string]interface{}{"del_flag": 1})
+
+	if err == nil {
 		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
 	} else {
 		c.Ctx.JSON(500, sysmodel.SysReturn{500, "", nil})
 	}
+
 }
 
 // _UpdateMenu
@@ -486,6 +560,87 @@ func System_UpdateMenu(c *entitys.CtrlContext) {
 	}
 }
 
+// _AddOrg
+// @Title _AddOrg
+// @Description 添加组织
+// @Param	name    string  false  "组织名称"
+// @Param	domain    string  false  "域"
+// @Param	parent    string  false  "父ID"
+// @Success 200 {object} Account
+// @Failure 403 :id is empty
+func System_AddOrg(c *entitys.CtrlContext) {
+	var paramObj0 models.SysOrg
+	c.Ctx.BindJSON(&paramObj0)
+
+	tk, _ := c.Ctx.Get("token")
+	user := tk.(*entitys.Token)
+
+	paramObj0.Id = sysutils.NewUUID()
+	paramObj0.CreateBy = user.UserId
+	paramObj0.LastUpdateBy = user.UserId
+	paramObj0.CreateTime = time.Now()
+	paramObj0.LastUpdateTime = time.Now().Unix()
+	paramObj0.DelFlag = 0
+
+	if paramObj0.Parent != "" {
+		parentNodes := []sysmodel.SysOrg{}
+		err := c.LocalSqlMapClient("selectone_sys_org", &paramObj0).Find(&parentNodes)
+		if err != nil {
+			c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+			return
+		}
+		paramObj0.Inheritance = fmt.Sprintf("|%s%s", paramObj0.Id, parentNodes[0].Inheritance)
+	} else {
+		paramObj0.Inheritance = fmt.Sprintf("|%s|", paramObj0.Id)
+	}
+
+	_, err := c.LocalSqlMapClient("insert_sys_org", &paramObj0).Execute()
+
+	if err == nil {
+		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
+	} else {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+	}
+}
+
+// _DelOrg
+// @Title _DelOrg
+// @Description 删除组织
+// @Param	id    string array  false  "用户ID"
+// @Success 200 {object} Account
+// @Failure 403 :id is empty
+func System_DelOrg(c *entitys.CtrlContext) {
+	id := c.Ctx.Query("id")
+
+	ret := __none_func_system__(id)
+	if ret {
+		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
+	} else {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, "", nil})
+	}
+}
+
+// _UpdateOrg
+// @Title _UpdateOrg
+// @Description 修改组织
+// @Param	name    string  false  "组织名称"
+// @Param	domain    string  false  "域"
+// @Param	parent    string  false  "父ID"
+// @Success 200 {object} Account
+// @Failure 403 :id is empty
+func System_UpdateOrg(c *entitys.CtrlContext) {
+	name := c.Ctx.Query("name")
+	domain := c.Ctx.Query("domain")
+	parent := c.Ctx.Query("parent")
+
+	ret := __none_func_system__(name, domain, parent)
+	if ret {
+		c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
+	} else {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, "", nil})
+	}
+}
+
 func __none_func_system__(params ...interface{}) bool {
 	return true
 }

+ 76 - 79
engine/system_init.go

@@ -2,16 +2,15 @@ package engine
 
 import (
 	"fmt"
+	"git.qianqiusoft.com/qianqiusoft/light-apiengine/logs"
 	"git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
 	"git.qianqiusoft.com/qianqiusoft/light-apiengine/utils"
-	"git.qianqiusoft.com/qianqiusoft/light-apiengine/logs"
 	"github.com/xormplus/xorm"
 	"regexp"
 	"time"
 )
 
-
-func createDatabase(orm *xorm.Engine)  {
+func createDatabase(orm *xorm.Engine) {
 	if orm.DriverName() == "mysql" {
 		dbname := orm.DataSourceName()
 		reg := regexp.MustCompile("(.*)/(.*)(\\?.*)")
@@ -36,115 +35,115 @@ func initPlatformDbData(db *xorm.Engine) {
 
 	domains := []models.SysDomain{
 		{
-			Id:   "287c50a4-caad-4557-80c8-aca81af9f370",
-			Name: "智慧蜂云",
-			Domain: "ccbeetech.com",
-			DataSource: "root:qian@123@tcp(localhost:3306)/ssm-ccbeetech?charset=utf8&loc=Local",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "287c50a4-caad-4557-80c8-aca81af9f370",
+			Name:           "智慧蜂云",
+			Domain:         "ccbeetech.com",
+			DataSource:     "root:qian@123@tcp(localhost:3306)/ssm-ccbeetech?charset=utf8&loc=Local",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 
 	orgs := []models.SysOrg{
 		{
-			Id:   "287c50a4-caad-4557-80c8-aca81af9f370",
-			Name: "千秋软件",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "287c50a4-caad-4557-80c8-aca81af9f370",
+			Name:           "千秋软件",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 	users := []models.SysUser{
 		{
-			Id:       "187c50a4-caad-4557-80c8-aca81af9f370",
-			Name:     "管理员",
-			LoginId:  "admin",
-			Domain: "qianqiusoft.com",
-			OrgId:    "287c50a4-caad-4557-80c8-aca81af9f370",
-			Password: utils.HashPassword("123456", ""),
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "187c50a4-caad-4557-80c8-aca81af9f370",
+			Name:           "管理员",
+			LoginId:        "admin",
+			Domain:         "qianqiusoft.com",
+			OrgId:          "287c50a4-caad-4557-80c8-aca81af9f370",
+			Password:       utils.HashPassword("123456", ""),
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 
 	roles := []models.SysRole{
 		{
-			Id:   "487c50a4-caad-4557-80c8-aca81af9f370",
-			Name: "超级管理员",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "487c50a4-caad-4557-80c8-aca81af9f370",
+			Name:           "超级管理员",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 
 	userRoles := []models.SysUserRole{
 		{
-			Id:     "587c50a4-caad-4557-80c8-aca81af9f370",
-			RoleId: "387c50a4-caad-4557-80c8-aca81af9f370",
-			UserId: "187c50a4-caad-4557-80c8-aca81af9f370",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "587c50a4-caad-4557-80c8-aca81af9f370",
+			RoleId:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			UserId:         "187c50a4-caad-4557-80c8-aca81af9f370",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 
 	menus := []models.SysMenu{
 		{
-			Id:   "387c50a4-caad-4557-80c8-aca81af9f370",
-			Name: "系统管理",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f370",
+			Name:           "系统管理",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f371",
-			Name:   "用户管理",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/user",
-			Component:"system/user",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f371",
+			Name:           "用户管理",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/user",
+			Component:      "system/user",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f372",
-			Name:   "组织架构",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/org",
-			Component:"system/org",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f372",
+			Name:           "组织架构",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/org",
+			Component:      "system/org",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f373",
-			Name:   "角色管理",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/role",
-			Component: "system/role",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f373",
+			Name:           "角色管理",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/role",
+			Component:      "system/role",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f374",
-			Name:   "菜单管理",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/menu",
-			Component: "system/menu",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f374",
+			Name:           "菜单管理",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/menu",
+			Component:      "system/menu",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f375",
-			Name:   "字典管理",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/dict",
-			Component: "system/dic",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f375",
+			Name:           "字典管理",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/dict",
+			Component:      "system/dic",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 		{
-			Id:     "387c50a4-caad-4557-80c8-aca81af9f376",
-			Name:   "日志管理",
-			Parent: "387c50a4-caad-4557-80c8-aca81af9f370",
-			Url:    "/sys/log",
-			Component: "system/log",
-			CreateTime:time.Now(),
-			LastUpdateDate: time.Now(),
+			Id:             "387c50a4-caad-4557-80c8-aca81af9f376",
+			Name:           "日志管理",
+			Parent:         "387c50a4-caad-4557-80c8-aca81af9f370",
+			Url:            "/sys/log",
+			Component:      "system/log",
+			CreateTime:     time.Now(),
+			LastUpdateTime: time.Now().Unix(),
 		},
 	}
 
@@ -164,7 +163,6 @@ func initPlatformDbData(db *xorm.Engine) {
 	printError(err)
 }
 
-
 func initOrmEngine(orm *xorm.Engine, driverName string) {
 	path, _ := utils.GetCurrentPath()
 	sqldir := path + "/sqlconfig"
@@ -196,9 +194,8 @@ func initOrmEngine(orm *xorm.Engine, driverName string) {
 	createDatabase(orm)
 }
 
-
 func printError(err error) {
 	if err != nil {
 		logs.Error(err.Error())
 	}
-}
+}

+ 25 - 4
entitys/ctrl_context.go

@@ -1,12 +1,33 @@
 package entitys
 
-import(
+import (
+	"encoding/json"
+	"git.qianqiusoft.com/qianqiusoft/light-apiengine/logs"
 	"github.com/gin-gonic/gin"
 	"github.com/xormplus/xorm"
 )
 
-type CtrlContext struct{
-	Ctx *gin.Context
-	Db *xorm.Engine
+type CtrlContext struct {
+	Ctx              *gin.Context
+	Db               *xorm.Engine
 	PlatformDbEngine *xorm.Engine
 }
+
+// LocalSqlMapClient
+// @Title 将结构图转成map[string]interface{}对象
+// @Description 添加菜单
+// @Param	    string  false  "sqlMap唯一ID, 结构体"
+// @Success *xorm.Session
+func (c CtrlContext) LocalSqlMapClient(sqlTagName string, obj interface{}) *xorm.Session {
+	jsonBytes, err := json.Marshal(obj)
+	if err != nil {
+		logs.Error(err.Error())
+	}
+
+	var mapParam map[string]interface{}
+	if err := json.Unmarshal(jsonBytes, &mapParam); err != nil {
+		logs.Error(err.Error())
+	}
+
+	return c.Db.SqlMapClient(sqlTagName, &mapParam)
+}

+ 26 - 0
light-apiengine.xml

@@ -57,12 +57,16 @@
             </api>
             <api name="get_menu_tree" desc="获取菜单树" function="tree" table="sys_menu" method="get,post" >
             </api>
+            <api name="get_domain_tree" desc="获取菜单树" function="tree" table="sys_domain" method="get,post" >
+            </api>
             <api name="find_org_page" desc="获取组织架构分页数" function="page" table="sys_org" method="get,post" >
             </api>
             <api name="find_role_page" desc="获取角色分页数" function="page" table="sys_role" method="get,post" >
             </api>
             <api name="find_menu_page" desc="获取菜单分页数" function="page" table="sys_menu" method="get,post" >
             </api>
+            <api name="find_domain_page" desc="获取菜单分页数" function="page" table="sys_domain" method="get,post" >
+            </api>
             <api name="add_user" desc="添加用户" method="post,get,put">
                 <param name="login_id" type="string" desc="登录ID"/>
                 <param name="password" type="string" desc="密码"/>
@@ -161,6 +165,27 @@
                     <failure ref="$sys_return"></failure>
                 </return>
             </api>
+            <api name="add_org" desc="添加组织" method="post,get,put">
+                <param name="" ref="$sys_org" type="string" desc="组织"/>
+                <return>
+                    <success ref="$sys_return"></success>
+                    <failure ref="$sys_return"></failure>
+                </return>
+            </api>
+            <api name="del_org" desc="删除组织" method="post,get,put">
+                <param name="id"  type="string" desc="组织ID"/>
+                <return>
+                    <success ref="$sys_return"></success>
+                    <failure ref="$sys_return"></failure>
+                </return>
+            </api>
+            <api name="update_org" desc="更新组织" method="post,get,put">
+                <param name="" ref="$sys_org" type="string" desc="组织"/>
+                <return>
+                    <success ref="$sys_return"></success>
+                    <failure ref="$sys_return"></failure>
+                </return>
+            </api>
         </controller>
         <controller name="api" desc="api接口">
             <api name="api_doc" method="get" desc="api文档">
@@ -290,6 +315,7 @@
                 </auto>
             </column>
             <column isNull="true" name="parent" caption="上级组织" type="string" size="36" dbtype="varchar(36)" />
+            <column isNull="true" name="inheritance" caption="继承关系" type="string" size="500" dbtype="varchar(500)"/>
             <column isNull="false" name="name" caption="名称" type="string" size="36" dbtype="varchar(36)"/>
             <column isNull="false" name="full_name" caption="全名" type="string" size="36" dbtype="varchar(36)"/>
             <column isNull="false" name="leader" caption="领导人" type="string" size="36" dbtype="varchar(36)"/>

+ 6 - 2
models/LoginReturnInfo_gen.go

@@ -24,10 +24,14 @@ type LoginReturnInfo struct {
 	Email string `json:"email"`
 	//组织ID
 	OrgId string `json:"org_id"`
+	//性别 0:女    1:男 
+	Gender int32 `json:"gender"`
 	//用户类型
 	Type int32 `json:"type"`
 	//状态 0:禁用   1:正常
 	Status int32 `json:"status"`
+	//头像
+	Avatar string `json:"avatar"`
 	//域
 	Domain string `json:"domain"`
 	//创建人
@@ -37,8 +41,8 @@ type LoginReturnInfo struct {
 	//最后更新人
 	LastUpdateBy string `json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate time.Time `json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime int64 `json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag int32 `json:"del_flag"`
 
 	//token

+ 1 - 1
models/SysAttachment_gen.go

@@ -21,7 +21,7 @@ type SysAttachment struct {
 	CreateBy   string    `xorm:"'create_by' varchar(36) notnull "json:"create_by"`
 	//创建时间
 	CreateTime   time.Time    `xorm:"'create_time' notnull "json:"create_time"`
-	//是否删除 0:删除   1:正常
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysDomain_gen.go

@@ -34,8 +34,8 @@ type SysDomain struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysMenuTree_gen.go

@@ -39,8 +39,8 @@ type SysMenuTree struct {
 	//最后更新人
 	LastUpdateBy string `json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate time.Time `json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime int64 `json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag int32 `json:"del_flag"`
 
 	//子列表

+ 2 - 2
models/SysMenu_gen.go

@@ -36,8 +36,8 @@ type SysMenu struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 4 - 2
models/SysOrgTree_gen.go

@@ -12,6 +12,8 @@ type SysOrgTree struct {
 	Id string `json:"id"`
 	//上级组织
 	Parent string `json:"parent"`
+	//继承关系
+	Inheritance string `json:"inheritance"`
 	//名称
 	Name string `json:"name"`
 	//全名
@@ -33,8 +35,8 @@ type SysOrgTree struct {
 	//最后更新人
 	LastUpdateBy string `json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate time.Time `json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime int64 `json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag int32 `json:"del_flag"`
 
 	//子列表

+ 4 - 2
models/SysOrg_gen.go

@@ -9,6 +9,8 @@ type SysOrg struct {
 	Id   string    `xorm:"'id' varchar(36) pk notnull "json:"id"`
 	//上级组织
 	Parent   string    `xorm:"'parent' varchar(36) null "json:"parent"`
+	//继承关系
+	Inheritance   string    `xorm:"'inheritance' varchar(500) null "json:"inheritance"`
 	//名称
 	Name   string    `xorm:"'name' varchar(36) notnull "json:"name"`
 	//全名
@@ -30,8 +32,8 @@ type SysOrg struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysPermission_gen.go

@@ -18,8 +18,8 @@ type SysPermission struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysRoleMenu_gen.go

@@ -20,8 +20,8 @@ type SysRoleMenu struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysRolePermission_gen.go

@@ -20,8 +20,8 @@ type SysRolePermission struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysRole_gen.go

@@ -24,8 +24,8 @@ type SysRole struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 2 - 2
models/SysUserRole_gen.go

@@ -20,8 +20,8 @@ type SysUserRole struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 6 - 2
models/SysUser_gen.go

@@ -21,10 +21,14 @@ type SysUser struct {
 	Email   string    `xorm:"'email' varchar(50) notnull "json:"email"`
 	//组织ID
 	OrgId   string    `xorm:"'org_id' varchar(36) notnull "json:"org_id"`
+	//性别 0:女    1:男 
+	Gender   int32    `xorm:"'gender' notnull "json:"gender"`
 	//用户类型
 	Type   int32    `xorm:"'type' notnull "json:"type"`
 	//状态 0:禁用   1:正常
 	Status   int32    `xorm:"'status' notnull "json:"status"`
+	//头像
+	Avatar   string    `xorm:"'avatar' varchar(255) notnull "json:"avatar"`
 	//域
 	Domain   string    `xorm:"'domain' varchar(50) notnull "json:"domain"`
 	//创建人
@@ -34,8 +38,8 @@ type SysUser struct {
 	//最后更新人
 	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate   time.Time    `xorm:"'last_update_date' notnull "json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
 
 }

+ 6 - 2
models/UserInfo_gen.go

@@ -24,10 +24,14 @@ type UserInfo struct {
 	Email string `json:"email"`
 	//组织ID
 	OrgId string `json:"org_id"`
+	//性别 0:女    1:男 
+	Gender int32 `json:"gender"`
 	//用户类型
 	Type int32 `json:"type"`
 	//状态 0:禁用   1:正常
 	Status int32 `json:"status"`
+	//头像
+	Avatar string `json:"avatar"`
 	//域
 	Domain string `json:"domain"`
 	//创建人
@@ -37,8 +41,8 @@ type UserInfo struct {
 	//最后更新人
 	LastUpdateBy string `json:"last_update_by"`
 	//最后更新时间
-	LastUpdateDate time.Time `json:"last_update_date"`
-	//是否删除 0:删除   1:正常
+	LastUpdateTime int64 `json:"last_update_time"`
+	//是否删除 1:删除   0:正常
 	DelFlag int32 `json:"del_flag"`
 
 	//部门名称

+ 15 - 0
routers/system.go

@@ -32,6 +32,9 @@ func registerSystemRouter(e *engine.ApiEngine){
 	v1.GET("/get_menu_tree",ctrler.GetMenuTree)
 	v1.POST("/get_menu_tree",ctrler.GetMenuTree)
 
+	v1.GET("/get_domain_tree",ctrler.GetDomainTree)
+	v1.POST("/get_domain_tree",ctrler.GetDomainTree)
+
 	v1.GET("/find_org_page",ctrler.FindOrgPage)
 	v1.POST("/find_org_page",ctrler.FindOrgPage)
 
@@ -41,6 +44,9 @@ func registerSystemRouter(e *engine.ApiEngine){
 	v1.GET("/find_menu_page",ctrler.FindMenuPage)
 	v1.POST("/find_menu_page",ctrler.FindMenuPage)
 
+	v1.GET("/find_domain_page",ctrler.FindDomainPage)
+	v1.POST("/find_domain_page",ctrler.FindDomainPage)
+
 	v1.GET("/add_user",ctrler.AddUser)
 	v1.POST("/add_user",ctrler.AddUser)
 
@@ -80,5 +86,14 @@ func registerSystemRouter(e *engine.ApiEngine){
 	v1.GET("/update_menu",ctrler.UpdateMenu)
 	v1.POST("/update_menu",ctrler.UpdateMenu)
 
+	v1.GET("/add_org",ctrler.AddOrg)
+	v1.POST("/add_org",ctrler.AddOrg)
+
+	v1.GET("/del_org",ctrler.DelOrg)
+	v1.POST("/del_org",ctrler.DelOrg)
+
+	v1.GET("/update_org",ctrler.UpdateOrg)
+	v1.POST("/update_org",ctrler.UpdateOrg)
+
 }
 

+ 5 - 5
sqlconfig/light-apiengine/sys_domain_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_domain">
         insert into sys_domain
-		(`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?name,?full_name,?contact_name,?contact_email,?contact_mobile,?data_source,?domain_url,?type,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?name,?full_name,?contact_name,?contact_email,?contact_mobile,?data_source,?domain_url,?type,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_domain">
         update sys_domain set
-		`name` = ?name,`full_name` = ?full_name,`contact_name` = ?contact_name,`contact_email` = ?contact_email,`contact_mobile` = ?contact_mobile,`data_source` = ?data_source,`domain_url` = ?domain_url,`type` = ?type,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`name` = ?name,`full_name` = ?full_name,`contact_name` = ?contact_name,`contact_email` = ?contact_email,`contact_mobile` = ?contact_mobile,`data_source` = ?data_source,`domain_url` = ?domain_url,`type` = ?type,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_domain">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_domain">
         select 
-			`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_domain
 		where id = ?id
     </sql>
     <sql id="selectall_sys_domain">
         select 
-			`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`full_name`,`contact_name`,`contact_email`,`contact_mobile`,`data_source`,`domain_url`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_domain
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_menu_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_menu">
         insert into sys_menu
-		(`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?name,?code,?parent,?inheritance,?url,?component,?perms,?type,?icon,?order_num,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?name,?code,?parent,?inheritance,?url,?component,?perms,?type,?icon,?order_num,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_menu">
         update sys_menu set
-		`name` = ?name,`code` = ?code,`parent` = ?parent,`inheritance` = ?inheritance,`url` = ?url,`component` = ?component,`perms` = ?perms,`type` = ?type,`icon` = ?icon,`order_num` = ?order_num,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`name` = ?name,`code` = ?code,`parent` = ?parent,`inheritance` = ?inheritance,`url` = ?url,`component` = ?component,`perms` = ?perms,`type` = ?type,`icon` = ?icon,`order_num` = ?order_num,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_menu">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_menu">
         select 
-			`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_menu
 		where id = ?id
     </sql>
     <sql id="selectall_sys_menu">
         select 
-			`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`code`,`parent`,`inheritance`,`url`,`component`,`perms`,`type`,`icon`,`order_num`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_menu
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_org_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_org">
         insert into sys_org
-		(`id`,`parent`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`parent`,`inheritance`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?parent,?name,?full_name,?leader,?type,?order,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?parent,?inheritance,?name,?full_name,?leader,?type,?order,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_org">
         update sys_org set
-		`parent` = ?parent,`name` = ?name,`full_name` = ?full_name,`leader` = ?leader,`type` = ?type,`order` = ?order,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`parent` = ?parent,`inheritance` = ?inheritance,`name` = ?name,`full_name` = ?full_name,`leader` = ?leader,`type` = ?type,`order` = ?order,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_org">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_org">
         select 
-			`id`,`parent`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`parent`,`inheritance`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_org
 		where id = ?id
     </sql>
     <sql id="selectall_sys_org">
         select 
-			`id`,`parent`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`parent`,`inheritance`,`name`,`full_name`,`leader`,`type`,`order`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_org
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_permission_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_permission">
         insert into sys_permission
-		(`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?perms,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?perms,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_permission">
         update sys_permission set
-		`perms` = ?perms,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`perms` = ?perms,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_permission">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_permission">
         select 
-			`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_permission
 		where id = ?id
     </sql>
     <sql id="selectall_sys_permission">
         select 
-			`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`perms`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_permission
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_role_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_role">
         insert into sys_role
-		(`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?name,?code,?remark,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?name,?code,?remark,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_role">
         update sys_role set
-		`name` = ?name,`code` = ?code,`remark` = ?remark,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`name` = ?name,`code` = ?code,`remark` = ?remark,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_role">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_role">
         select 
-			`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role
 		where id = ?id
     </sql>
     <sql id="selectall_sys_role">
         select 
-			`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`name`,`code`,`remark`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_role_menu_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_role_menu">
         insert into sys_role_menu
-		(`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?role_id,?menu_id,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?role_id,?menu_id,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_role_menu">
         update sys_role_menu set
-		`role_id` = ?role_id,`menu_id` = ?menu_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`role_id` = ?role_id,`menu_id` = ?menu_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_role_menu">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_role_menu">
         select 
-			`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role_menu
 		where id = ?id
     </sql>
     <sql id="selectall_sys_role_menu">
         select 
-			`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`role_id`,`menu_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role_menu
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_role_permission_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_role_permission">
         insert into sys_role_permission
-		(`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?permission_id,?role_id,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?permission_id,?role_id,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_role_permission">
         update sys_role_permission set
-		`permission_id` = ?permission_id,`role_id` = ?role_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`permission_id` = ?permission_id,`role_id` = ?role_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_role_permission">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_role_permission">
         select 
-			`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role_permission
 		where id = ?id
     </sql>
     <sql id="selectall_sys_role_permission">
         select 
-			`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`permission_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_role_permission
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_user_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_user">
         insert into sys_user
-		(`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?login_id,?password,?name,?full_name,?mobile,?email,?org_id,?type,?status,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?login_id,?password,?name,?full_name,?mobile,?email,?org_id,?gender,?type,?status,?avatar,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_user">
         update sys_user set
-		`login_id` = ?login_id,`password` = ?password,`name` = ?name,`full_name` = ?full_name,`mobile` = ?mobile,`email` = ?email,`org_id` = ?org_id,`type` = ?type,`status` = ?status,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`login_id` = ?login_id,`password` = ?password,`name` = ?name,`full_name` = ?full_name,`mobile` = ?mobile,`email` = ?email,`org_id` = ?org_id,`gender` = ?gender,`type` = ?type,`status` = ?status,`avatar` = ?avatar,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_user">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_user">
         select 
-			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_user
 		where id = ?id
     </sql>
     <sql id="selectall_sys_user">
         select 
-			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`type`,`status`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_user
     </sql>
 </sqlMap>

+ 5 - 5
sqlconfig/light-apiengine/sys_user_role_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_user_role">
         insert into sys_user_role
-		(`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`)
+		(`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`)
 		values
-		(?id,?user_id,?role_id,?domain,?create_by,?create_time,?last_update_by,?last_update_date,?del_flag)
+		(?id,?user_id,?role_id,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag)
     </sql>
     <sql id="update_sys_user_role">
         update sys_user_role set
-		`user_id` = ?user_id,`role_id` = ?role_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_date` = ?last_update_date,`del_flag` = ?del_flag
+		`user_id` = ?user_id,`role_id` = ?role_id,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_user_role">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_user_role">
         select 
-			`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_user_role
 		where id = ?id
     </sql>
     <sql id="selectall_sys_user_role">
         select 
-			`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_date`,`del_flag`
+			`id`,`user_id`,`role_id`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`
         from sys_user_role
     </sql>
 </sqlMap>

+ 7 - 0
sqlconfig/system_controller/system_find_domain_page_count.tpl

@@ -0,0 +1,7 @@
+
+select
+    count(*) records
+from
+    sys_domain
+where
+	del_flag = 0

+ 8 - 0
sqlconfig/system_controller/system_find_domain_page_select.tpl

@@ -0,0 +1,8 @@
+
+select
+    *
+from
+    sys_domain
+where
+    del_flag = 0
+LIMIT {{.rows}} OFFSET {{.offset}}

+ 1 - 1
sqlconfig/system_controller/system_find_menu_page_count.tpl

@@ -6,7 +6,7 @@ from
 where
 	del_flag = 0
 {{if ne .name ""}}
-    and .name like '%{{.name}}%'
+    and name like '%{{.name}}%'
 {{end}}
 {{if ne .code ""}}
     and code like '%{{.code}}%'

+ 1 - 1
sqlconfig/system_controller/system_find_menu_page_select.tpl

@@ -6,7 +6,7 @@ from
 where
     del_flag = 0
 {{if ne .name ""}}
-    and .name like '%{{.name}}%'
+    and name like '%{{.name}}%'
 {{end}}
 {{if ne .code ""}}
     and code like '%{{.code}}%'

+ 9 - 0
sqlconfig/system_controller/system_find_org_page_count.tpl

@@ -5,3 +5,12 @@ from
     sys_org
 where
 	del_flag = 0
+{{if ne .name ""}}
+    and name like '%{{.name}}%'
+{{end}}
+{{if ne .code ""}}
+    and code like '%{{.code}}%'
+{{end}}
+{{if ne .cn_id ""}}
+    and inheritance like '%{{.cn_id}}%'
+{{end}}

+ 9 - 0
sqlconfig/system_controller/system_find_org_page_select.tpl

@@ -5,4 +5,13 @@ from
     sys_org
 where
     del_flag = 0
+{{if ne .name ""}}
+    and name like '%{{.name}}%'
+{{end}}
+{{if ne .code ""}}
+    and code like '%{{.code}}%'
+{{end}}
+{{if ne .cn_id ""}}
+    and inheritance like '%{{.cn_id}}%'
+{{end}}
 LIMIT {{.rows}} OFFSET {{.offset}}

+ 7 - 0
sqlconfig/system_controller/system_get_domain_tree.tpl

@@ -0,0 +1,7 @@
+
+select
+    *
+from
+    sys_domain
+where
+    del_flag = 0