6
0
Quellcode durchsuchen

feature(报修): 报修管理

liuyaqi vor 3 Jahren
Ursprung
Commit
f7be814016

+ 36 - 0
dao/feedback/feedback.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/feedback/internal"
+)
+
+// feedbackDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type feedbackDao struct {
+	internal.FeedbackDao
+}
+
+var (
+	// Feedback is globally public accessible object for table feedback operations.
+	Feedback = feedbackDao{
+		internal.Feedback,
+	}
+)
+
+type FeedbackDao struct {
+	internal.FeedbackDao
+}
+
+func NewFeedbackDao(tenant string) *FeedbackDao {
+	dao := internal.NewFeedbackDao(tenant)
+	return &FeedbackDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/feedback/feedback_flow.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/feedback/internal"
+)
+
+// feedbackFlowDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type feedbackFlowDao struct {
+	internal.FeedbackFlowDao
+}
+
+var (
+	// FeedbackFlow is globally public accessible object for table feedback_flow operations.
+	FeedbackFlow = feedbackFlowDao{
+		internal.FeedbackFlow,
+	}
+)
+
+type FeedbackFlowDao struct {
+	internal.FeedbackFlowDao
+}
+
+func NewFeedbackFlowDao(tenant string) *FeedbackFlowDao {
+	dao := internal.NewFeedbackFlowDao(tenant)
+	return &FeedbackFlowDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
dao/feedback/feedback_result.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"lims_adapter/dao/feedback/internal"
+)
+
+// feedbackResultDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type feedbackResultDao struct {
+	internal.FeedbackResultDao
+}
+
+var (
+	// FeedbackResult is globally public accessible object for table feedback_result operations.
+	FeedbackResult = feedbackResultDao{
+		internal.FeedbackResult,
+	}
+)
+
+type FeedbackResultDao struct {
+	internal.FeedbackResultDao
+}
+
+func NewFeedbackResultDao(tenant string) *FeedbackResultDao {
+	dao := internal.NewFeedbackResultDao(tenant)
+	return &FeedbackResultDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 435 - 0
dao/feedback/internal/feedback.go

@@ -0,0 +1,435 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	model "lims_adapter/model/feedback"
+)
+
+// FeedbackDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type FeedbackDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns feedbackColumns
+}
+
+// FeedbackColumns defines and stores column names for table feedback.
+type feedbackColumns struct {
+	Id                 string // Id
+	Type               string // 反馈类型
+	Status             string // 反馈状态 1 未处理 2 已处理
+	Content            string // 反馈内容
+	CurrentProcessorId string // 反馈内容
+	CreatedById        string // 创建者 Id
+	CreatedByName      string // 创建者用户名
+	CreatedByMobile    string // 创建者联系方式
+	CreatedByEmail     string // 创建者邮箱
+	CreatedByDeptId    string // 创建者部门 Id
+	CreatedByDeptName  string // 创建者部门名称
+	CreatedAt          string // 创建时间
+	UpdatedAt          string // 更新时间
+	DeletedAt          string // 删除时间
+}
+
+var (
+	// Feedback is globally public accessible object for table feedback operations.
+	Feedback = FeedbackDao{
+		M:     g.DB("default").Model("feedback").Safe(),
+		DB:    g.DB("default"),
+		Table: "feedback",
+		Columns: feedbackColumns{
+			Id:                 "Id",
+			Type:               "Type",
+			Status:             "Status",
+			Content:            "Content",
+			CurrentProcessorId: "CurrentProcessorId",
+			CreatedById:        "CreatedById",
+			CreatedByName:      "CreatedByName",
+			CreatedByMobile:    "CreatedByMobile",
+			CreatedByEmail:     "CreatedByEmail",
+			CreatedByDeptId:    "CreatedByDeptId",
+			CreatedByDeptName:  "CreatedByDeptName",
+			CreatedAt:          "CreatedAt",
+			UpdatedAt:          "UpdatedAt",
+			DeletedAt:          "DeletedAt",
+		},
+	}
+)
+
+func NewFeedbackDao(tenant string) FeedbackDao {
+	var dao FeedbackDao
+	dao = FeedbackDao{
+		M:     g.DB(tenant).Model("feedback").Safe(),
+		DB:    g.DB(tenant),
+		Table: "feedback",
+		Columns: feedbackColumns{
+			Id:                 "Id",
+			Type:               "Type",
+			Status:             "Status",
+			Content:            "Content",
+			CurrentProcessorId: "CurrentProcessorId",
+			CreatedById:        "CreatedById",
+			CreatedByName:      "CreatedByName",
+			CreatedByMobile:    "CreatedByMobile",
+			CreatedByEmail:     "CreatedByEmail",
+			CreatedByDeptId:    "CreatedByDeptId",
+			CreatedByDeptName:  "CreatedByDeptName",
+			CreatedAt:          "CreatedAt",
+			UpdatedAt:          "UpdatedAt",
+			DeletedAt:          "DeletedAt",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *FeedbackDao) Ctx(ctx context.Context) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *FeedbackDao) As(as string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *FeedbackDao) TX(tx *gdb.TX) *FeedbackDao {
+	return &FeedbackDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *FeedbackDao) Master() *FeedbackDao {
+	return &FeedbackDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *FeedbackDao) Slave() *FeedbackDao {
+	return &FeedbackDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *FeedbackDao) Args(args ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackDao) LeftJoin(table ...string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackDao) RightJoin(table ...string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackDao) InnerJoin(table ...string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackDao) Fields(fieldNamesOrMapStruct ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *FeedbackDao) Option(option int) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *FeedbackDao) OmitEmpty() *FeedbackDao {
+	return &FeedbackDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *FeedbackDao) Filter() *FeedbackDao {
+	return &FeedbackDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *FeedbackDao) Where(where interface{}, args ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *FeedbackDao) WherePri(where interface{}, args ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *FeedbackDao) And(where interface{}, args ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *FeedbackDao) Or(where interface{}, args ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *FeedbackDao) Group(groupBy string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *FeedbackDao) Order(orderBy ...string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *FeedbackDao) Limit(limit ...int) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *FeedbackDao) Offset(offset int) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *FeedbackDao) Page(page, limit int) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *FeedbackDao) Batch(batch int) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *FeedbackDao) Cache(duration time.Duration, name ...string) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *FeedbackDao) Data(data ...interface{}) *FeedbackDao {
+	return &FeedbackDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.Feedback.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackDao) All(where ...interface{}) ([]*model.Feedback, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.Feedback
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.Feedback.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackDao) One(where ...interface{}) (*model.Feedback, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.Feedback
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *FeedbackDao) FindOne(where ...interface{}) (*model.Feedback, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.Feedback
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *FeedbackDao) FindAll(where ...interface{}) ([]*model.Feedback, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.Feedback
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *FeedbackDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *FeedbackDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *FeedbackDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *FeedbackDao) Chunk(limit int, callback func(entities []*model.Feedback, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.Feedback
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *FeedbackDao) LockUpdate() *FeedbackDao {
+	return &FeedbackDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *FeedbackDao) LockShared() *FeedbackDao {
+	return &FeedbackDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *FeedbackDao) Unscoped() *FeedbackDao {
+	return &FeedbackDao{M: d.M.Unscoped()}
+}

+ 423 - 0
dao/feedback/internal/feedback_flow.go

@@ -0,0 +1,423 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	model "lims_adapter/model/feedback"
+)
+
+// FeedbackFlowDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type FeedbackFlowDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns feedbackFlowColumns
+}
+
+// FeedbackFlowColumns defines and stores column names for table feedback_flow.
+type feedbackFlowColumns struct {
+	Id            string // Id
+	FeebackId     string // 反馈Id
+	Type          string // 流程节点 1 发起 2 转交 3 处理 4 重新激活
+	Status        string // 处理结果 1 成功
+	ProcessById   string // 处理人 Id
+	ProcessByName string // 处理人名称
+	Note          string // 备注
+	CreatedAt     string // 创建时间
+	UpdatedAt     string // 更新时间
+	DeletedAt     string // 删除时间
+}
+
+var (
+	// FeedbackFlow is globally public accessible object for table feedback_flow operations.
+	FeedbackFlow = FeedbackFlowDao{
+		M:     g.DB("default").Model("feedback_flow").Safe(),
+		DB:    g.DB("default"),
+		Table: "feedback_flow",
+		Columns: feedbackFlowColumns{
+			Id:            "Id",
+			FeebackId:     "FeebackId",
+			Type:          "Type",
+			Status:        "Status",
+			ProcessById:   "ProcessById",
+			ProcessByName: "ProcessByName",
+			Note:          "Note",
+			CreatedAt:     "CreatedAt",
+			UpdatedAt:     "UpdatedAt",
+			DeletedAt:     "DeletedAt",
+		},
+	}
+)
+
+func NewFeedbackFlowDao(tenant string) FeedbackFlowDao {
+	var dao FeedbackFlowDao
+	dao = FeedbackFlowDao{
+		M:     g.DB(tenant).Model("feedback_flow").Safe(),
+		DB:    g.DB(tenant),
+		Table: "feedback_flow",
+		Columns: feedbackFlowColumns{
+			Id:            "Id",
+			FeebackId:     "FeebackId",
+			Type:          "Type",
+			Status:        "Status",
+			ProcessById:   "ProcessById",
+			ProcessByName: "ProcessByName",
+			Note:          "Note",
+			CreatedAt:     "CreatedAt",
+			UpdatedAt:     "UpdatedAt",
+			DeletedAt:     "DeletedAt",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *FeedbackFlowDao) Ctx(ctx context.Context) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *FeedbackFlowDao) As(as string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *FeedbackFlowDao) TX(tx *gdb.TX) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *FeedbackFlowDao) Master() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *FeedbackFlowDao) Slave() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *FeedbackFlowDao) Args(args ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackFlowDao) LeftJoin(table ...string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackFlowDao) RightJoin(table ...string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackFlowDao) InnerJoin(table ...string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackFlowDao) Fields(fieldNamesOrMapStruct ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackFlowDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *FeedbackFlowDao) Option(option int) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *FeedbackFlowDao) OmitEmpty() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *FeedbackFlowDao) Filter() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *FeedbackFlowDao) Where(where interface{}, args ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *FeedbackFlowDao) WherePri(where interface{}, args ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *FeedbackFlowDao) And(where interface{}, args ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *FeedbackFlowDao) Or(where interface{}, args ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *FeedbackFlowDao) Group(groupBy string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *FeedbackFlowDao) Order(orderBy ...string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *FeedbackFlowDao) Limit(limit ...int) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *FeedbackFlowDao) Offset(offset int) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *FeedbackFlowDao) Page(page, limit int) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *FeedbackFlowDao) Batch(batch int) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *FeedbackFlowDao) Cache(duration time.Duration, name ...string) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *FeedbackFlowDao) Data(data ...interface{}) *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.FeedbackFlow.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackFlowDao) All(where ...interface{}) ([]*model.FeedbackFlow, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.FeedbackFlow
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.FeedbackFlow.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackFlowDao) One(where ...interface{}) (*model.FeedbackFlow, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.FeedbackFlow
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *FeedbackFlowDao) FindOne(where ...interface{}) (*model.FeedbackFlow, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.FeedbackFlow
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *FeedbackFlowDao) FindAll(where ...interface{}) ([]*model.FeedbackFlow, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.FeedbackFlow
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *FeedbackFlowDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *FeedbackFlowDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *FeedbackFlowDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *FeedbackFlowDao) Chunk(limit int, callback func(entities []*model.FeedbackFlow, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.FeedbackFlow
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *FeedbackFlowDao) LockUpdate() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *FeedbackFlowDao) LockShared() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *FeedbackFlowDao) Unscoped() *FeedbackFlowDao {
+	return &FeedbackFlowDao{M: d.M.Unscoped()}
+}

+ 420 - 0
dao/feedback/internal/feedback_result.go

@@ -0,0 +1,420 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	model "lims_adapter/model/feedback"
+)
+
+// FeedbackResultDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type FeedbackResultDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns feedbackResultColumns
+}
+
+// FeedbackResultColumns defines and stores column names for table feedback_result.
+type feedbackResultColumns struct {
+	Id            string // Id
+	FeebackId     string // 反馈Id
+	ProcessById   string // 处理人 Id
+	ProcessByName string // 处理人名称
+	ProcessType   string // 处理方式
+	ProcessNote   string // 处理描述
+	CreatedAt     string // 创建时间
+	UpdatedAt     string // 更新时间
+	DeletedAt     string // 删除时间
+}
+
+var (
+	// FeedbackResult is globally public accessible object for table feedback_result operations.
+	FeedbackResult = FeedbackResultDao{
+		M:     g.DB("default").Model("feedback_result").Safe(),
+		DB:    g.DB("default"),
+		Table: "feedback_result",
+		Columns: feedbackResultColumns{
+			Id:            "Id",
+			FeebackId:     "FeebackId",
+			ProcessById:   "ProcessById",
+			ProcessByName: "ProcessByName",
+			ProcessType:   "ProcessType",
+			ProcessNote:   "ProcessNote",
+			CreatedAt:     "CreatedAt",
+			UpdatedAt:     "UpdatedAt",
+			DeletedAt:     "DeletedAt",
+		},
+	}
+)
+
+func NewFeedbackResultDao(tenant string) FeedbackResultDao {
+	var dao FeedbackResultDao
+	dao = FeedbackResultDao{
+		M:     g.DB(tenant).Model("feedback_result").Safe(),
+		DB:    g.DB(tenant),
+		Table: "feedback_result",
+		Columns: feedbackResultColumns{
+			Id:            "Id",
+			FeebackId:     "FeebackId",
+			ProcessById:   "ProcessById",
+			ProcessByName: "ProcessByName",
+			ProcessType:   "ProcessType",
+			ProcessNote:   "ProcessNote",
+			CreatedAt:     "CreatedAt",
+			UpdatedAt:     "UpdatedAt",
+			DeletedAt:     "DeletedAt",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *FeedbackResultDao) Ctx(ctx context.Context) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *FeedbackResultDao) As(as string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *FeedbackResultDao) TX(tx *gdb.TX) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *FeedbackResultDao) Master() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *FeedbackResultDao) Slave() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *FeedbackResultDao) Args(args ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackResultDao) LeftJoin(table ...string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackResultDao) RightJoin(table ...string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *FeedbackResultDao) InnerJoin(table ...string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackResultDao) Fields(fieldNamesOrMapStruct ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *FeedbackResultDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *FeedbackResultDao) Option(option int) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *FeedbackResultDao) OmitEmpty() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *FeedbackResultDao) Filter() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *FeedbackResultDao) Where(where interface{}, args ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *FeedbackResultDao) WherePri(where interface{}, args ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *FeedbackResultDao) And(where interface{}, args ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *FeedbackResultDao) Or(where interface{}, args ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *FeedbackResultDao) Group(groupBy string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *FeedbackResultDao) Order(orderBy ...string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *FeedbackResultDao) Limit(limit ...int) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *FeedbackResultDao) Offset(offset int) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *FeedbackResultDao) Page(page, limit int) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *FeedbackResultDao) Batch(batch int) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *FeedbackResultDao) Cache(duration time.Duration, name ...string) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *FeedbackResultDao) Data(data ...interface{}) *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.FeedbackResult.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackResultDao) All(where ...interface{}) ([]*model.FeedbackResult, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.FeedbackResult
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.FeedbackResult.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *FeedbackResultDao) One(where ...interface{}) (*model.FeedbackResult, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.FeedbackResult
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *FeedbackResultDao) FindOne(where ...interface{}) (*model.FeedbackResult, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.FeedbackResult
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *FeedbackResultDao) FindAll(where ...interface{}) ([]*model.FeedbackResult, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.FeedbackResult
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *FeedbackResultDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *FeedbackResultDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *FeedbackResultDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *FeedbackResultDao) Chunk(limit int, callback func(entities []*model.FeedbackResult, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.FeedbackResult
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *FeedbackResultDao) LockUpdate() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *FeedbackResultDao) LockShared() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *FeedbackResultDao) Unscoped() *FeedbackResultDao {
+	return &FeedbackResultDao{M: d.M.Unscoped()}
+}

+ 63 - 0
model/feedback/feedback.go

@@ -0,0 +1,63 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"lims_adapter/model"
+	"lims_adapter/model/feedback/internal"
+
+	"github.com/gogf/gf/os/gtime"
+)
+
+// Feedback is the golang structure for table feedback.
+type Feedback internal.Feedback
+
+// Fill with you ideas below.
+type FeedbackListReq struct {
+	Page           *model.Page `json:"page"`
+	Status         int         `json:"status"`         // 反馈状态 1 未处理 2 已处理
+	CreatedByName  string      `json:"createdByName"`  // 创建者用户名
+	CreatedAtStart *gtime.Time `json:"createdAtStart"` // 创建时间
+	CreatedAtEnd   *gtime.Time `json:"createdAtEnd"`   // 创建时间
+}
+
+type FeedbackGetReq struct {
+	Id int `json:"id"` // 反馈Id
+}
+
+type FeedbackGetRsp struct {
+	Feedback
+	Flow   []*FeedbackFlow   `json:"flow"`
+	Result []*FeedbackResult `json:"result"`
+}
+
+type FeedbackAddReq struct {
+	Type    int    `json:"type" v:"required#请输入反馈类型"`    // 反馈类型
+	Content string `json:"content" v:"required#请输入反馈内容"` // 反馈内容
+	Mobile  string `json:"mobile" v:"required#请输入联系方式"`  // 联系方式
+	Email   string `json:"email" v:"required#请输入电子邮箱"`   // 邮箱
+}
+
+type FeedbackTransReq struct {
+	Id     int    `json:"id"`                         // 反馈Id
+	UserId int    `json:"userId" v:"required#请输入转交人"` // 转交人 Id
+	Note   string `json:"note" v:"required#请输入转交原因"`  // 转交原因
+}
+
+type FeedbackProcessReq struct {
+	Id   int    `json:"id"`                        // 反馈Id
+	Type int    `json:"type" v:"required#请输入处理方式"` // 处理方式
+	Note string `json:"note" v:"required#请输入处理描述"` // 处理描述
+}
+
+type FeedbackReactivateReq struct {
+	Id   int    `json:"id"`                          // 反馈Id
+	Note string `json:"note" v:"required#请输入重新激活描述"` // 重新激活描述
+}
+
+type FeedbackProcessorRsp struct {
+	Id       int    `json:"id"`
+	Realname string `json:"name"`
+}

+ 14 - 0
model/feedback/feedback_flow.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"lims_adapter/model/feedback/internal"
+)
+
+// FeedbackFlow is the golang structure for table feedback_flow.
+type FeedbackFlow internal.FeedbackFlow
+
+// Fill with you ideas below.

+ 14 - 0
model/feedback/feedback_result.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"lims_adapter/model/feedback/internal"
+)
+
+// FeedbackResult is the golang structure for table feedback_result.
+type FeedbackResult internal.FeedbackResult
+
+// Fill with you ideas below.

+ 27 - 0
model/feedback/internal/feedback.go

@@ -0,0 +1,27 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// Feedback is the golang structure for table feedback.
+type Feedback struct {
+	Id                 int         `orm:"Id,primary"         json:"id"`                 // Id
+	Type               int         `orm:"Type"               json:"type"`               // 反馈类型
+	Status             int         `orm:"Status"             json:"status"`             // 反馈状态 1 未处理 2 已处理
+	Content            string      `orm:"Content"            json:"content"`            // 反馈内容
+	CurrentProcessorId int         `orm:"CurrentProcessorId" json:"currentProcessorId"` // 反馈内容
+	CreatedById        int         `orm:"CreatedById"        json:"createdById"`        // 创建者 Id
+	CreatedByName      string      `orm:"CreatedByName"      json:"createdByName"`      // 创建者用户名
+	CreatedByMobile    string      `orm:"CreatedByMobile"    json:"createdByMobile"`    // 创建者联系方式
+	CreatedByEmail     string      `orm:"CreatedByEmail"     json:"createdByEmail"`     // 创建者邮箱
+	CreatedByDeptId    int         `orm:"CreatedByDeptId"    json:"createdByDeptId"`    // 创建者部门 Id
+	CreatedByDeptName  string      `orm:"CreatedByDeptName"  json:"createdByDeptName"`  // 创建者部门名称
+	CreatedAt          *gtime.Time `orm:"CreatedAt"          json:"createdAt"`          // 创建时间
+	UpdatedAt          *gtime.Time `orm:"UpdatedAt"          json:"updatedAt"`          // 更新时间
+	DeletedAt          *gtime.Time `orm:"DeletedAt"          json:"deletedAt"`          // 删除时间
+}

+ 23 - 0
model/feedback/internal/feedback_flow.go

@@ -0,0 +1,23 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// FeedbackFlow is the golang structure for table feedback_flow.
+type FeedbackFlow struct {
+	Id            int         `orm:"Id,primary"    json:"id"`            // Id
+	FeebackId     int         `orm:"FeebackId"     json:"feebackId"`     // 反馈Id
+	Type          int         `orm:"Type"          json:"type"`          // 流程节点 1 发起 2 转交 3 处理 4 重新激活
+	Status        int         `orm:"Status"        json:"status"`        // 处理结果 1 成功
+	ProcessById   int         `orm:"ProcessById"   json:"processById"`   // 处理人 Id
+	ProcessByName string      `orm:"ProcessByName" json:"processByName"` // 处理人名称
+	Note          string      `orm:"Note"          json:"note"`          // 备注
+	CreatedAt     *gtime.Time `orm:"CreatedAt"     json:"createdAt"`     // 创建时间
+	UpdatedAt     *gtime.Time `orm:"UpdatedAt"     json:"updatedAt"`     // 更新时间
+	DeletedAt     *gtime.Time `orm:"DeletedAt"     json:"deletedAt"`     // 删除时间
+}

+ 22 - 0
model/feedback/internal/feedback_result.go

@@ -0,0 +1,22 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// FeedbackResult is the golang structure for table feedback_result.
+type FeedbackResult struct {
+	Id            int         `orm:"Id,primary"    json:"id"`            // Id
+	FeebackId     int         `orm:"FeebackId"     json:"feebackId"`     // 反馈Id
+	ProcessById   int         `orm:"ProcessById"   json:"processById"`   // 处理人 Id
+	ProcessByName string      `orm:"ProcessByName" json:"processByName"` // 处理人名称
+	ProcessType   int         `orm:"ProcessType"   json:"processType"`   // 处理方式
+	ProcessNote   string      `orm:"ProcessNote"   json:"processNote"`   // 处理描述
+	CreatedAt     *gtime.Time `orm:"CreatedAt"     json:"createdAt"`     // 创建时间
+	UpdatedAt     *gtime.Time `orm:"UpdatedAt"     json:"updatedAt"`     // 更新时间
+	DeletedAt     *gtime.Time `orm:"DeletedAt"     json:"deletedAt"`     // 删除时间
+}

+ 327 - 0
service/feedback/feedback.go

@@ -0,0 +1,327 @@
+package feedback
+
+import (
+	"context"
+	"database/sql"
+	"fmt"
+	dao "lims_adapter/dao/feedback"
+	"lims_adapter/model"
+	feedback "lims_adapter/model/feedback"
+
+	"dashoo.cn/common_definition/admin/permission_def"
+	"dashoo.cn/micro_libary/micro_srv"
+	"dashoo.cn/micro_libary/myerrors"
+	"dashoo.cn/micro_libary/request"
+	"github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/util/gvalid"
+)
+
+const PermissionFeeedbackProcess = "feeedback:process"
+
+type FeedbackService struct {
+	Dao       *dao.FeedbackDao
+	DaoFlow   *dao.FeedbackFlowDao
+	DaoResult *dao.FeedbackResultDao
+	Tenant    string
+	userInfo  request.UserInfo
+}
+
+func NewFeedbackService(ctx context.Context) (*FeedbackService, error) {
+	tenant, err := micro_srv.GetTenant(ctx)
+	if err != nil {
+		return nil, fmt.Errorf("获取组合码异常:%s", err.Error())
+	}
+	// 获取用户信息
+	userInfo, err := micro_srv.GetUserInfo(ctx)
+	if err != nil {
+		return nil, fmt.Errorf("获取用户信息异常:%s", err.Error())
+	}
+	return &FeedbackService{
+		Dao:       dao.NewFeedbackDao(tenant),
+		DaoFlow:   dao.NewFeedbackFlowDao(tenant),
+		DaoResult: dao.NewFeedbackResultDao(tenant),
+		Tenant:    tenant,
+		userInfo:  userInfo,
+	}, nil
+}
+
+func (s FeedbackService) Get(ctx context.Context, req *feedback.FeedbackGetReq) (*feedback.FeedbackGetRsp, error) {
+	f, err := s.Dao.Where("Id = ?", req.Id).One()
+	if err != nil {
+		return nil, err
+	}
+	if f == nil {
+		return nil, myerrors.NewMsgError(nil, "反馈不存在")
+	}
+	flow, err := s.DaoFlow.Where("FeebackId = ?", f.Id).All()
+	if err != nil {
+		return nil, err
+	}
+	result, err := s.DaoResult.Where("FeebackId = ?", f.Id).All()
+	if err != nil {
+		return nil, err
+	}
+
+	return &feedback.FeedbackGetRsp{
+		Feedback: *f,
+		Flow:     flow,
+		Result:   result,
+	}, nil
+}
+
+func (s FeedbackService) List(ctx context.Context, req *feedback.FeedbackListReq) (int, []*feedback.Feedback, error) {
+	dao := &s.Dao.FeedbackDao
+	if req.Status != 0 {
+		dao = dao.Where("Status = ?", req.Status)
+	}
+	if req.CreatedByName != "" {
+		dao = dao.Where("CreatedByName LIKE ?", fmt.Sprintf("%%%s%%", req.CreatedByName))
+	}
+	if req.CreatedAtStart != nil {
+		dao = dao.Where("CreatedAt > ?", req.CreatedAtStart)
+	}
+	if req.CreatedAtEnd != nil {
+		dao = dao.Where("CreatedAt < ?", req.CreatedAtEnd)
+	}
+
+	allow, err := Allow(s.Tenant, s.userInfo.Uuid, PermissionFeeedbackProcess)
+	if err != nil {
+		return 0, nil, err
+	}
+	if !allow {
+		dao = dao.Where("CreatedById = ?", s.userInfo.Id)
+	}
+
+	total, err := dao.Count()
+	if err != nil {
+		return 0, nil, err
+	}
+
+	if req.Page != nil {
+		if req.Page.Current == 0 {
+			req.Page.Current = 1
+		}
+		if req.Page.Size == 0 {
+			req.Page.Size = 10
+		}
+		dao = dao.Page(req.Page.Current, req.Page.Size)
+	}
+
+	dao = dao.Order("CreatedAt", "desc")
+	ent, err := dao.All()
+	return total, ent, err
+}
+
+type organize struct {
+	Id       int
+	FullName string
+}
+
+func (s FeedbackService) Add(ctx context.Context, req *feedback.FeedbackAddReq) error {
+	validErr := gvalid.CheckStruct(ctx, req, nil)
+	if validErr != nil {
+		return myerrors.NewMsgError(nil, validErr.Current().Error())
+	}
+	dept := &organize{}
+	err := s.Dao.DB.Table("base_organize").Where("Id", s.userInfo.DeptId).Struct(dept)
+	if err == sql.ErrNoRows {
+		return myerrors.NewMsgError(err, fmt.Sprintf("部门不存在 %s", s.userInfo.DeptId))
+	}
+	if err != nil {
+		return err
+	}
+
+	id, err := s.Dao.InsertAndGetId(feedback.Feedback{
+		Type:               req.Type,
+		Status:             1,
+		Content:            req.Content,
+		CurrentProcessorId: 0,
+		CreatedById:        int(s.userInfo.Id),
+		CreatedByName:      s.userInfo.RealName,
+		CreatedByMobile:    req.Mobile,
+		CreatedByEmail:     req.Email,
+		CreatedByDeptId:    dept.Id,
+		CreatedByDeptName:  dept.FullName,
+		CreatedAt:          gtime.New(),
+		UpdatedAt:          gtime.New(),
+	})
+	if err != nil {
+		return err
+	}
+
+	_, err = s.DaoFlow.Insert(feedback.FeedbackFlow{
+		FeebackId:     int(id),
+		Type:          1,
+		Status:        1,
+		ProcessById:   int(s.userInfo.Id),
+		ProcessByName: s.userInfo.RealName,
+		Note:          "",
+		CreatedAt:     gtime.New(),
+		UpdatedAt:     gtime.New(),
+	})
+	return err
+}
+
+func (s FeedbackService) Trans(ctx context.Context, req *feedback.FeedbackTransReq) error {
+	validErr := gvalid.CheckStruct(ctx, req, nil)
+	if validErr != nil {
+		return myerrors.NewMsgError(nil, validErr.Current().Error())
+	}
+	r, err := s.Dao.DB.Table("base_user").Where("Id", req.UserId).One()
+	if err != nil {
+		return err
+	}
+	if r.IsEmpty() {
+		return myerrors.NewMsgError(nil, fmt.Sprintf("转交人不存在: %d", req.UserId))
+	}
+
+	f, err := s.Dao.Where("Id = ?", req.Id).One()
+	if err != nil {
+		return err
+	}
+	if f == nil {
+		return myerrors.NewMsgError(nil, fmt.Sprintf("反馈不存在: %d", req.Id))
+	}
+
+	_, err = s.Dao.Where("Id = ?", req.Id).Data("CurrentProcessorId", req.UserId).Update()
+	if err != nil {
+		return err
+	}
+	_, err = s.DaoFlow.Insert(feedback.FeedbackFlow{
+		FeebackId:     req.Id,
+		Type:          2,
+		Status:        1,
+		ProcessById:   int(s.userInfo.Id),
+		ProcessByName: s.userInfo.RealName,
+		Note:          req.Note,
+		CreatedAt:     gtime.New(),
+		UpdatedAt:     gtime.New(),
+	})
+	return err
+}
+
+func (s FeedbackService) Process(ctx context.Context, req *feedback.FeedbackProcessReq) error {
+	validErr := gvalid.CheckStruct(ctx, req, nil)
+	if validErr != nil {
+		return myerrors.NewMsgError(nil, validErr.Current().Error())
+	}
+	f, err := s.Dao.Where("Id = ?", req.Id).One()
+	if err != nil {
+		return err
+	}
+	if f == nil {
+		return myerrors.NewMsgError(nil, fmt.Sprintf("反馈不存在: %d", req.Id))
+	}
+
+	_, err = s.Dao.Where("Id = ?", req.Id).Data("Status", 2).Update()
+	if err != nil {
+		return err
+	}
+	_, err = s.DaoFlow.Insert(feedback.FeedbackFlow{
+		FeebackId:     req.Id,
+		Type:          3,
+		Status:        1,
+		ProcessById:   int(s.userInfo.Id),
+		ProcessByName: s.userInfo.RealName,
+		Note:          "",
+		CreatedAt:     gtime.New(),
+		UpdatedAt:     gtime.New(),
+	})
+	return err
+}
+
+func (s FeedbackService) Reactivate(ctx context.Context, req *feedback.FeedbackReactivateReq) error {
+	validErr := gvalid.CheckStruct(ctx, req, nil)
+	if validErr != nil {
+		return myerrors.NewMsgError(nil, validErr.Current().Error())
+	}
+	f, err := s.Dao.Where("Id = ?", req.Id).One()
+	if err != nil {
+		return err
+	}
+	if f == nil {
+		return myerrors.NewMsgError(nil, fmt.Sprintf("反馈不存在: %d", req.Id))
+	}
+
+	_, err = s.Dao.Where("Id = ?", req.Id).Data(
+		map[string]interface{}{
+			"Status":             1,
+			"CurrentProcessorId": 0,
+		}).Update()
+	if err != nil {
+		return err
+	}
+	_, err = s.DaoFlow.Insert(feedback.FeedbackFlow{
+		FeebackId:     req.Id,
+		Type:          4,
+		Status:        1,
+		ProcessById:   int(s.userInfo.Id),
+		ProcessByName: s.userInfo.RealName,
+		Note:          req.Note,
+		CreatedAt:     gtime.New(),
+		UpdatedAt:     gtime.New(),
+	})
+	return err
+}
+
+type id struct {
+	Id int
+}
+
+func (s FeedbackService) Processor(ctx context.Context, req *model.EmptyArgs) ([]feedback.FeedbackProcessorRsp, error) {
+	menu := &id{}
+	err := s.Dao.DB.Table("base_menu").
+		Where("Permission = ?", PermissionFeeedbackProcess).
+		Fields("Id").Struct(menu)
+	if err == sql.ErrNoRows {
+		return nil, myerrors.NewMsgError(err,
+			fmt.Sprintf("未配置权限: %s", PermissionFeeedbackProcess))
+	}
+	if err != nil {
+		return nil, err
+	}
+
+	roles := []id{}
+	err = s.Dao.DB.Table("base_role_menu").
+		Where("MenuIds LIKE ?", fmt.Sprintf("%%%d%%", menu.Id)).
+		Fields("Id").Structs(&roles)
+	if err == sql.ErrNoRows {
+		return nil, nil
+	}
+	if err != nil {
+		return nil, err
+	}
+	if len(roles) == 0 {
+		return nil, nil
+	}
+
+	rsp := []feedback.FeedbackProcessorRsp{}
+	dao := s.Dao.DB.Table("base_user_role a").LeftJoin("base_user b", "a.UserId=b.Id")
+	for _, r := range roles {
+		dao.Or("find_in_set(?, `a.RoleIds`)", r.Id)
+	}
+	err = dao.Fields("b.Id, b.Realname").Structs(&rsp)
+	if err == sql.ErrNoRows {
+		return nil, nil
+	}
+	return rsp, nil
+}
+
+func Allow(tenant, uuid, permission string) (bool, error) {
+	permissionSrv := micro_srv.InitMicroSrvClient("Permission", "micro_srv.admin")
+	defer permissionSrv.Close()
+	rsp := &permission_def.PermissionResp{}
+	err := permissionSrv.Call(context.TODO(), "GetAllPermissionByUser", &permission_def.UuidReq{
+		Tenant: tenant,
+		Uuid:   uuid,
+	}, rsp)
+	if err != nil {
+		return false, fmt.Errorf("获取权限失败 %s", err.Error())
+	}
+	for _, p := range rsp.UserPermissions {
+		if p == permission {
+			return true, nil
+		}
+	}
+	return false, nil
+}

+ 7 - 5
sql/feedback.sql

@@ -3,11 +3,12 @@ CREATE TABLE `feedback` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `Type` int NOT NULL COMMENT '反馈类型',
   `Status` int NOT NULL COMMENT '反馈状态 1 未处理 2 已处理',
-  `Content` int NOT NULL COMMENT '反馈内容',
+  `Content` text NOT NULL COMMENT '反馈内容',
+  `CurrentProcessorId` int NOT NULL COMMENT '反馈内容',
   `CreatedById` int NOT NULL COMMENT '创建者 Id',
   `CreatedByName` varchar(255) NOT NULL COMMENT '创建者用户名',
-  `CreatedByMobile` int NOT NULL COMMENT '创建者联系方式',
-  `CreatedByEmail` int NOT NULL COMMENT '创建者邮箱',
+  `CreatedByMobile` varchar(255) NOT NULL COMMENT '创建者联系方式',
+  `CreatedByEmail` varchar(255) NOT NULL COMMENT '创建者邮箱',
   `CreatedByDeptId` int NOT NULL COMMENT '创建者部门 Id',
   `CreatedByDeptName` varchar(255) NOT NULL COMMENT '创建者部门名称',
   `CreatedAt` datetime COMMENT '创建时间',
@@ -18,10 +19,11 @@ CREATE TABLE `feedback` (
 
 CREATE TABLE `feedback_flow` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
+  `FeebackId` int NOT NULL COMMENT '反馈Id',
   `Type` int NOT NULL COMMENT '流程节点 1 发起 2 转交 3 处理 4 重新激活',
   `Status` int NOT NULL COMMENT '处理结果 1 成功',
   `ProcessById` int NOT NULL COMMENT '处理人 Id',
-  `ProcessByName` int NOT NULL COMMENT '处理人名称',
+  `ProcessByName` varchar(255) NOT NULL COMMENT '处理人名称',
   `Note` text COMMENT '备注',
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
@@ -33,7 +35,7 @@ CREATE TABLE `feedback_result` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `FeebackId` int NOT NULL COMMENT '反馈Id',
   `ProcessById` int NOT NULL COMMENT '处理人 Id',
-  `ProcessByName` int NOT NULL COMMENT '处理人名称',
+  `ProcessByName` varchar(255) NOT NULL COMMENT '处理人名称',
   `ProcessType` int COMMENT '处理方式',
   `ProcessNote` text COMMENT '处理描述',
   `CreatedAt` datetime COMMENT '创建时间',

+ 7 - 5
sql/repair.sql

@@ -3,11 +3,12 @@ CREATE TABLE `repair` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `Type` int NOT NULL COMMENT '报修类型',
   `Status` int NOT NULL COMMENT '报修状态 1 未处理 2 已处理',
-  `Content` int NOT NULL COMMENT '报修内容',
+  `Content` text NOT NULL COMMENT '报修内容',
+  `CurrentProcessorId` int NOT NULL COMMENT '反馈内容',
   `CreatedById` int NOT NULL COMMENT '创建者 Id',
   `CreatedByName` varchar(255) NOT NULL COMMENT '创建者用户名',
-  `CreatedByMobile` int NOT NULL COMMENT '创建者联系方式',
-  `CreatedByEmail` int NOT NULL COMMENT '创建者邮箱',
+  `CreatedByMobile` varchar(255) NOT NULL COMMENT '创建者联系方式',
+  `CreatedByEmail` varchar(255) NOT NULL COMMENT '创建者邮箱',
   `CreatedByDeptId` int NOT NULL COMMENT '创建者部门 Id',
   `CreatedByDeptName` varchar(255) NOT NULL COMMENT '创建者部门名称',
   `CreatedAt` datetime COMMENT '创建时间',
@@ -18,10 +19,11 @@ CREATE TABLE `repair` (
 
 CREATE TABLE `repair_flow` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
+  `FeebackId` int NOT NULL COMMENT '报修Id',
   `Type` int NOT NULL COMMENT '流程节点 1 发起 2 转交 3 处理 4 重新激活',
   `Status` int NOT NULL COMMENT '处理结果 1 成功',
   `ProcessById` int NOT NULL COMMENT '处理人 Id',
-  `ProcessByName` int NOT NULL COMMENT '处理人名称',
+  `ProcessByName` varchar(255) NOT NULL COMMENT '处理人名称',
   `Note` text COMMENT '备注',
   `CreatedAt` datetime COMMENT '创建时间',
   `UpdatedAt` datetime COMMENT '更新时间',
@@ -33,7 +35,7 @@ CREATE TABLE `repair_result` (
   `Id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
   `FeebackId` int NOT NULL COMMENT '反馈Id',
   `ProcessById` int NOT NULL COMMENT '处理人 Id',
-  `ProcessByName` int NOT NULL COMMENT '处理人名称',
+  `ProcessByName` varchar(255) NOT NULL COMMENT '处理人名称',
   `ProcessType` int COMMENT '处理方式',
   `ProcessNote` text COMMENT '处理描述',
   `CreatedAt` datetime COMMENT '创建时间',