Browse Source

feature(系统管理): 系统菜单、字典修改

ZZH-wl 2 years ago
parent
commit
a4b569b5b2

+ 1 - 0
opms_admin/.gitignore

@@ -28,3 +28,4 @@ admin
 
 .idea/
 /go.sum
+/opms_admin

+ 4 - 0
opms_admin/app/dao/internal/sys_menu.go

@@ -11,6 +11,7 @@ import (
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
 	"time"
+
 	"dashoo.cn/micro/app/model"
 )
 
@@ -28,6 +29,7 @@ type sysMenuColumns struct {
 	Id          string // 菜单ID
 	MenuName    string // 菜单名称
 	ParentId    string // 父菜单ID
+	Name        string // 路由名称
 	Path        string // 路由地址
 	Component   string // 组件路径
 	Query       string // 路由参数
@@ -62,6 +64,7 @@ var (
 			Id:          "id",
 			MenuName:    "menu_name",
 			ParentId:    "parent_id",
+			Name:        "name",
 			Path:        "path",
 			Component:   "component",
 			Query:       "query",
@@ -98,6 +101,7 @@ func NewSysMenuDao(tenant string) SysMenuDao {
 			Id:          "id",
 			MenuName:    "menu_name",
 			ParentId:    "parent_id",
+			Name:        "name",
 			Path:        "path",
 			Component:   "component",
 			Query:       "query",

+ 1 - 0
opms_admin/app/model/internal/sys_menu.go

@@ -13,6 +13,7 @@ type SysMenu struct {
 	Id          int         `orm:"id,primary"   json:"id"`          // 菜单ID
 	MenuName    string      `orm:"menu_name"    json:"menuName"`    // 菜单名称
 	ParentId    int         `orm:"parent_id"    json:"parentId"`    // 父菜单ID
+	Name        string      `orm:"name"         json:"name"`        // 路由名称
 	Path        string      `orm:"path"         json:"path"`        // 路由地址
 	Component   string      `orm:"component"    json:"component"`   // 组件路径
 	Query       string      `orm:"query"        json:"query"`       // 路由参数

+ 3 - 5
opms_admin/app/model/sys_dict_data.go

@@ -57,15 +57,13 @@ type DictDataAddReq struct {
 	DictSort  int    `p:"dictSort"  v:"integer#排序只能为整数"`
 	CssClass  string `p:"cssClass"`
 	ListClass string `p:"listClass"`
-	//IsDefault string `p:"isDefault" v:"required|in:10,20#系统默认不能为空|默认值只能为10或20"`
-	Status   string `p:"status"    v:"required|in:10,20#状态不能为空|状态只能为10或20"`
-	Remark   string `p:"remark"`
-	CreateBy uint64
+	IsDefault string `p:"isDefault" v:"required|in:10,20#系统默认不能为空|默认值只能为10或20"`
+	Status    string `p:"status"    v:"required|in:10,20#状态不能为空|状态只能为10或20"`
+	Remark    string `p:"remark"`
 }
 
 // EditDictDataReq 修改字典数据操作请求参数
 type EditDictDataReq struct {
 	DictCode int `p:"dictCode" v:"required|min:1#主键ID不能为空|主键ID不能小于1"`
-	UpdateBy uint64
 	DictDataAddReq
 }

+ 4 - 0
opms_admin/app/model/sys_menu.go

@@ -20,6 +20,7 @@ type SysMenuReq struct {
 	Id         int    `json:"id"`                             // ID
 	ParentId   int    `json:"parentId"`                       // 父菜单ID
 	MenuName   string `json:"menuName" v:"required#菜单名称不能为空"` // 菜单名称
+	Name       string `json:"name"`                           // 路由名称
 	Path       string `json:"path"`                           // 路由地址
 	Component  string `json:"component"`                      // 组件路径
 	Query      string `json:"query"`                          // 路由参数
@@ -58,6 +59,9 @@ type Meta struct {
 }
 
 func (m SysMenu) ConvName() string {
+	if m.Name != "" {
+		return m.Name
+	}
 	name := m.Path
 	if strings.Contains(m.Path, "/") {
 		nameList := strings.Split(m.Path, "/")

+ 4 - 0
opms_admin/app/service/sys_dict_type.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"dashoo.cn/micro/app/dao"
 	"dashoo.cn/micro/app/model"
+	"dashoo.cn/opms_libary/myerrors"
 	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/errors/gerror"
@@ -113,6 +114,9 @@ func (s *dictTypeService) UpdateById(req *model.SysDictTypeEditReq) error {
 		if err != nil {
 			return err
 		}
+		if dt == nil {
+			return myerrors.NewMsgError(nil, "字典不存在")
+		}
 		//修改字典类型
 		data := new(model.SysDictType)
 		if err := gconv.Struct(req, data); err != nil {

+ 1 - 0
opms_parent/.gitignore

@@ -28,3 +28,4 @@ admin
 
 .idea/
 gen.sh
+/opms_parent

+ 5 - 1
opms_parent/app/service/cust/cust_customer.go

@@ -360,6 +360,10 @@ func (s *CustomerService) CustAbstract(Id int64) (followInfo *model.Follow, err
 		g.Log().Error(err)
 		return
 	}
+	if followTime == nil {
+		err = myerrors.NewMsgError(nil, "获取客户信息不存在")
+		return
+	}
 	now := gtime.Now()
 	var hours float64
 	if followTime.FollowUpDate == nil {
@@ -416,7 +420,7 @@ func (s *CustomerService) ChangeCustBelong(Ids []int64, salesId int64, salesName
 	return
 }
 
-//CreateDynamics 创建客户动态信息
+// CreateDynamics 创建客户动态信息
 func (s *CustomerService) CreateDynamics(opnTpye string, content interface{}, ids ...int64) (err error) {
 	datas := make([]*model.CustCustomerDynamics, 0)
 	for _, id := range ids {

BIN
opms_parent/opms_parent