瀏覽代碼

feature:项目管理开发

ZZH-wl 3 年之前
父節點
當前提交
985d9b8205
共有 31 個文件被更改,包括 3230 次插入7 次删除
  1. 1 1
      opms_libary/micro_srv/micro_srv.go
  2. 3 0
      opms_libary/myerrors/error.go
  3. 515 0
      opms_parent/app/dao/proj/internal/proj_business.go
  4. 426 0
      opms_parent/app/dao/proj/internal/proj_business_contact.go
  5. 435 0
      opms_parent/app/dao/proj/internal/proj_business_dynamics.go
  6. 432 0
      opms_parent/app/dao/proj/internal/proj_business_file.go
  7. 447 0
      opms_parent/app/dao/proj/internal/proj_business_product.go
  8. 36 0
      opms_parent/app/dao/proj/proj_business.go
  9. 36 0
      opms_parent/app/dao/proj/proj_business_contact.go
  10. 36 0
      opms_parent/app/dao/proj/proj_business_dynamics.go
  11. 36 0
      opms_parent/app/dao/proj/proj_business_file.go
  12. 36 0
      opms_parent/app/dao/proj/proj_business_product.go
  13. 114 0
      opms_parent/app/handler/proj/business.go
  14. 31 0
      opms_parent/app/handler/proj/business_dynamics.go
  15. 65 0
      opms_parent/app/handler/proj/business_file.go
  16. 54 0
      opms_parent/app/model/proj/internal/proj_business.go
  17. 24 0
      opms_parent/app/model/proj/internal/proj_business_contact.go
  18. 27 0
      opms_parent/app/model/proj/internal/proj_business_dynamics.go
  19. 26 0
      opms_parent/app/model/proj/internal/proj_business_file.go
  20. 31 0
      opms_parent/app/model/proj/internal/proj_business_product.go
  21. 91 0
      opms_parent/app/model/proj/proj_business.go
  22. 14 0
      opms_parent/app/model/proj/proj_business_contact.go
  23. 14 0
      opms_parent/app/model/proj/proj_business_dynamics.go
  24. 22 0
      opms_parent/app/model/proj/proj_business_file.go
  25. 14 0
      opms_parent/app/model/proj/proj_business_product.go
  26. 4 0
      opms_parent/app/service/base.go
  27. 113 0
      opms_parent/app/service/proj/business.go
  28. 87 0
      opms_parent/app/service/proj/business_dynamics.go
  29. 49 0
      opms_parent/app/service/proj/business_file.go
  30. 5 2
      opms_parent/config/config.toml
  31. 6 4
      opms_parent/main.go

+ 1 - 1
opms_libary/micro_srv/micro_srv.go

@@ -300,7 +300,7 @@ func GetUserInfo(ctx context.Context) (request.UserInfo, error) {
 	reqMeta := ctx.Value(share.ReqMetaDataKey).(map[string]string)
 	userStr, ok := reqMeta["userInfo"]
 	if !ok {
-		return request.UserInfo{}, errors.New("不存在UserInfo数据")
+		return request.UserInfo{}, errors.New("用户信息获取失败,请重新登录。")
 	}
 
 	userInfo, err := getUserInfoDataString(userStr)

+ 3 - 0
opms_libary/myerrors/error.go

@@ -96,6 +96,9 @@ func CheckError(err error, msg ...string) (bool, error, int32, string) {
 		if len(msg) > 0 {
 			message = msg[0]
 		}
+		if _, ok := err.(*gerror.Error); ok && gerror.Code(err) == -1 && message == "" {
+			message = SysErr
+		}
 		if Code(err) == 210 { // 提示性异常,不返回Error
 			return false, nil, 210, err.Error()
 		} else if Code(err) == 900 { // 系统级异常

+ 515 - 0
opms_parent/app/dao/proj/internal/proj_business.go

@@ -0,0 +1,515 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	model "dashoo.cn/micro/app/model/proj"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+)
+
+// ProjBusinessDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type ProjBusinessDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns projBusinessColumns
+}
+
+// ProjBusinessColumns defines and stores column names for table proj_business.
+type projBusinessColumns struct {
+	Id               string // 主键
+	NboName          string // 项目名称
+	CustId           string // 关联客户
+	CustName         string // 客户名称
+	NboType          string // 项目类别(A类B类C类)
+	NboPhase         string // 项目阶段(暂不起用)
+	NboSource        string // 项目来源
+	NboBudget        string // 项目预算
+	ApproStatus      string // 审批状态(10待审批20审批中30审批通过40审批退回60审批拒绝)
+	ContactId        string // 关联联系人
+	ContactName      string // 联系人姓名
+	ContactPostion   string // 联系人岗位
+	ContactTelephone string // 联系人电话
+	MakerId          string // 关联决策人
+	MakerName        string // 决策人姓名
+	MakerPost        string // 决策人岗位
+	MakerTelephone   string // 决策人电话
+	SalesModel       string // 销售模式(10直销20经销30代理)
+	SaleId           string // 归属销售
+	SaleName         string // 销售姓名
+	DistributorId    string // 经销商/代理商ID
+	DistributorName  string // 经销商/代理商名称
+	FinalFollowTime  string // 最后跟进时间
+	NextFollowTime   string // 下次跟进时间
+	PlanPurchaseTime string // 计划采购时间
+	EstTransTime     string // 预计成交时间
+	EstTransPrice    string // 预计成交价格
+	RiskProfile      string // 风险情况
+	Difficulty       string // 困难点
+	Competitor       string // 竞争公司
+	Intervention     string // 介入情况
+	DeptId           string // 所属部门ID
+	DeptName         string // 所属部门
+	Remark           string // 备注
+	CreatedBy        string // 创建者
+	CreatedName      string // 创建人
+	CreatedTime      string // 创建时间
+	UpdatedBy        string // 更新者
+	UpdatedName      string // 更新人
+	UpdatedTime      string // 更新时间
+	DeletedTime      string // 删除时间
+}
+
+var (
+	// ProjBusiness is globally public accessible object for table proj_business operations.
+	ProjBusiness = ProjBusinessDao{
+		M:     g.DB("default").Model("proj_business").Safe(),
+		DB:    g.DB("default"),
+		Table: "proj_business",
+		Columns: projBusinessColumns{
+			Id:               "id",
+			NboName:          "nbo_name",
+			CustId:           "cust_id",
+			CustName:         "cust_name",
+			NboType:          "nbo_type",
+			NboPhase:         "nbo_phase",
+			NboSource:        "nbo_source",
+			NboBudget:        "nbo_budget",
+			ApproStatus:      "appro_status",
+			ContactId:        "contact_id",
+			ContactName:      "contact_name",
+			ContactPostion:   "contact_postion",
+			ContactTelephone: "contact_telephone",
+			MakerId:          "maker_id",
+			MakerName:        "maker_name",
+			MakerPost:        "maker_post",
+			MakerTelephone:   "maker_telephone",
+			SalesModel:       "sales_model",
+			SaleId:           "sale_id",
+			SaleName:         "sale_name",
+			DistributorId:    "distributor_id",
+			DistributorName:  "distributor_name",
+			FinalFollowTime:  "final_follow_time",
+			NextFollowTime:   "next_follow_time",
+			PlanPurchaseTime: "plan_purchase_time",
+			EstTransTime:     "est_trans_time",
+			EstTransPrice:    "est_trans_price",
+			RiskProfile:      "risk_profile",
+			Difficulty:       "difficulty",
+			Competitor:       "competitor",
+			Intervention:     "Intervention",
+			DeptId:           "dept_id",
+			DeptName:         "dept_name",
+			Remark:           "remark",
+			CreatedBy:        "created_by",
+			CreatedName:      "created_name",
+			CreatedTime:      "created_time",
+			UpdatedBy:        "updated_by",
+			UpdatedName:      "updated_name",
+			UpdatedTime:      "updated_time",
+			DeletedTime:      "deleted_time",
+		},
+	}
+)
+
+func NewProjBusinessDao(tenant string) ProjBusinessDao {
+	var dao ProjBusinessDao
+	dao = ProjBusinessDao{
+		M:     g.DB(tenant).Model("proj_business").Safe(),
+		DB:    g.DB(tenant),
+		Table: "proj_business",
+		Columns: projBusinessColumns{
+			Id:               "id",
+			NboName:          "nbo_name",
+			CustId:           "cust_id",
+			CustName:         "cust_name",
+			NboType:          "nbo_type",
+			NboPhase:         "nbo_phase",
+			NboSource:        "nbo_source",
+			NboBudget:        "nbo_budget",
+			ApproStatus:      "appro_status",
+			ContactId:        "contact_id",
+			ContactName:      "contact_name",
+			ContactPostion:   "contact_postion",
+			ContactTelephone: "contact_telephone",
+			MakerId:          "maker_id",
+			MakerName:        "maker_name",
+			MakerPost:        "maker_post",
+			MakerTelephone:   "maker_telephone",
+			SalesModel:       "sales_model",
+			SaleId:           "sale_id",
+			SaleName:         "sale_name",
+			DistributorId:    "distributor_id",
+			DistributorName:  "distributor_name",
+			FinalFollowTime:  "final_follow_time",
+			NextFollowTime:   "next_follow_time",
+			PlanPurchaseTime: "plan_purchase_time",
+			EstTransTime:     "est_trans_time",
+			EstTransPrice:    "est_trans_price",
+			RiskProfile:      "risk_profile",
+			Difficulty:       "difficulty",
+			Competitor:       "competitor",
+			Intervention:     "Intervention",
+			DeptId:           "dept_id",
+			DeptName:         "dept_name",
+			Remark:           "remark",
+			CreatedBy:        "created_by",
+			CreatedName:      "created_name",
+			CreatedTime:      "created_time",
+			UpdatedBy:        "updated_by",
+			UpdatedName:      "updated_name",
+			UpdatedTime:      "updated_time",
+			DeletedTime:      "deleted_time",
+		},
+	}
+	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 *ProjBusinessDao) Ctx(ctx context.Context) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *ProjBusinessDao) As(as string) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *ProjBusinessDao) TX(tx *gdb.TX) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *ProjBusinessDao) Master() *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Slave() *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *ProjBusinessDao) Args(args ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) LeftJoin(table ...string) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) RightJoin(table ...string) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) InnerJoin(table ...string) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *ProjBusinessDao) Option(option int) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) OmitEmpty() *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *ProjBusinessDao) Filter() *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Where(where interface{}, args ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *ProjBusinessDao) And(where interface{}, args ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *ProjBusinessDao) Or(where interface{}, args ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *ProjBusinessDao) Group(groupBy string) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *ProjBusinessDao) Order(orderBy ...string) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Limit(limit ...int) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Offset(offset int) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Page(page, limit int) *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *ProjBusinessDao) Batch(batch int) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Cache(duration time.Duration, name ...string) *ProjBusinessDao {
+	return &ProjBusinessDao{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 *ProjBusinessDao) Data(data ...interface{}) *ProjBusinessDao {
+	return &ProjBusinessDao{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.ProjBusiness.
+// 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 *ProjBusinessDao) All(where ...interface{}) ([]*model.ProjBusiness, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusiness
+	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.ProjBusiness.
+// 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 *ProjBusinessDao) One(where ...interface{}) (*model.ProjBusiness, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusiness
+	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 *ProjBusinessDao) FindOne(where ...interface{}) (*model.ProjBusiness, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusiness
+	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 *ProjBusinessDao) FindAll(where ...interface{}) ([]*model.ProjBusiness, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusiness
+	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 *ProjBusinessDao) 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 *ProjBusinessDao) 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 *ProjBusinessDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *ProjBusinessDao) Chunk(limit int, callback func(entities []*model.ProjBusiness, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.ProjBusiness
+		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 *ProjBusinessDao) LockUpdate() *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *ProjBusinessDao) LockShared() *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *ProjBusinessDao) Unscoped() *ProjBusinessDao {
+	return &ProjBusinessDao{M: d.M.Unscoped()}
+}

+ 426 - 0
opms_parent/app/dao/proj/internal/proj_business_contact.go

@@ -0,0 +1,426 @@
+// ==========================================================================
+// 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 "dashoo.cn/micro/app/model/proj"
+)
+
+// ProjBusinessContactDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type ProjBusinessContactDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns projBusinessContactColumns
+}
+
+// ProjBusinessContactColumns defines and stores column names for table proj_business_contact.
+type projBusinessContactColumns struct {
+	Id          string // 主键
+	BusId       string // 关联项目
+	ContactId   string // 联系人主键
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// ProjBusinessContact is globally public accessible object for table proj_business_contact operations.
+	ProjBusinessContact = ProjBusinessContactDao{
+		M:     g.DB("default").Model("proj_business_contact").Safe(),
+		DB:    g.DB("default"),
+		Table: "proj_business_contact",
+		Columns: projBusinessContactColumns{
+			Id:          "id",
+			BusId:       "bus_id",
+			ContactId:   "contact_id",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewProjBusinessContactDao(tenant string) ProjBusinessContactDao {
+	var dao ProjBusinessContactDao
+	dao = ProjBusinessContactDao{
+		M:     g.DB(tenant).Model("proj_business_contact").Safe(),
+		DB:    g.DB(tenant),
+		Table: "proj_business_contact",
+		Columns: projBusinessContactColumns{
+			Id:          "id",
+			BusId:       "bus_id",
+			ContactId:   "contact_id",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+	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 *ProjBusinessContactDao) Ctx(ctx context.Context) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *ProjBusinessContactDao) As(as string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *ProjBusinessContactDao) TX(tx *gdb.TX) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *ProjBusinessContactDao) Master() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Slave() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *ProjBusinessContactDao) Args(args ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) LeftJoin(table ...string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) RightJoin(table ...string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) InnerJoin(table ...string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *ProjBusinessContactDao) Option(option int) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) OmitEmpty() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *ProjBusinessContactDao) Filter() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Where(where interface{}, args ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *ProjBusinessContactDao) And(where interface{}, args ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *ProjBusinessContactDao) Or(where interface{}, args ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *ProjBusinessContactDao) Group(groupBy string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *ProjBusinessContactDao) Order(orderBy ...string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Limit(limit ...int) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Offset(offset int) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Page(page, limit int) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *ProjBusinessContactDao) Batch(batch int) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Cache(duration time.Duration, name ...string) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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 *ProjBusinessContactDao) Data(data ...interface{}) *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{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.ProjBusinessContact.
+// 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 *ProjBusinessContactDao) All(where ...interface{}) ([]*model.ProjBusinessContact, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessContact
+	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.ProjBusinessContact.
+// 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 *ProjBusinessContactDao) One(where ...interface{}) (*model.ProjBusinessContact, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessContact
+	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 *ProjBusinessContactDao) FindOne(where ...interface{}) (*model.ProjBusinessContact, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessContact
+	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 *ProjBusinessContactDao) FindAll(where ...interface{}) ([]*model.ProjBusinessContact, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessContact
+	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 *ProjBusinessContactDao) 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 *ProjBusinessContactDao) 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 *ProjBusinessContactDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *ProjBusinessContactDao) Chunk(limit int, callback func(entities []*model.ProjBusinessContact, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.ProjBusinessContact
+		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 *ProjBusinessContactDao) LockUpdate() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *ProjBusinessContactDao) LockShared() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *ProjBusinessContactDao) Unscoped() *ProjBusinessContactDao {
+	return &ProjBusinessContactDao{M: d.M.Unscoped()}
+}

+ 435 - 0
opms_parent/app/dao/proj/internal/proj_business_dynamics.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 "dashoo.cn/micro/app/model/proj"
+)
+
+// ProjBusinessDynamicsDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type ProjBusinessDynamicsDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns projBusinessDynamicsColumns
+}
+
+// ProjBusinessDynamicsColumns defines and stores column names for table proj_business_dynamics.
+type projBusinessDynamicsColumns struct {
+	Id          string // 主键
+	OpnPeopleId string // 操作人ID
+	OpnPeople   string // 操作人
+	OpnDate     string // 操作日期
+	OpnType     string // 操作类型
+	OpnContent  string // 操作内容
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// ProjBusinessDynamics is globally public accessible object for table proj_business_dynamics operations.
+	ProjBusinessDynamics = ProjBusinessDynamicsDao{
+		M:     g.DB("default").Model("proj_business_dynamics").Safe(),
+		DB:    g.DB("default"),
+		Table: "proj_business_dynamics",
+		Columns: projBusinessDynamicsColumns{
+			Id:          "id",
+			OpnPeopleId: "opn_people_id",
+			OpnPeople:   "opn_people",
+			OpnDate:     "opn_date",
+			OpnType:     "opn_type",
+			OpnContent:  "opn_content",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewProjBusinessDynamicsDao(tenant string) ProjBusinessDynamicsDao {
+	var dao ProjBusinessDynamicsDao
+	dao = ProjBusinessDynamicsDao{
+		M:     g.DB(tenant).Model("proj_business_dynamics").Safe(),
+		DB:    g.DB(tenant),
+		Table: "proj_business_dynamics",
+		Columns: projBusinessDynamicsColumns{
+			Id:          "id",
+			OpnPeopleId: "opn_people_id",
+			OpnPeople:   "opn_people",
+			OpnDate:     "opn_date",
+			OpnType:     "opn_type",
+			OpnContent:  "opn_content",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+	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 *ProjBusinessDynamicsDao) Ctx(ctx context.Context) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *ProjBusinessDynamicsDao) As(as string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *ProjBusinessDynamicsDao) TX(tx *gdb.TX) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *ProjBusinessDynamicsDao) Master() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Slave() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *ProjBusinessDynamicsDao) Args(args ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) LeftJoin(table ...string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) RightJoin(table ...string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) InnerJoin(table ...string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *ProjBusinessDynamicsDao) Option(option int) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) OmitEmpty() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *ProjBusinessDynamicsDao) Filter() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Where(where interface{}, args ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *ProjBusinessDynamicsDao) And(where interface{}, args ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *ProjBusinessDynamicsDao) Or(where interface{}, args ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *ProjBusinessDynamicsDao) Group(groupBy string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *ProjBusinessDynamicsDao) Order(orderBy ...string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Limit(limit ...int) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Offset(offset int) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Page(page, limit int) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *ProjBusinessDynamicsDao) Batch(batch int) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Cache(duration time.Duration, name ...string) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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 *ProjBusinessDynamicsDao) Data(data ...interface{}) *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{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.ProjBusinessDynamics.
+// 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 *ProjBusinessDynamicsDao) All(where ...interface{}) ([]*model.ProjBusinessDynamics, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessDynamics
+	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.ProjBusinessDynamics.
+// 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 *ProjBusinessDynamicsDao) One(where ...interface{}) (*model.ProjBusinessDynamics, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessDynamics
+	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 *ProjBusinessDynamicsDao) FindOne(where ...interface{}) (*model.ProjBusinessDynamics, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessDynamics
+	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 *ProjBusinessDynamicsDao) FindAll(where ...interface{}) ([]*model.ProjBusinessDynamics, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessDynamics
+	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 *ProjBusinessDynamicsDao) 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 *ProjBusinessDynamicsDao) 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 *ProjBusinessDynamicsDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *ProjBusinessDynamicsDao) Chunk(limit int, callback func(entities []*model.ProjBusinessDynamics, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.ProjBusinessDynamics
+		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 *ProjBusinessDynamicsDao) LockUpdate() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *ProjBusinessDynamicsDao) LockShared() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *ProjBusinessDynamicsDao) Unscoped() *ProjBusinessDynamicsDao {
+	return &ProjBusinessDynamicsDao{M: d.M.Unscoped()}
+}

+ 432 - 0
opms_parent/app/dao/proj/internal/proj_business_file.go

@@ -0,0 +1,432 @@
+// ==========================================================================
+// 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 "dashoo.cn/micro/app/model/proj"
+)
+
+// ProjBusinessFileDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type ProjBusinessFileDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns projBusinessFileColumns
+}
+
+// ProjBusinessFileColumns defines and stores column names for table proj_business_file.
+type projBusinessFileColumns struct {
+	Id          string // 主键
+	BusId       string // 关联项目
+	FileName    string // 附件名称
+	FileSize    string // 附件大小
+	FileSource  string // 来源
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// ProjBusinessFile is globally public accessible object for table proj_business_file operations.
+	ProjBusinessFile = ProjBusinessFileDao{
+		M:     g.DB("default").Model("proj_business_file").Safe(),
+		DB:    g.DB("default"),
+		Table: "proj_business_file",
+		Columns: projBusinessFileColumns{
+			Id:          "id",
+			BusId:       "bus_id",
+			FileName:    "file_name",
+			FileSize:    "file_size",
+			FileSource:  "file_source",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewProjBusinessFileDao(tenant string) ProjBusinessFileDao {
+	var dao ProjBusinessFileDao
+	dao = ProjBusinessFileDao{
+		M:     g.DB(tenant).Model("proj_business_file").Safe(),
+		DB:    g.DB(tenant),
+		Table: "proj_business_file",
+		Columns: projBusinessFileColumns{
+			Id:          "id",
+			BusId:       "bus_id",
+			FileName:    "file_name",
+			FileSize:    "file_size",
+			FileSource:  "file_source",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+	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 *ProjBusinessFileDao) Ctx(ctx context.Context) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *ProjBusinessFileDao) As(as string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *ProjBusinessFileDao) TX(tx *gdb.TX) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *ProjBusinessFileDao) Master() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Slave() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *ProjBusinessFileDao) Args(args ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) LeftJoin(table ...string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) RightJoin(table ...string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) InnerJoin(table ...string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *ProjBusinessFileDao) Option(option int) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) OmitEmpty() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *ProjBusinessFileDao) Filter() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Where(where interface{}, args ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *ProjBusinessFileDao) And(where interface{}, args ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *ProjBusinessFileDao) Or(where interface{}, args ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *ProjBusinessFileDao) Group(groupBy string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *ProjBusinessFileDao) Order(orderBy ...string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Limit(limit ...int) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Offset(offset int) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Page(page, limit int) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *ProjBusinessFileDao) Batch(batch int) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Cache(duration time.Duration, name ...string) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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 *ProjBusinessFileDao) Data(data ...interface{}) *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{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.ProjBusinessFile.
+// 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 *ProjBusinessFileDao) All(where ...interface{}) ([]*model.ProjBusinessFile, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessFile
+	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.ProjBusinessFile.
+// 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 *ProjBusinessFileDao) One(where ...interface{}) (*model.ProjBusinessFile, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessFile
+	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 *ProjBusinessFileDao) FindOne(where ...interface{}) (*model.ProjBusinessFile, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessFile
+	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 *ProjBusinessFileDao) FindAll(where ...interface{}) ([]*model.ProjBusinessFile, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessFile
+	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 *ProjBusinessFileDao) 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 *ProjBusinessFileDao) 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 *ProjBusinessFileDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *ProjBusinessFileDao) Chunk(limit int, callback func(entities []*model.ProjBusinessFile, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.ProjBusinessFile
+		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 *ProjBusinessFileDao) LockUpdate() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *ProjBusinessFileDao) LockShared() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *ProjBusinessFileDao) Unscoped() *ProjBusinessFileDao {
+	return &ProjBusinessFileDao{M: d.M.Unscoped()}
+}

+ 447 - 0
opms_parent/app/dao/proj/internal/proj_business_product.go

@@ -0,0 +1,447 @@
+// ==========================================================================
+// 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 "dashoo.cn/micro/app/model/proj"
+)
+
+// ProjBusinessProductDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type ProjBusinessProductDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns projBusinessProductColumns
+}
+
+// ProjBusinessProductColumns defines and stores column names for table proj_business_product.
+type projBusinessProductColumns struct {
+	Id            string // 主键
+	BusId         string // 关联项目
+	Name          string // 产品名称
+	Category      string // 产品类别
+	Unit          string // 单位
+	OriginalPrice string // 原价
+	SellingPrice  string // 售价
+	Quantity      string // 数量
+	Discount      string // 折扣
+	TotalPrice    string // 总价
+	Remark        string // 备注
+	CreatedBy     string // 创建者
+	CreatedName   string // 创建人
+	CreatedTime   string // 创建时间
+	UpdatedBy     string // 更新者
+	UpdatedName   string // 更新人
+	UpdatedTime   string // 更新时间
+	DeletedTime   string // 删除时间
+}
+
+var (
+	// ProjBusinessProduct is globally public accessible object for table proj_business_product operations.
+	ProjBusinessProduct = ProjBusinessProductDao{
+		M:     g.DB("default").Model("proj_business_product").Safe(),
+		DB:    g.DB("default"),
+		Table: "proj_business_product",
+		Columns: projBusinessProductColumns{
+			Id:            "id",
+			BusId:         "bus_id",
+			Name:          "name",
+			Category:      "category",
+			Unit:          "unit",
+			OriginalPrice: "original_price",
+			SellingPrice:  "selling_price",
+			Quantity:      "quantity",
+			Discount:      "discount",
+			TotalPrice:    "total_price",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+)
+
+func NewProjBusinessProductDao(tenant string) ProjBusinessProductDao {
+	var dao ProjBusinessProductDao
+	dao = ProjBusinessProductDao{
+		M:     g.DB(tenant).Model("proj_business_product").Safe(),
+		DB:    g.DB(tenant),
+		Table: "proj_business_product",
+		Columns: projBusinessProductColumns{
+			Id:            "id",
+			BusId:         "bus_id",
+			Name:          "name",
+			Category:      "category",
+			Unit:          "unit",
+			OriginalPrice: "original_price",
+			SellingPrice:  "selling_price",
+			Quantity:      "quantity",
+			Discount:      "discount",
+			TotalPrice:    "total_price",
+			Remark:        "remark",
+			CreatedBy:     "created_by",
+			CreatedName:   "created_name",
+			CreatedTime:   "created_time",
+			UpdatedBy:     "updated_by",
+			UpdatedName:   "updated_name",
+			UpdatedTime:   "updated_time",
+			DeletedTime:   "deleted_time",
+		},
+	}
+	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 *ProjBusinessProductDao) Ctx(ctx context.Context) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *ProjBusinessProductDao) As(as string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *ProjBusinessProductDao) TX(tx *gdb.TX) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *ProjBusinessProductDao) Master() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Slave() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *ProjBusinessProductDao) Args(args ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) LeftJoin(table ...string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) RightJoin(table ...string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) InnerJoin(table ...string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Fields(fieldNamesOrMapStruct ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *ProjBusinessProductDao) Option(option int) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) OmitEmpty() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *ProjBusinessProductDao) Filter() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Where(where interface{}, args ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) WherePri(where interface{}, args ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *ProjBusinessProductDao) And(where interface{}, args ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *ProjBusinessProductDao) Or(where interface{}, args ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *ProjBusinessProductDao) Group(groupBy string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *ProjBusinessProductDao) Order(orderBy ...string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Limit(limit ...int) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Offset(offset int) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Page(page, limit int) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *ProjBusinessProductDao) Batch(batch int) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Cache(duration time.Duration, name ...string) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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 *ProjBusinessProductDao) Data(data ...interface{}) *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{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.ProjBusinessProduct.
+// 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 *ProjBusinessProductDao) All(where ...interface{}) ([]*model.ProjBusinessProduct, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessProduct
+	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.ProjBusinessProduct.
+// 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 *ProjBusinessProductDao) One(where ...interface{}) (*model.ProjBusinessProduct, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessProduct
+	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 *ProjBusinessProductDao) FindOne(where ...interface{}) (*model.ProjBusinessProduct, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.ProjBusinessProduct
+	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 *ProjBusinessProductDao) FindAll(where ...interface{}) ([]*model.ProjBusinessProduct, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.ProjBusinessProduct
+	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 *ProjBusinessProductDao) 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 *ProjBusinessProductDao) 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 *ProjBusinessProductDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *ProjBusinessProductDao) Chunk(limit int, callback func(entities []*model.ProjBusinessProduct, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.ProjBusinessProduct
+		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 *ProjBusinessProductDao) LockUpdate() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *ProjBusinessProductDao) LockShared() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *ProjBusinessProductDao) Unscoped() *ProjBusinessProductDao {
+	return &ProjBusinessProductDao{M: d.M.Unscoped()}
+}

+ 36 - 0
opms_parent/app/dao/proj/proj_business.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/proj/internal"
+)
+
+// projBusinessDao 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 projBusinessDao struct {
+	internal.ProjBusinessDao
+}
+
+var (
+	// ProjBusiness is globally public accessible object for table proj_business operations.
+	ProjBusiness = projBusinessDao{
+		internal.ProjBusiness,
+	}
+)
+
+type ProjBusinessDao struct {
+	internal.ProjBusinessDao
+}
+
+func NewProjBusinessDao(tenant string) *ProjBusinessDao {
+	dao := internal.NewProjBusinessDao(tenant)
+	return &ProjBusinessDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/proj_business_contact.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/proj/internal"
+)
+
+// projBusinessContactDao 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 projBusinessContactDao struct {
+	internal.ProjBusinessContactDao
+}
+
+var (
+	// ProjBusinessContact is globally public accessible object for table proj_business_contact operations.
+	ProjBusinessContact = projBusinessContactDao{
+		internal.ProjBusinessContact,
+	}
+)
+
+type ProjBusinessContactDao struct {
+	internal.ProjBusinessContactDao
+}
+
+func NewProjBusinessContactDao(tenant string) *ProjBusinessContactDao {
+	dao := internal.NewProjBusinessContactDao(tenant)
+	return &ProjBusinessContactDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/proj_business_dynamics.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/proj/internal"
+)
+
+// projBusinessDynamicsDao 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 projBusinessDynamicsDao struct {
+	internal.ProjBusinessDynamicsDao
+}
+
+var (
+	// ProjBusinessDynamics is globally public accessible object for table proj_business_dynamics operations.
+	ProjBusinessDynamics = projBusinessDynamicsDao{
+		internal.ProjBusinessDynamics,
+	}
+)
+
+type ProjBusinessDynamicsDao struct {
+	internal.ProjBusinessDynamicsDao
+}
+
+func NewProjBusinessDynamicsDao(tenant string) *ProjBusinessDynamicsDao {
+	dao := internal.NewProjBusinessDynamicsDao(tenant)
+	return &ProjBusinessDynamicsDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/proj_business_file.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/proj/internal"
+)
+
+// projBusinessFileDao 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 projBusinessFileDao struct {
+	internal.ProjBusinessFileDao
+}
+
+var (
+	// ProjBusinessFile is globally public accessible object for table proj_business_file operations.
+	ProjBusinessFile = projBusinessFileDao{
+		internal.ProjBusinessFile,
+	}
+)
+
+type ProjBusinessFileDao struct {
+	internal.ProjBusinessFileDao
+}
+
+func NewProjBusinessFileDao(tenant string) *ProjBusinessFileDao {
+	dao := internal.NewProjBusinessFileDao(tenant)
+	return &ProjBusinessFileDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
opms_parent/app/dao/proj/proj_business_product.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/proj/internal"
+)
+
+// projBusinessProductDao 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 projBusinessProductDao struct {
+	internal.ProjBusinessProductDao
+}
+
+var (
+	// ProjBusinessProduct is globally public accessible object for table proj_business_product operations.
+	ProjBusinessProduct = projBusinessProductDao{
+		internal.ProjBusinessProduct,
+	}
+)
+
+type ProjBusinessProductDao struct {
+	internal.ProjBusinessProductDao
+}
+
+func NewProjBusinessProductDao(tenant string) *ProjBusinessProductDao {
+	dao := internal.NewProjBusinessProductDao(tenant)
+	return &ProjBusinessProductDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 114 - 0
opms_parent/app/handler/proj/business.go

@@ -0,0 +1,114 @@
+package base
+
+import (
+	"context"
+
+	"github.com/gogf/gf/errors/gerror"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gvalid"
+
+	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type BusinessHandler struct{}
+
+func (p *BusinessHandler) GetList(ctx context.Context, req *projModel.ProjBusinessSearchReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return err
+	}
+	g.Log().Info("搜索值", req)
+	total, list, err := businessService.GetList(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}
+
+func (p *BusinessHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if req.Id == 0 {
+		return gerror.New("参数有误!")
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	_, err = businessService.GetEntityById(req.Id)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessHandler) GetBusinessProduct(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if req.Id == 0 {
+		return gerror.New("参数有误!")
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	productList, err := businessService.GetBusinessProduct(req.Id)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = productList
+	return nil
+}
+
+func (p *BusinessHandler) Create(ctx context.Context, req *projModel.AddProjBusinessReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.Create(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessHandler) UpdateById(ctx context.Context, req *projModel.UpdateProjBusinessReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	err = businessService.UpdateById(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if len(req.Ids) == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	err = businessService.DeleteByIds(req.Ids)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 31 - 0
opms_parent/app/handler/proj/business_dynamics.go

@@ -0,0 +1,31 @@
+package base
+
+import (
+	"context"
+
+	"github.com/gogf/gf/frame/g"
+
+	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type BusinessDynamicsHandler struct{}
+
+// GetList 获取列表
+func (p *BusinessDynamicsHandler) GetList(ctx context.Context, req *projModel.ProjBusinessSearchReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewBusinessDynamicsService(ctx)
+	if err != nil {
+		return err
+	}
+	g.Log().Info("搜索值", req)
+	total, list, err := businessService.GetList(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}

+ 65 - 0
opms_parent/app/handler/proj/business_file.go

@@ -0,0 +1,65 @@
+package base
+
+import (
+	"context"
+	"dashoo.cn/common_definition/comm_def"
+	"dashoo.cn/opms_libary/myerrors"
+	"github.com/gogf/gf/errors/gerror"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gvalid"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type BusinessFileHandler struct{}
+
+// GetList 获取列表
+func (p *BusinessFileHandler) GetList(ctx context.Context, req *projModel.ProjBusinessSearchReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewBusinessFileService(ctx)
+	if err != nil {
+		return err
+	}
+	g.Log().Info("搜索值", req)
+	total, list, err := businessService.GetList()
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}
+
+// Create 添加产品信息
+func (p *BusinessFileHandler) Create(ctx context.Context, req *projModel.ProjBusinessFileReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	businessService, err := projSrv.NewBusinessFileService(ctx)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	err = businessService.Create(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessFileHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if len(req.Ids) == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	businessService, err := projSrv.NewBusinessFileService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	err = businessService.DeleteByIds(req.Ids)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	return err
+}

+ 54 - 0
opms_parent/app/model/proj/internal/proj_business.go

@@ -0,0 +1,54 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusiness is the golang structure for table proj_business.
+type ProjBusiness struct {
+	Id               int         `orm:"id,primary"         json:"id"`               // 主键
+	NboName          string      `orm:"nbo_name"           json:"nboName"`          // 项目名称
+	CustId           int         `orm:"cust_id"            json:"custId"`           // 关联客户
+	CustName         string      `orm:"cust_name"          json:"custName"`         // 客户名称
+	NboType          string      `orm:"nbo_type"           json:"nboType"`          // 项目类别(A类B类C类)
+	NboPhase         string      `orm:"nbo_phase"          json:"nboPhase"`         // 项目阶段(暂不起用)
+	NboSource        string      `orm:"nbo_source"         json:"nboSource"`        // 项目来源
+	NboBudget        float64     `orm:"nbo_budget"         json:"nboBudget"`        // 项目预算
+	ApproStatus      string      `orm:"appro_status"       json:"approStatus"`      // 审批状态(10待审批20审批中30审批通过40审批退回60审批拒绝)
+	ContactId        int         `orm:"contact_id"         json:"contactId"`        // 关联联系人
+	ContactName      string      `orm:"contact_name"       json:"contactName"`      // 联系人姓名
+	ContactPostion   string      `orm:"contact_postion"    json:"contactPostion"`   // 联系人岗位
+	ContactTelephone string      `orm:"contact_telephone"  json:"contactTelephone"` // 联系人电话
+	MakerId          int         `orm:"maker_id"           json:"makerId"`          // 关联决策人
+	MakerName        string      `orm:"maker_name"         json:"makerName"`        // 决策人姓名
+	MakerPost        string      `orm:"maker_post"         json:"makerPost"`        // 决策人岗位
+	MakerTelephone   string      `orm:"maker_telephone"    json:"makerTelephone"`   // 决策人电话
+	SalesModel       string      `orm:"sales_model"        json:"salesModel"`       // 销售模式(10直销20经销30代理)
+	SaleId           int         `orm:"sale_id"            json:"saleId"`           // 归属销售
+	SaleName         string      `orm:"sale_name"          json:"saleName"`         // 销售姓名
+	DistributorId    int         `orm:"distributor_id"     json:"distributorId"`    // 经销商/代理商ID
+	DistributorName  string      `orm:"distributor_name"   json:"distributorName"`  // 经销商/代理商名称
+	FinalFollowTime  *gtime.Time `orm:"final_follow_time"  json:"finalFollowTime"`  // 最后跟进时间
+	NextFollowTime   *gtime.Time `orm:"next_follow_time"   json:"nextFollowTime"`   // 下次跟进时间
+	PlanPurchaseTime *gtime.Time `orm:"plan_purchase_time" json:"planPurchaseTime"` // 计划采购时间
+	EstTransTime     *gtime.Time `orm:"est_trans_time"     json:"estTransTime"`     // 预计成交时间
+	EstTransPrice    float64     `orm:"est_trans_price"    json:"estTransPrice"`    // 预计成交价格
+	RiskProfile      string      `orm:"risk_profile"       json:"riskProfile"`      // 风险情况
+	Difficulty       string      `orm:"difficulty"         json:"difficulty"`       // 困难点
+	Competitor       string      `orm:"competitor"         json:"competitor"`       // 竞争公司
+	Intervention     string      `orm:"Intervention"       json:"intervention"`     // 介入情况
+	DeptId           int         `orm:"dept_id"            json:"deptId"`           // 所属部门ID
+	DeptName         string      `orm:"dept_name"          json:"deptName"`         // 所属部门
+	Remark           string      `orm:"remark"             json:"remark"`           // 备注
+	CreatedBy        int         `orm:"created_by"         json:"createdBy"`        // 创建者
+	CreatedName      string      `orm:"created_name"       json:"createdName"`      // 创建人
+	CreatedTime      *gtime.Time `orm:"created_time"       json:"createdTime"`      // 创建时间
+	UpdatedBy        int         `orm:"updated_by"         json:"updatedBy"`        // 更新者
+	UpdatedName      string      `orm:"updated_name"       json:"updatedName"`      // 更新人
+	UpdatedTime      *gtime.Time `orm:"updated_time"       json:"updatedTime"`      // 更新时间
+	DeletedTime      *gtime.Time `orm:"deleted_time"       json:"deletedTime"`      // 删除时间
+}

+ 24 - 0
opms_parent/app/model/proj/internal/proj_business_contact.go

@@ -0,0 +1,24 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusinessContact is the golang structure for table proj_business_contact.
+type ProjBusinessContact struct {
+	Id          int         `orm:"id,primary"   json:"id"`          // 主键
+	BusId       int         `orm:"bus_id"       json:"busId"`       // 关联项目
+	ContactId   int         `orm:"contact_id"   json:"contactId"`   // 联系人主键
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 27 - 0
opms_parent/app/model/proj/internal/proj_business_dynamics.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"
+)
+
+// ProjBusinessDynamics is the golang structure for table proj_business_dynamics.
+type ProjBusinessDynamics struct {
+	Id          int         `orm:"id,primary"    json:"id"`          // 主键
+	OpnPeopleId int         `orm:"opn_people_id" json:"opnPeopleId"` // 操作人ID
+	OpnPeople   string      `orm:"opn_people"    json:"opnPeople"`   // 操作人
+	OpnDate     *gtime.Time `orm:"opn_date"      json:"opnDate"`     // 操作日期
+	OpnType     string      `orm:"opn_type"      json:"opnType"`     // 操作类型
+	OpnContent  string      `orm:"opn_content"   json:"opnContent"`  // 操作内容
+	Remark      string      `orm:"remark"        json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"    json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name"  json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time"  json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"    json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name"  json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time"  json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time"  json:"deletedTime"` // 删除时间
+}

+ 26 - 0
opms_parent/app/model/proj/internal/proj_business_file.go

@@ -0,0 +1,26 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusinessFile is the golang structure for table proj_business_file.
+type ProjBusinessFile struct {
+	Id          int         `orm:"id,primary"   json:"id"`          // 主键
+	BusId       int         `orm:"bus_id"       json:"busId"`       // 关联项目
+	FileName    string      `orm:"file_name"    json:"fileName"`    // 附件名称
+	FileSize    string      `orm:"file_size"    json:"fileSize"`    // 附件大小
+	FileSource  string      `orm:"file_source"  json:"fileSource"`  // 来源
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 31 - 0
opms_parent/app/model/proj/internal/proj_business_product.go

@@ -0,0 +1,31 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusinessProduct is the golang structure for table proj_business_product.
+type ProjBusinessProduct struct {
+	Id            int         `orm:"id,primary"     json:"id"`            // 主键
+	BusId         int         `orm:"bus_id"         json:"busId"`         // 关联项目
+	Name          string      `orm:"name"           json:"name"`          // 产品名称
+	Category      string      `orm:"category"       json:"category"`      // 产品类别
+	Unit          string      `orm:"unit"           json:"unit"`          // 单位
+	OriginalPrice int         `orm:"original_price" json:"originalPrice"` // 原价
+	SellingPrice  int         `orm:"selling_price"  json:"sellingPrice"`  // 售价
+	Quantity      int         `orm:"quantity"       json:"quantity"`      // 数量
+	Discount      int         `orm:"discount"       json:"discount"`      // 折扣
+	TotalPrice    int         `orm:"total_price"    json:"totalPrice"`    // 总价
+	Remark        string      `orm:"remark"         json:"remark"`        // 备注
+	CreatedBy     int         `orm:"created_by"     json:"createdBy"`     // 创建者
+	CreatedName   string      `orm:"created_name"   json:"createdName"`   // 创建人
+	CreatedTime   *gtime.Time `orm:"created_time"   json:"createdTime"`   // 创建时间
+	UpdatedBy     int         `orm:"updated_by"     json:"updatedBy"`     // 更新者
+	UpdatedName   string      `orm:"updated_name"   json:"updatedName"`   // 更新人
+	UpdatedTime   *gtime.Time `orm:"updated_time"   json:"updatedTime"`   // 更新时间
+	DeletedTime   *gtime.Time `orm:"deleted_time"   json:"deletedTime"`   // 删除时间
+}

+ 91 - 0
opms_parent/app/model/proj/proj_business.go

@@ -0,0 +1,91 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+	"dashoo.cn/opms_libary/request"
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusiness is the golang structure for table proj_business.
+type ProjBusiness internal.ProjBusiness
+
+// Fill with you ideas below.
+
+// 添加数据
+type ProjBusinessReq struct {
+	NboName          string      `json:"nboName"        v:"required#项目名称不能为空"`                        // 项目名称
+	CustId           int         `json:"custId"        v:"required#关联客户不能为空"`                         // 关联客户
+	CustName         string      `json:"custName"        v:"required#关联客户不能为空"`                       // 客户名称
+	NboType          string      `json:"nboType"        v:"required|in:A,B,C#项目类别不能为空|项目类别只能为A、B、C"`  // 项目类别(A类B类C类)
+	NboPhase         string      `json:"nboPhase"`                                                    // 项目阶段(暂不起用)
+	NboSource        string      `json:"nboSource"        v:"required#关联客户不能为空"`                      // 项目来源
+	NboBudget        float64     `json:"nboBudget"`                                                   // 项目预算
+	ApproStatus      string      `json:"approStatus"        v:"in:10,20,30,40,60#审批状态错误"`             // 审批状态(10待审批20审批中30审批通过40审批退回60审批拒绝)
+	ContactId        int         `json:"contactId"        v:"required#关联联系人不能为空"`                     // 关联联系人
+	ContactName      string      `json:"contactName"        v:"required#关联联系人不能为空"`                   // 联系人姓名
+	ContactPostion   string      `json:"contactPostion"        v:"required#联系人岗位不能为空"`                // 联系人岗位
+	ContactTelephone string      `json:"contactTelephone"        v:"required#联系人岗位不能为空"`              // 联系人电话
+	MakerId          int         `json:"makerId"        v:"required#关联决策人不能为空"`                       // 关联决策人
+	MakerName        string      `json:"makerName"        v:"required#决策人姓名不能为空"`                     // 决策人姓名
+	MakerPost        string      `json:"makerPost"        v:"required#决策人岗位不能为空"`                     // 决策人岗位
+	MakerTelephone   string      `json:"makerTelephone"        v:"required#决策人电话不能为空"`                // 决策人电话
+	SalesModel       string      `json:"salesModel"        v:"required|in:10,20,30#销售模式不能为空|销售模式不存在"` // 销售模式(10直销20经销30代理)
+	SaleId           int         `json:"saleId"        v:"required#归属销售不能为空"`                         // 归属销售
+	SaleName         string      `json:"saleName"        v:"required#归属销售不能为空"`                       // 销售姓名
+	DistributorId    int         `json:"distributorId"`                                               // 经销商/代理商ID
+	DistributorName  string      `json:"distributorName"`                                             // 经销商/代理商名称
+	FinalFollowTime  *gtime.Time `json:"finalFollowTime"`                                             // 最后跟进时间
+	NextFollowTime   *gtime.Time `json:"nextFollowTime"`                                              // 下次跟进时间
+	PlanPurchaseTime *gtime.Time `json:"planPurchaseTime"`                                            // 计划采购时间
+	EstTransTime     *gtime.Time `json:"estTransTime"`                                                // 预计成交时间
+	EstTransPrice    float64     `json:"estTransPrice"`                                               // 预计成交价格
+	RiskProfile      string      `json:"riskProfile"`                                                 // 风险情况
+	Difficulty       string      `json:"difficulty"`                                                  // 困难点
+	Competitor       string      `json:"competitor"`                                                  // 竞争公司
+	Intervention     string      `json:"intervention"`                                                // 介入情况
+	DeptId           int         `json:"deptId"`                                                      // 所属部门ID
+	DeptName         string      `json:"deptName"`                                                    // 所属部门
+	Remark           string      `json:"remark"`                                                      // 备注
+
+}
+
+type ProjBusinessSearchReq struct {
+	NboName  string `json:"nboName"`  // 项目名称
+	CustName string `json:"custName"` // 客户名称
+	SaleName string `json:"saleName"` // 销售姓名
+	NboType  string `json:"nboType"`  // 项目类别(A类B类C类)
+	request.PageReq
+}
+
+type AddProjBusinessReq struct {
+	NboName        string            `json:"nboName"        v:"required#项目名称不能为空"`  // 项目名称
+	CustId         int               `json:"custId"        v:"required#关联客户不能为空"`   // 关联客户
+	CustName       string            `json:"custName"        v:"required#关联客户不能为空"` // 客户名称
+	EstTransTime   *gtime.Time       `json:"estTransTime"`                          // 预计成交时间
+	EstTransPrice  float64           `json:"estTransPrice"`                         // 预计成交价格
+	NextFollowTime *gtime.Time       `json:"nextFollowTime"`                        // 下次跟进时间
+	Remark         string            `json:"remark"`                                // 备注
+	Products       []BusinessProduct `json:"products"`                              // 产品列表
+}
+
+type UpdateProjBusinessReq struct {
+	Id int `p:"id"        v:"required# id不能为空"`
+	*AddProjBusinessReq
+}
+
+type BusinessProduct struct {
+	Id            int    `json:"id"`                                   // 主键
+	Name          string `json:"name"           v:"required#产品名称不能为空"` // 产品名称
+	Category      string `json:"category"       v:"required#产品类别不能为空"` // 产品类别
+	Unit          string `json:"unit"           v:"required#单位不能为空"`   // 单位
+	OriginalPrice int    `json:"originalPrice"  v:"required#原价不能为空"`   // 原价
+	SellingPrice  int    `json:"sellingPrice"   v:"required#售价不能为空"`   // 售价
+	Quantity      int    `json:"quantity"       v:"required#数量不能为空"`   // 数量
+	Discount      int    `json:"discount"       v:"required#折扣不能为空"`   // 折扣
+	TotalPrice    int    `json:"totalPrice"`                           // 总价
+	Remark        string `json:"remark"`                               // 备注
+}

+ 14 - 0
opms_parent/app/model/proj/proj_business_contact.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// ProjBusinessContact is the golang structure for table proj_business_contact.
+type ProjBusinessContact internal.ProjBusinessContact
+
+// Fill with you ideas below.

+ 14 - 0
opms_parent/app/model/proj/proj_business_dynamics.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// ProjBusinessDynamics is the golang structure for table proj_business_dynamics.
+type ProjBusinessDynamics internal.ProjBusinessDynamics
+
+// Fill with you ideas below.

+ 22 - 0
opms_parent/app/model/proj/proj_business_file.go

@@ -0,0 +1,22 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// ProjBusinessFile is the golang structure for table proj_business_file.
+type ProjBusinessFile internal.ProjBusinessFile
+
+// Fill with you ideas below.
+
+type ProjBusinessFileReq struct {
+	BusId      int    `json:"busId"        v:"required# 关联项目不能为空"`      // 关联项目
+	FileName   string `json:"fileName"        v:"required# 附件名称不能为空"`   // 附件名称
+	FileSize   string `json:"fileSize"        v:"required# 附件大小不能为空"`   // 附件大小
+	FileSource string `json:"fileSource"        v:"required# 附件来源不能为空"` // 来源
+	Remark     string `json:"remark"`                                   // 备注
+}

+ 14 - 0
opms_parent/app/model/proj/proj_business_product.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+)
+
+// ProjBusinessProduct is the golang structure for table proj_business_product.
+type ProjBusinessProduct internal.ProjBusinessProduct
+
+// Fill with you ideas below.

+ 4 - 0
opms_parent/app/service/base.go

@@ -27,6 +27,10 @@ func SetCreatedInfo(entry interface{}, id int, name string) {
 		t = t.Elem()
 		v = v.Elem()
 	}
+	if t.Kind() == reflect.Slice {
+
+	}
+
 	if t.Kind() != reflect.Struct {
 		log.Println("Check type error not Struct")
 		return

+ 113 - 0
opms_parent/app/service/proj/business.go

@@ -0,0 +1,113 @@
+package proj
+
+import (
+	"context"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/errors/gerror"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gconv"
+
+	projDao "dashoo.cn/micro/app/dao/proj"
+	model "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+)
+
+type businessService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessDao
+}
+
+func NewBusinessService(ctx context.Context) (svc *businessService, err error) {
+	svc = new(businessService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewProjBusinessDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessService) GetList(req *model.ProjBusinessSearchReq) (total int, businessList []*model.ProjBusiness, err error) {
+	db := p.Dao.M
+	if req.NboName != "" {
+		db = db.WhereLike(p.Dao.Columns.NboName, "%"+req.NboName+"%")
+	}
+	if req.CustName != "" {
+		db = db.WhereLike(p.Dao.Columns.CustName, "%"+req.CustName+"%")
+	}
+	if req.SaleName != "" {
+		db = db.WhereLike(p.Dao.Columns.SaleName, "%"+req.SaleName+"%")
+	}
+	if req.NboType != "" {
+		db = db.Where(p.Dao.Columns.NboType, req.NboType)
+	}
+	total, err = db.Count()
+	if err != nil {
+		g.Log().Error(err)
+		err = gerror.New("获取总行数失败")
+		return
+	}
+
+	err = db.Page(req.PageNum, req.PageSize).Order("id asc").Scan(&businessList)
+	return
+}
+
+func (p *businessService) GetEntityById(id int64) (business *model.ProjBusiness, err error) {
+	err = p.Dao.Where(projDao.ProjBusiness.Columns.Id, id).Scan(&business)
+	return
+}
+
+func (p *businessService) GetBusinessProduct(id int64) (productList []*model.ProjBusinessProduct, err error) {
+	productDao := projDao.NewProjBusinessProductDao(p.Tenant)
+	err = productDao.Where(productDao.ProjBusinessProductDao.Columns.BusId, id).Scan(&productList)
+	return
+}
+
+func (p *businessService) Create(req *model.AddProjBusinessReq) (err error) {
+	businessData := new(model.ProjBusiness)
+	if err = gconv.Struct(req, businessData); err != nil {
+		return
+	}
+	products := make([]*model.ProjBusinessProduct, len(req.Products))
+	if err = gconv.Structs(req.Products, &products); err != nil {
+		return
+	}
+
+	service.SetCreatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		res, err := p.Dao.TX(tx).Insert(businessData)
+		if err != nil {
+			return err
+		}
+		lastId, _ := res.LastInsertId()
+		for _, v := range products {
+			v.BusId = int(lastId)
+			v.TotalPrice = v.SellingPrice * v.Quantity
+			service.SetCreatedInfo(v, p.GetCxtUserId(), p.GetCxtUserName())
+		}
+		productDao := projDao.NewProjBusinessProductDao(p.Tenant)
+		_, err = productDao.TX(tx).Insert(products)
+		return err
+	})
+
+	return
+}
+
+func (p *businessService) UpdateById(req *model.UpdateProjBusinessReq) (err error) {
+	record, err := p.Dao.Count("Id", req.Id)
+	if err != nil || record == 0 {
+		err = gerror.New("该数据不存在")
+		return err
+	}
+	businessData := new(model.ProjBusiness)
+	if err = gconv.Struct(req, businessData); err != nil {
+		return
+	}
+	service.SetUpdatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	_, err = p.Dao.FieldsEx(service.UpdateFieldEx).WherePri(projDao.ProjBusiness.Columns.Id, req.Id).Update(businessData)
+	return
+}
+
+func (p *businessService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusiness.Columns.Id, ids).Delete()
+	return
+}

+ 87 - 0
opms_parent/app/service/proj/business_dynamics.go

@@ -0,0 +1,87 @@
+package proj
+
+import (
+	"context"
+	"github.com/gogf/gf/errors/gerror"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/util/gconv"
+
+	projDao "dashoo.cn/micro/app/dao/proj"
+	model "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+)
+
+type businessDynamicsService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessDao
+}
+
+func NewBusinessDynamicsService(ctx context.Context) (svc *businessDynamicsService, err error) {
+	svc = new(businessDynamicsService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewProjBusinessDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessDynamicsService) GetList(req *model.ProjBusinessSearchReq) (total int, businessList []*model.ProjBusiness, err error) {
+	db := p.Dao.M
+	if req.NboName != "" {
+		db = db.WhereLike(p.Dao.Columns.NboName, "%"+req.NboName+"%")
+	}
+	if req.CustName != "" {
+		db = db.WhereLike(p.Dao.Columns.CustName, "%"+req.CustName+"%")
+	}
+	if req.SaleName != "" {
+		db = db.WhereLike(p.Dao.Columns.SaleName, "%"+req.SaleName+"%")
+	}
+	if req.NboType != "" {
+		db = db.Where(p.Dao.Columns.NboType, req.NboType)
+	}
+	total, err = db.Count()
+	if err != nil {
+		g.Log().Error(err)
+		err = gerror.New("获取总行数失败")
+		return
+	}
+
+	err = db.Page(req.GetPage()).Order("id desc").Scan(&businessList)
+	return
+}
+
+func (p *businessDynamicsService) GetEntityById(id int64) (business *model.ProjBusiness, err error) {
+	err = p.Dao.Where(projDao.ProjBusinessDynamics.Columns.Id, id).Scan(&business)
+	return
+}
+
+func (p *businessDynamicsService) Create(req *model.AddProjBusinessReq) (err error) {
+	businessData := new(model.ProjBusiness)
+	if err = gconv.Struct(req, businessData); err != nil {
+		return
+	}
+	service.SetCreatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	_, err = p.Dao.Insert(businessData)
+	return
+}
+
+func (p *businessDynamicsService) UpdateById(req *model.UpdateProjBusinessReq) (err error) {
+	db := p.Dao.M
+	record, err := db.Count("Id", req.Id)
+	if err != nil || record == 0 {
+		err = gerror.New("该数据不存在")
+		return err
+	}
+	businessData := new(model.ProjBusiness)
+	if err = gconv.Struct(req, businessData); err != nil {
+		return
+	}
+	service.SetUpdatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	_, err = db.FieldsEx(service.UpdateFieldEx).WherePri(projDao.ProjBusinessDynamics.Columns.Id, req.Id).Update(businessData)
+	return
+}
+
+func (p *businessDynamicsService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusinessDynamics.Columns.Id, ids).Delete()
+	return
+}

+ 49 - 0
opms_parent/app/service/proj/business_file.go

@@ -0,0 +1,49 @@
+package proj
+
+import (
+	"context"
+	"github.com/gogf/gf/util/gconv"
+
+	projDao "dashoo.cn/micro/app/dao/proj"
+	model "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+)
+
+type businessFileService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessFileDao
+}
+
+func NewBusinessFileService(ctx context.Context) (svc *businessFileService, err error) {
+	svc = new(businessFileService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewProjBusinessFileDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessFileService) GetList() (total int, fileList []*model.ProjBusinessFile, err error) {
+	err = p.Dao.Order("id desc").Scan(&fileList)
+	return
+}
+
+func (p *businessFileService) GetEntityById(id int64) (business *model.ProjBusinessFile, err error) {
+	err = p.Dao.Where(projDao.ProjBusinessFile.Columns.Id, id).Scan(&business)
+	return
+}
+
+func (p *businessFileService) Create(req *model.ProjBusinessFileReq) (err error) {
+	businessData := new(model.ProjBusinessFile)
+	if err = gconv.Struct(req, businessData); err != nil {
+		return
+	}
+	service.SetCreatedInfo(businessData, p.GetCxtUserId(), p.GetCxtUserName())
+	_, err = p.Dao.Insert(businessData)
+	return
+}
+
+func (p *businessFileService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusinessFile.Columns.Id, ids).Delete()
+	return
+}

+ 5 - 2
opms_parent/config/config.toml

@@ -1,7 +1,7 @@
 # 应用系统设置
 [setting]
     logpath = "/tmp/log/admin"
-    bind-addr = "127.0.0.1:8799"
+    bind-addr = "127.0.0.1:8889"
     bind-mutipart-addr = "127.0.0.1:9999"
     need-advertise-addr = false
     srv-name = "dashoo.opms.parent-0.0.1"
@@ -16,7 +16,10 @@
 [database]
     [[database.default]]
         Debug = true
+        createdAt = "created_time"
+        updatedAt = "updated_time"
+        deletedAt = "deleted_time"
         link = "mysql:root:Dashoo#190801@ali@tcp(192.168.0.252:3306)/dashoo_crm"
 
 [micro_srv]
-    auth = "dashoo.opms.admin-0.0.1,127.0.0.1:8887"
+    auth = "dashoo.opms.admin-0.0.1,127.0.0.1:8888"

+ 6 - 4
opms_parent/main.go

@@ -2,14 +2,15 @@ package main
 
 import (
 	"context"
-	"dashoo.cn/micro/app/handler/plat"
-
-	"dashoo.cn/micro/app/handler/base"
-	"dashoo.cn/micro/app/handler/cust"
 
 	"dashoo.cn/opms_libary/micro_srv"
 	"github.com/gogf/gf/frame/g"
 	"github.com/smallnest/rpcx/protocol"
+
+	"dashoo.cn/micro/app/handler/base"
+	"dashoo.cn/micro/app/handler/cust"
+	"dashoo.cn/micro/app/handler/plat"
+	projHandler "dashoo.cn/micro/app/handler/proj"
 )
 
 func main() {
@@ -30,6 +31,7 @@ func main() {
 	s.RegisterName("TaskComment", new(plat.TaskCommentHandler), "")
 	s.RegisterName("TaskLog", new(plat.TaskLogHandler), "")
 	s.RegisterName("TaskProgress", new(plat.TaskProgressHandler), "")
+	s.RegisterName("Business", new(projHandler.BusinessHandler), "")
 
 	// 注册服务对象
 	//s.RegisterName("Auth", new(handler.Auth), "")