wangxingcheng пре 3 година
родитељ
комит
eeb14b3184
46 измењених фајлова са 4289 додато и 28 уклоњено
  1. 15 0
      opms_admin/app/handler/role.go
  2. 8 5
      opms_admin/app/model/sys_user.go
  3. 5 5
      opms_admin/app/service/context.go
  4. 104 1
      opms_admin/app/service/sys_role.go
  5. 12 0
      opms_admin/app/service/sys_user.go
  6. 0 4
      opms_libary/.idea/misc.xml
  7. 0 8
      opms_libary/.idea/opms_libary.iml
  8. 1 1
      opms_libary/micro_srv/micro_srv.go
  9. 3 0
      opms_libary/myerrors/error.go
  10. 515 0
      opms_parent/app/dao/proj/internal/proj_business.go
  11. 426 0
      opms_parent/app/dao/proj/internal/proj_business_contact.go
  12. 438 0
      opms_parent/app/dao/proj/internal/proj_business_dynamics.go
  13. 435 0
      opms_parent/app/dao/proj/internal/proj_business_file.go
  14. 447 0
      opms_parent/app/dao/proj/internal/proj_business_product.go
  15. 435 0
      opms_parent/app/dao/proj/internal/proj_business_team.go
  16. 36 0
      opms_parent/app/dao/proj/proj_business.go
  17. 36 0
      opms_parent/app/dao/proj/proj_business_contact.go
  18. 36 0
      opms_parent/app/dao/proj/proj_business_dynamics.go
  19. 36 0
      opms_parent/app/dao/proj/proj_business_file.go
  20. 36 0
      opms_parent/app/dao/proj/proj_business_product.go
  21. 36 0
      opms_parent/app/dao/proj/proj_business_team.go
  22. 150 0
      opms_parent/app/handler/proj/business.go
  23. 62 0
      opms_parent/app/handler/proj/business_contact.go
  24. 32 0
      opms_parent/app/handler/proj/business_dynamics.go
  25. 64 0
      opms_parent/app/handler/proj/business_file.go
  26. 63 0
      opms_parent/app/handler/proj/business_team.go
  27. 54 0
      opms_parent/app/model/proj/internal/proj_business.go
  28. 24 0
      opms_parent/app/model/proj/internal/proj_business_contact.go
  29. 28 0
      opms_parent/app/model/proj/internal/proj_business_dynamics.go
  30. 27 0
      opms_parent/app/model/proj/internal/proj_business_file.go
  31. 31 0
      opms_parent/app/model/proj/internal/proj_business_product.go
  32. 27 0
      opms_parent/app/model/proj/internal/proj_business_team.go
  33. 111 0
      opms_parent/app/model/proj/proj_business.go
  34. 34 0
      opms_parent/app/model/proj/proj_business_contact.go
  35. 14 0
      opms_parent/app/model/proj/proj_business_dynamics.go
  36. 23 0
      opms_parent/app/model/proj/proj_business_file.go
  37. 14 0
      opms_parent/app/model/proj/proj_business_product.go
  38. 36 0
      opms_parent/app/model/proj/proj_business_team.go
  39. 4 0
      opms_parent/app/service/base.go
  40. 223 0
      opms_parent/app/service/proj/business.go
  41. 48 0
      opms_parent/app/service/proj/business_contact.go
  42. 43 0
      opms_parent/app/service/proj/business_dynamics.go
  43. 49 0
      opms_parent/app/service/proj/business_file.go
  44. 51 0
      opms_parent/app/service/proj/business_team.go
  45. 5 2
      opms_parent/config/config.toml
  46. 12 2
      opms_parent/main.go

+ 15 - 0
opms_admin/app/handler/role.go

@@ -131,3 +131,18 @@ func (h *RoleHandler) UpdateRoleDataScope(ctx context.Context, req *model.DataSc
 	_, _, rsp.Code, rsp.Msg = myerrors.CheckError(err)
 	return nil
 }
+
+// GetDataScope 获取某用户数据集合权限,返回Ids(用户Id列表),返回-1表示无角色,返回-2表示有全部集合权限
+func (o *RoleHandler) GetDataScope(ctx context.Context, nullParams interface{}, rsp *comm_def.CommonMsg) error {
+	roleService, err := service.NewRoleService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	ids, err := roleService.GetDataScope(roleService.GetCxtUserId())
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = ids
+	return err
+}

+ 8 - 5
opms_admin/app/model/sys_user.go

@@ -36,11 +36,14 @@ type LoginUserRes struct {
 
 // SysUserSearchReq 用户搜索请求参数
 type SysUserSearchReq struct {
-	DeptId   int    `json:"deptId"` //部门id
-	DeptIds  []int  //所属部门id数据
-	Phone    string `json:"phone"`
-	Status   string `json:"status"`
-	KeyWords string `json:"userName"`
+	KeyWords string   `json:"keyWords"`
+	DeptId   int      `json:"deptId"` //部门id
+	DeptIds  []int    //所属部门id数据
+	Phone    string   `json:"phone"`
+	Status   string   `json:"status"`
+	Roles    []string `json:"roles"`
+	Posts    []string `json:"posts"`
+	Groups   []string `json:"groups"`
 	request.PageReq
 }
 

+ 5 - 5
opms_admin/app/service/context.go

@@ -96,17 +96,17 @@ func (c *contextService) GetDataScopeWhere() (where g.Map, err error) {
 	deptIdArr := gset.New()
 	for _, role := range roles {
 		switch role.DataScope {
-		case "1": //全部数据权限
+		case "10": //全部数据权限
 			return nil, nil
-		case "2": //自定数据权限
+		case "20": //自定数据权限
 			deptIds, err := roleSrv.GetRoleDeptTreeselect(gconv.Int64(role.Id))
 			if err != nil {
 				return nil, err
 			}
 			deptIdArr.Add(gconv.Interfaces(deptIds)...)
-		case "3": //本部门数据权限
+		case "30": //本部门数据权限
 			deptIdArr.Add(gconv.Int64(userInfo.DeptId))
-		case "4": //本部门及以下数据权限
+		case "40": //本部门及以下数据权限
 			deptIdArr.Add(gconv.Int64(userInfo.DeptId))
 			//获取正常状态部门数据
 			depts, err := deptSrv.GetList(&model.SysDeptSearchParams{Status: "10"})
@@ -117,7 +117,7 @@ func (c *contextService) GetDataScopeWhere() (where g.Map, err error) {
 			for _, children := range childrenList {
 				deptIdArr.Add(gconv.Int64(children.Id))
 			}
-		case "5": //仅本人数据权限
+		case "50": //仅本人数据权限
 			whereJustMe = g.Map{"`user`.id": userInfo.Id}
 		}
 	}

+ 104 - 1
opms_admin/app/service/sys_role.go

@@ -5,6 +5,7 @@ import (
 	"dashoo.cn/micro/app/dao"
 	"dashoo.cn/micro/app/model"
 	"dashoo.cn/opms_libary/utils"
+	"github.com/gogf/gf/container/gset"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/errors/gerror"
 	"github.com/gogf/gf/frame/g"
@@ -106,7 +107,7 @@ func (s *roleService) GetRoleDeptTreeselect(id int64) (deptIds []int, err error)
 }
 
 // GetRolesMenuPermissions 获取角色菜单权限
-func (s roleService) GetRolesMenuPermissions(ids []int) (perms []string, err error) {
+func (s *roleService) GetRolesMenuPermissions(ids []int) (perms []string, err error) {
 	result, err := dao.NewSysMenuDao(s.Tenant).Fields(dao.SysMenu.Columns.Perms).WhereIn(dao.SysMenu.Columns.MenuType, g.Slice{"C", "F"}).
 		WhereIn(dao.SysMenu.Columns.Id, s.roleMenuDao.WhereIn(s.roleMenuDao.Columns.RoleId, ids).Fields(s.roleMenuDao.Columns.MenuId)).
 		WhereNot(dao.SysMenu.Columns.Perms, "").Array()
@@ -220,3 +221,105 @@ func (s *roleService) UpdateRoleDataScope(req *model.DataScopeReq) error {
 	})
 	return err
 }
+
+// GetMaxRoleDataScopeByUser 获取用户所拥有的角色最高数据权限
+func (s *roleService) GetMaxRoleDataScopeByUser(userId int) (string, []int, error) {
+	roleIds, err := dao.NewSysUserRoleDao(s.Tenant).Fields(dao.SysUserRole.Columns.RoleId).Where(dao.SysUserRole.Columns.UserId, userId).Array()
+	if err != nil {
+		return "", nil, err
+	}
+	if roleIds == nil {
+		return "-1", nil, nil
+	}
+
+	scopes, err := s.Dao.Fields(s.Dao.Columns.DataScope).Distinct().Order(s.Dao.Columns.DataScope).WhereIn(s.Dao.Columns.Id, roleIds).Array()
+	if err != nil {
+		return "", nil, err
+	}
+	if scopes == nil || len(scopes) == 0 {
+		return "", nil, gerror.New("用户角色设定有错误。")
+	}
+
+	scope := scopes[0].String()
+	if scope == "30" {
+		for _, v := range scopes {
+			if v.String() == "40" {
+				scope = "40"
+				break
+			}
+		}
+	}
+
+	return scope, gconv.Ints(roleIds), err
+}
+
+// GetDataScope 获取某用户数据集合权限,返回Ids(用户Id列表),返回-1表示无角色,返回-2表示有全部集合权限
+func (s *roleService) GetDataScope(userId int) (ids string, err error) {
+	userDao := dao.NewSysUserDao(s.Tenant)
+	_, err = userDao.WherePri(userId).FindOne()
+	if err != nil {
+		return "", err
+	}
+
+	// 获取角色,获取最高数据权限
+	dataScope, roleIds, err := s.GetMaxRoleDataScopeByUser(userId)
+	if err != nil {
+		return "", err
+	}
+	if dataScope == "-1" { // 无角色
+		return "-1", nil
+	}
+
+	// 数据集合权限 10:全部数据权限 20:自定数据权限 30:本部门数据权限 40:本部门及以下数据权限 50:仅本人数据权限
+	ids = "-1"
+	switch dataScope {
+	case "10": // 所有数据权限
+		return "-2", nil
+	case "20": // 自定数据权限
+		result, err := userDao.Fields(userDao.Columns.Id).WhereIn(
+			userDao.Columns.DeptId, s.roleDeptDao.Fields(s.roleDeptDao.Columns.DeptId).WhereIn(s.roleDeptDao.Columns.RoleId, roleIds),
+		).Array()
+		if err != nil {
+			return "", err
+		}
+		ids = utils.ToIdsString(result)
+	case "30": // 本部门数据权限
+		result, err := userDao.Fields(userDao.Columns.Id).Where(
+			userDao.Columns.DeptId, userDao.Fields(userDao.Columns.DeptId).WherePri(userId),
+		).Array()
+		if err != nil {
+			return "", err
+		}
+		ids = utils.ToIdsString(result)
+	case "40": // 本部门及以下数据权限
+		deptId, err := userDao.Value(userDao.Columns.DeptId, userDao.Columns.Id, userId)
+		if err != nil {
+			return "", err
+		}
+
+		deptSrv := &deptService{
+			contextService: s.contextService,
+			Dao:            dao.NewSysDeptDao(s.Tenant),
+		}
+		//获取正常状态部门数据
+		depts, err := deptSrv.GetList(&model.SysDeptSearchParams{Status: "10"})
+		if err != nil {
+			return "", err
+		}
+		deptIdArr := gset.New()
+		childrenList := deptSrv.FindSonByParentId(depts, gconv.Int(deptId))
+		for _, children := range childrenList {
+			deptIdArr.Add(gconv.Int(children.Id))
+		}
+
+		result, err := userDao.Fields(userDao.Columns.Id).WhereIn(userDao.Columns.DeptId, deptIdArr).Array()
+		if err != nil {
+			return "", err
+		}
+		ids = utils.ToIdsString(result)
+	case "50": // 仅本人数据权限
+		ids = gconv.String(userId)
+	}
+
+	return ids, nil
+}

+ 12 - 0
opms_admin/app/service/sys_user.go

@@ -94,6 +94,18 @@ func (s *userService) GetUserList(req *model.SysUserSearchReq) (total int, userL
 	if req.EndTime != "" {
 		userModel = userModel.WhereLTE("sys_user.created_time", req.EndTime)
 	}
+	if len(req.Roles) > 0 {
+		sql := dao.NewSysRoleDao(s.Tenant).Fields(dao.SysRole.Columns.Id).WhereIn(dao.SysRole.Columns.RoleKey, req.Roles)
+		userModel = userModel.LeftJoin(dao.SysUserRole.Table, "ur", "sys_user.id=ur.user_id").WhereIn("ur.role_id", sql)
+	}
+	if len(req.Posts) > 0 {
+		sql := dao.NewSysPostDao(s.Tenant).Fields(dao.SysPost.Columns.Id).WhereIn(dao.SysPost.Columns.PostCode, req.Posts)
+		userModel = userModel.LeftJoin(dao.SysUserPost.Table, "up", "sys_user.id=up.user_id").WhereIn("up.post_id", sql)
+	}
+	if len(req.Groups) > 0 {
+		sql := dao.NewSysGroupDao(s.Tenant).Fields(dao.SysGroup.Columns.Id).WhereIn(dao.SysGroup.Columns.GroupCode, req.Groups)
+		userModel = userModel.LeftJoin(dao.SysUserGroup.Table, "ug", "sys_user.id=ug.user_id").WhereIn("ug.group_id", sql)
+	}
 	if userModel, err = s.SetDataScopeWhere(userModel); err != nil {
 		return 0, nil, err
 	}

+ 0 - 4
opms_libary/.idea/misc.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="GOROOT" path="$USER_HOME$/Go/go1.19.3" />
-</project>

+ 0 - 8
opms_libary/.idea/opms_libary.iml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="WEB_MODULE" version="4">
-  <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 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()}
+}

+ 438 - 0
opms_parent/app/dao/proj/internal/proj_business_dynamics.go

@@ -0,0 +1,438 @@
+// ==========================================================================
+// 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 // 主键
+	BusId       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",
+			BusId:       "bus_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",
+			BusId:       "bus_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()}
+}

+ 435 - 0
opms_parent/app/dao/proj/internal/proj_business_file.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"
+)
+
+// 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 // 来源
+	FileUrl     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",
+			FileUrl:     "file_url",
+			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",
+			FileUrl:     "file_url",
+			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()}
+}

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

+ 36 - 0
opms_parent/app/dao/proj/proj_business_team.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"
+)
+
+// projBusinessTeamDao 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 projBusinessTeamDao struct {
+	internal.ProjBusinessTeamDao
+}
+
+var (
+	// ProjBusinessTeam is globally public accessible object for table proj_business_team operations.
+	ProjBusinessTeam = projBusinessTeamDao{
+		internal.ProjBusinessTeam,
+	}
+)
+
+type ProjBusinessTeamDao struct {
+	internal.ProjBusinessTeamDao
+}
+
+func NewProjBusinessTeamDao(tenant string) *ProjBusinessTeamDao {
+	dao := internal.NewProjBusinessTeamDao(tenant)
+	return &ProjBusinessTeamDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

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

@@ -0,0 +1,150 @@
+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
+}
+
+// BusinessGradation 业务调级
+func (p *BusinessHandler) BusinessGradation(ctx context.Context, req *projModel.BusinessGradationReq, 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 gerror.New("系统异常,请重新尝试")
+	}
+	err = businessService.BusinessGradation(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// BusinessTransfer 项目转移
+func (p *BusinessHandler) BusinessTransfer(ctx context.Context, req *projModel.BusinessTransferReq, 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 gerror.New("系统异常,请重新尝试")
+	}
+	err = businessService.BusinessTransfer(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 62 - 0
opms_parent/app/handler/proj/business_contact.go

@@ -0,0 +1,62 @@
+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/util/gvalid"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type BusinessContactHandler struct{}
+
+func (p *BusinessContactHandler) GetList(ctx context.Context, req *projModel.BusinessReq, rsp *comm_def.CommonMsg) error {
+	if req.BusId == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	contactService, err := projSrv.NewBusinessContactService(ctx)
+	if err != nil {
+		return err
+	}
+	list, err := contactService.GetList(req.BusId)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = list
+	return nil
+}
+
+func (p *BusinessContactHandler) Create(ctx context.Context, req *projModel.BusinessContactReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	contactService, err := projSrv.NewBusinessContactService(ctx)
+	if err != nil {
+		return err
+	}
+	err = contactService.Create(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessContactHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if len(req.Ids) == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	contactService, err := projSrv.NewBusinessContactService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	err = contactService.DeleteByIds(req.Ids)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	return err
+}

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

@@ -0,0 +1,32 @@
+package base
+
+import (
+	"context"
+	"github.com/gogf/gf/errors/gerror"
+
+	"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.BusinessReq, rsp *comm_def.CommonMsg) error {
+	if req.BusId == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	businessService, err := projSrv.NewBusinessDynamicsService(ctx)
+	if err != nil {
+		return err
+	}
+	list, err := businessService.GetList(req.BusId)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = list
+	return nil
+}

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

@@ -0,0 +1,64 @@
+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/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.BusinessReq, rsp *comm_def.CommonMsg) error {
+	if req.BusId == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	businessService, err := projSrv.NewBusinessFileService(ctx)
+	if err != nil {
+		return err
+	}
+	list, err := businessService.GetList(req.BusId)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = list
+	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 {
+		return err
+	}
+	err = businessService.Create(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		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
+}

+ 63 - 0
opms_parent/app/handler/proj/business_team.go

@@ -0,0 +1,63 @@
+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/util/gvalid"
+
+	projModel "dashoo.cn/micro/app/model/proj"
+	projSrv "dashoo.cn/micro/app/service/proj"
+)
+
+type BusinessTeamHandler struct{}
+
+// GetList 获取列表
+func (p *BusinessTeamHandler) GetList(ctx context.Context, req *projModel.BusinessReq, rsp *comm_def.CommonMsg) error {
+	if req.BusId == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	teamService, err := projSrv.NewBusinessTeamService(ctx)
+	if err != nil {
+		return err
+	}
+	list, err := teamService.GetList(req.BusId)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Data = list
+	return nil
+}
+
+func (p *BusinessTeamHandler) Create(ctx context.Context, req *projModel.BusinessTeamReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	teamService, err := projSrv.NewBusinessTeamService(ctx)
+	if err != nil {
+		return err
+	}
+	err = teamService.Create(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (p *BusinessTeamHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if len(req.Ids) == 0 {
+		return gerror.New("参数为空,操作失败")
+	}
+	teamService, err := projSrv.NewBusinessTeamService(ctx)
+	if err != nil {
+		return gerror.New("系统异常,请重新尝试")
+	}
+	err = teamService.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"` // 删除时间
+}

+ 28 - 0
opms_parent/app/model/proj/internal/proj_business_dynamics.go

@@ -0,0 +1,28 @@
+// ==========================================================================
+// 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"`          // 主键
+	BusId       int         `orm:"bus_id"        json:"busId"`       // 关联项目
+	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"` // 删除时间
+}

+ 27 - 0
opms_parent/app/model/proj/internal/proj_business_file.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"
+)
+
+// 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"`  // 来源
+	FileUrl     string      `orm:"file_url"     json:"fileUrl"`     // 附件链接
+	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"`   // 删除时间
+}

+ 27 - 0
opms_parent/app/model/proj/internal/proj_business_team.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"
+)
+
+// ProjBusinessTeam is the golang structure for table proj_business_team.
+type ProjBusinessTeam struct {
+	Id           int         `orm:"id,primary"    json:"id"`           // 主键
+	BusId        int         `orm:"bus_id"        json:"busId"`        // 关联项目
+	UserId       int         `orm:"user_id"       json:"userId"`       // 关联用户
+	Role         string      `orm:"role"          json:"role"`         // 团队角色
+	Permission   string      `orm:"permission"    json:"permission"`   // 权限
+	DeadlineTime *gtime.Time `orm:"deadline_time" json:"deadlineTime"` // 截止时间
+	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"`  // 删除时间
+}

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

@@ -0,0 +1,111 @@
+// ==========================================================================
+// 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"`                               // 备注
+}
+
+// 项目调级请求
+type BusinessGradationReq struct {
+	Id      int    `json:"id"        v:"required# id不能为空"`                             // 主键
+	NboType string `json:"nboType"        v:"required|in:A,B,C#项目类别不能为空|项目类别只能为A、B、C"` // 项目类别(A类B类C类)
+}
+
+// 项目转移请求
+type BusinessTransferReq struct {
+	Id       int    `json:"id"        v:"required# id不能为空"`        // 主键
+	UserId   int    `json:"userId"        v:"required# 负责人不能为空"`   // 负责人
+	UserName string `json:"userName"        v:"required# 负责人不能为空"` // 负责人
+	Remark   string `json:"remark"`                                // 备注
+}
+
+// 获取项目关联信息
+type BusinessReq struct {
+	BusId int64 `json:"busId"        v:"required# 关联项目不能为空"` // 主键
+}

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

@@ -0,0 +1,34 @@
+// ==========================================================================
+// 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.
+
+type BusinessContact struct {
+	Id         int    `json:"id"`         // 主键
+	BusId      int    `json:"busId"`      // 关联项目
+	ContactId  int    `json:"contactId"`  // 联系人主键
+	CustId     int    `json:"custId" `    // 关联客户
+	CuctName   string `json:"cuctName"  ` // 姓名
+	CuctGender string `json:"cuctGender"` // 性别(10男20女)
+	Postion    string `json:"postion"`    // 职位
+	Telephone  string `json:"telephone"`  // 电话
+	Wechat     string `json:"wechat"`     // 微信
+	Email      string `json:"email"`      // 邮箱
+	Policy     int    `json:"policy"`     //是否决策
+}
+
+type BusinessContactReq struct {
+	BusId      int    `json:"busId"        v:"required#关联项目不能为空"`     // 关联项目
+	ContactIds []int  `json:"contactIds"        v:"required#联系人不能为空"` // 联系人主键
+	Remark     string `json:"remark"`                                 // 备注
+}

+ 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.

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

@@ -0,0 +1,23 @@
+// ==========================================================================
+// 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# 附件来源不能为空"` // 附件来源
+	FileUrl    string `json:"fileUrl"        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.

+ 36 - 0
opms_parent/app/model/proj/proj_business_team.go

@@ -0,0 +1,36 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/proj/internal"
+	"github.com/gogf/gf/os/gtime"
+)
+
+// ProjBusinessTeam is the golang structure for table proj_business_team.
+type ProjBusinessTeam internal.ProjBusinessTeam
+
+// Fill with you ideas below.
+
+type BusinessTeam struct {
+	Id           int         `json:"id"`           //
+	BusId        int         `json:"busId"`        // 关联项目
+	UserId       int         `json:"userId"`       // 用户
+	UserName     string      `json:"userName"`     // 用户姓名
+	DeptName     string      `json:"deptName"`     // 部门名称
+	Role         string      `json:"role"`         // 团队角色
+	Permission   string      `json:"permission"`   // 权限
+	DeadlineTime *gtime.Time `json:"deadlineTime"` // 截止时间
+	Remark       string      `json:"remark"`       // 备注
+}
+
+type BusinessTeamReq struct {
+	BusId        int         `json:"busId"        v:"required#关联项目不能为空"`        // 关联项目
+	UserIds      []int       `json:"userIds"        v:"required#用户不能为空"`        // 用户
+	Role         string      `json:"role"`                                      // 团队角色
+	Permission   string      `json:"permission"        v:"required#用户权限不能为空"`   // 权限
+	DeadlineTime *gtime.Time `json:"deadlineTime"        v:"required#截止时间不能为空"` // 截止时间
+	Remark       string      `json:"remark"`                                    // 备注
+}

+ 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

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

@@ -0,0 +1,223 @@
+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/os/gtime"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
+
+	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())
+		}
+		// 添加项目产品
+		_, err = projDao.NewProjBusinessProductDao(p.Tenant).TX(tx).Insert(products)
+		if err != nil {
+			return err
+		}
+		// 添加项目动态
+		dynamics := model.ProjBusinessDynamics{
+			OpnPeopleId: p.GetCxtUserId(),
+			OpnPeople:   p.GetCxtUserName(),
+			OpnDate:     gtime.Now(),
+			OpnType:     "CREATED",
+			OpnContent:  "创建项目",
+			Remark:      gconv.String(businessData),
+		}
+		service.SetCreatedInfo(dynamics, p.GetCxtUserId(), p.GetCxtUserName())
+		_, err = projDao.NewProjBusinessDao(p.Tenant).TX(tx).Insert(&dynamics)
+		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.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 更新项目
+		_, err = p.Dao.TX(tx).FieldsEx(service.UpdateFieldEx).WherePri(projDao.ProjBusiness.Columns.Id, req.Id).Update(businessData)
+		if err != nil {
+			return err
+		}
+		// 添加项目动态
+		dynamics := model.ProjBusinessDynamics{
+			OpnPeopleId: p.GetCxtUserId(),
+			OpnPeople:   p.GetCxtUserName(),
+			OpnDate:     gtime.Now(),
+			OpnType:     "UPDATED",
+			OpnContent:  "编辑项目",
+			Remark:      gconv.String(businessData),
+		}
+		service.SetCreatedInfo(dynamics, p.GetCxtUserId(), p.GetCxtUserName())
+		_, err = projDao.NewProjBusinessDao(p.Tenant).TX(tx).Insert(&dynamics)
+		return err
+	})
+	return
+}
+
+func (p *businessService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusiness.Columns.Id, ids).Delete()
+	return
+}
+
+// 项目调级
+func (p *businessService) BusinessGradation(req *model.BusinessGradationReq) error {
+	var business model.ProjBusiness
+	err := p.Dao.Where(projDao.ProjBusiness.Columns.Id, req.Id).Scan(&business)
+	if err != nil {
+		return err
+	}
+	if business.NboType == req.NboType {
+		return gerror.New("同级无法进行调级。")
+	}
+	opnContent := "项目升级 " + business.NboType + " => " + req.NboType
+	// A < B return -1 项目降级
+	if strings.Compare(business.NboType, req.NboType) < 0 {
+		opnContent = "项目降级 " + business.NboType + " => " + req.NboType
+	}
+	business.NboType = req.NboType
+	service.SetUpdatedInfo(business, p.GetCxtUserId(), p.GetCxtUserName())
+
+	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 更新项目调级
+		_, err = p.Dao.TX(tx).Fields(p.Dao.Columns.NboType).WherePri(projDao.ProjBusiness.Columns.Id, req.Id).Update(business)
+		if err != nil {
+			return err
+		}
+		// 添加项目动态
+		dynamics := model.ProjBusinessDynamics{
+			OpnPeopleId: p.GetCxtUserId(),
+			OpnPeople:   p.GetCxtUserName(),
+			OpnDate:     gtime.Now(),
+			OpnType:     "UPDATED",
+			OpnContent:  opnContent,
+		}
+		service.SetCreatedInfo(dynamics, p.GetCxtUserId(), p.GetCxtUserName())
+		_, err = projDao.NewProjBusinessDao(p.Tenant).TX(tx).Insert(&dynamics)
+		return err
+	})
+	return err
+}
+
+// 项目转移
+func (p *businessService) BusinessTransfer(req *model.BusinessTransferReq) error {
+	var business model.ProjBusiness
+	err := p.Dao.Where(projDao.ProjBusiness.Columns.Id, req.Id).Scan(&business)
+	if err != nil {
+		return err
+	}
+	business.SaleId = req.UserId
+	business.SaleName = req.UserName
+	business.Remark = req.Remark
+	service.SetUpdatedInfo(business, p.GetCxtUserId(), p.GetCxtUserName())
+
+	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 更新项目调级
+		_, err = p.Dao.TX(tx).Fields(p.Dao.Columns.SaleId, p.Dao.Columns.SaleName).WherePri(projDao.ProjBusiness.Columns.Id, req.Id).Update(business)
+		if err != nil {
+			return err
+		}
+		// 添加项目动态
+		dynamics := model.ProjBusinessDynamics{
+			OpnPeopleId: p.GetCxtUserId(),
+			OpnPeople:   p.GetCxtUserName(),
+			OpnDate:     gtime.Now(),
+			OpnType:     "UPDATED",
+			OpnContent:  "项目转移",
+			Remark:      gconv.String(business),
+		}
+		service.SetCreatedInfo(dynamics, p.GetCxtUserId(), p.GetCxtUserName())
+		_, err = projDao.NewProjBusinessDao(p.Tenant).TX(tx).Insert(&dynamics)
+		return err
+	})
+	return err
+}

+ 48 - 0
opms_parent/app/service/proj/business_contact.go

@@ -0,0 +1,48 @@
+package proj
+
+import (
+	"context"
+	custDao "dashoo.cn/micro/app/dao/cust"
+	projDao "dashoo.cn/micro/app/dao/proj"
+	projModel "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+)
+
+type businessContactService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessContactDao
+}
+
+func NewBusinessContactService(ctx context.Context) (svc *businessContactService, err error) {
+	svc = new(businessContactService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewProjBusinessContactDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessContactService) GetList(busId int64) (contactList []*projModel.BusinessContact, err error) {
+	err = p.Dao.As("bus").LeftJoin(custDao.CustCustomerContact.Table, "contact", "bus.contact_id=contact.id").
+		Where(p.Dao.Columns.BusId, busId).Fields("bus.id AS id, bus.*, contact.*").Scan(&contactList)
+	return
+}
+
+func (p *businessContactService) Create(req *projModel.BusinessContactReq) (err error) {
+	contactList := make([]*projModel.ProjBusinessContact, 0)
+	for _, v := range req.ContactIds {
+		data := new(projModel.ProjBusinessContact)
+		data.BusId = req.BusId
+		data.ContactId = v
+		data.Remark = req.Remark
+		service.SetCreatedInfo(data, p.GetCxtUserId(), p.GetCxtUserName())
+		contactList = append(contactList, data)
+	}
+	_, err = p.Dao.Insert(&contactList)
+	return
+}
+
+func (p *businessContactService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusinessContact.Columns.Id, ids).Delete()
+	return
+}

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

@@ -0,0 +1,43 @@
+package proj
+
+import (
+	"context"
+	projDao "dashoo.cn/micro/app/dao/proj"
+	model "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+	"github.com/gogf/gf/database/gdb"
+)
+
+type businessDynamicsService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessDynamicsDao
+}
+
+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.NewProjBusinessDynamicsDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessDynamicsService) GetList(busId int64) (businessList []*model.ProjBusinessDynamics, err error) {
+	err = p.Dao.Where(p.Dao.Columns.BusId, busId).Order("id desc").Scan(&businessList)
+	return
+}
+
+func (p *businessDynamicsService) GetEntityById(id int64) (business *model.ProjBusinessDynamics, err error) {
+	err = p.Dao.Where(projDao.ProjBusinessDynamics.Columns.Id, id).Scan(&business)
+	return
+}
+
+func (p *businessDynamicsService) Create(businessData *model.ProjBusinessDynamics, tenant string, tx *gdb.TX) (err error) {
+	_, err = projDao.NewProjBusinessDao(tenant).TX(tx).Insert(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(busId int64) (fileList []*model.ProjBusinessFile, err error) {
+	err = p.Dao.Where(p.Dao.Columns.BusId, busId).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
+}

+ 51 - 0
opms_parent/app/service/proj/business_team.go

@@ -0,0 +1,51 @@
+package proj
+
+import (
+	"context"
+	projDao "dashoo.cn/micro/app/dao/proj"
+	projModel "dashoo.cn/micro/app/model/proj"
+	"dashoo.cn/micro/app/service"
+)
+
+type businessTeamService struct {
+	*service.ContextService
+	Dao *projDao.ProjBusinessTeamDao
+}
+
+func NewBusinessTeamService(ctx context.Context) (svc *businessTeamService, err error) {
+	svc = new(businessTeamService)
+	if svc.ContextService, err = svc.Init(ctx); err != nil {
+		return nil, err
+	}
+	svc.Dao = projDao.NewProjBusinessTeamDao(svc.Tenant)
+	return svc, nil
+}
+
+func (p *businessTeamService) GetList(busId int64) (teamList []*projModel.BusinessTeam, err error) {
+	err = p.Dao.As("team").LeftJoin("sys_user", "user", "team.user_id=user.id").
+		LeftJoin("sys_dept", "dept", "user.dept_id=dept.id").
+		Where(p.Dao.Columns.BusId, busId).Fields("team.id AS id, team.*, user.user_name, dept.dept_name").Scan(&teamList)
+	return
+}
+
+func (p *businessTeamService) Create(req *projModel.BusinessTeamReq) (err error) {
+	teamList := make([]*projModel.ProjBusinessTeam, 0)
+	for _, v := range req.UserIds {
+		data := new(projModel.ProjBusinessTeam)
+		data.BusId = req.BusId
+		data.UserId = v
+		data.Role = req.Role
+		data.Permission = req.Permission
+		data.DeadlineTime = req.DeadlineTime
+		data.Remark = req.Remark
+		service.SetCreatedInfo(data, p.GetCxtUserId(), p.GetCxtUserName())
+		teamList = append(teamList, data)
+	}
+	_, err = p.Dao.Insert(&teamList)
+	return
+}
+
+func (p *businessTeamService) DeleteByIds(ids []int64) (err error) {
+	_, err = p.Dao.WhereIn(projDao.ProjBusinessTeam.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"

+ 12 - 2
opms_parent/main.go

@@ -10,7 +10,11 @@ import (
 	"dashoo.cn/micro/app/handler/base"
 	"dashoo.cn/micro/app/handler/cust"
 	"dashoo.cn/micro/app/handler/plat"
+<<<<<<< HEAD
 	"dashoo.cn/micro/app/handler/work"
+=======
+	projHandler "dashoo.cn/micro/app/handler/proj"
+>>>>>>> 6bc160af64997c7eeed4a6a111f7eb6913269bc6
 )
 
 func main() {
@@ -24,9 +28,7 @@ func main() {
 	s.RegisterName("Region", new(base.RegionHandler), "")
 	s.RegisterName("Customer", new(cust.CustomerHeader), "")
 	s.RegisterName("Contant", new(cust.CustomerContantHeader), "")
-
 	s.RegisterName("Belong", new(cust.CustBelongHeader), "")
-
 	s.RegisterName("FollowUp", new(plat.FollowUpHandler), "")
 	s.RegisterName("FollowUpComment", new(plat.FollowUpCommentHandler), "")
 	s.RegisterName("FollowUpFile", new(plat.FollowUpFileHandler), "")
@@ -35,8 +37,16 @@ func main() {
 	s.RegisterName("TaskLog", new(plat.TaskLogHandler), "")
 	s.RegisterName("TaskProgress", new(plat.TaskProgressHandler), "")
 
+<<<<<<< HEAD
 	//工单
 	s.RegisterName("WorkOrder", new(work.WorkOrderHandler), "")
+=======
+	s.RegisterName("Business", new(projHandler.BusinessHandler), "")
+	s.RegisterName("BusinessContact", new(projHandler.BusinessContactHandler), "")
+	s.RegisterName("BusinessDynamics", new(projHandler.BusinessDynamicsHandler), "")
+	s.RegisterName("BusinessFile", new(projHandler.BusinessFileHandler), "")
+	s.RegisterName("BusinessTeam", new(projHandler.BusinessTeamHandler), "")
+>>>>>>> 6bc160af64997c7eeed4a6a111f7eb6913269bc6
 
 	// 注册服务对象
 	//s.RegisterName("Auth", new(handler.Auth), "")