浏览代码

Merge branch 'develop' of http://code.dashoo.cn/chengjian/opms_backend into develop

wangxingcheng 3 年之前
父节点
当前提交
63304c96a0

+ 37 - 7
opms_parent/app/dao/plat/internal/plat_task.go

@@ -28,19 +28,29 @@ type platTaskColumns struct {
 	Id               string // 主键
 	TaskTitle        string // 任务标题
 	TaskType         string // 任务类型
-	TaskStatus       string // 任务状态(10进行中20关闭
+	TaskStatus       string // 任务状态(10发起  20进行中   30流程完成
 	IsOverdue        string // 是否超期(10否20是)
 	TaskStartDate    string // 任务开始时间
 	TaskEndDate      string // 任务结束时间
 	TaskDesc         string // 任务说明
-	SupervisorUserId string // 督办人
-	WatchUserId      string // 监办人
 	MainUserId       string // 负责人ID
 	OwnerUserId      string // 团队成员ID
 	TaskLabel        string // 任务标签,号拼接
+	SupervisorUserId string // 督办人ID
+	WatchUserId      string // 监办人ID
 	TargetId         string // 关联对象ID
 	TargetType       string // 关联对象类型(10客户,20项目,30合同,40回款)
 	TargetName       string // 关联对象
+	ApproverId       string // 审批人ID
+	ApproDate        string // 审批时间
+	ApproStatus      string // 审批结果
+	ApproDesc        string // 审批说明
+	EvaluatorId      string // 评价人ID
+	EvaluateDate     string // 评价时间
+	EvaluateStatus   string // 评价结果
+	EvaluateDesc     string // 评价说明
+	ReceiveDate      string // 接收时间
+	ActualCloseDate  string // 实际完成时间
 	Remark           string // 备注
 	CreatedBy        string // 创建者
 	CreatedName      string // 创建人
@@ -66,14 +76,24 @@ var (
 			TaskStartDate:    "task_start_date",
 			TaskEndDate:      "task_end_date",
 			TaskDesc:         "task_desc",
-			SupervisorUserId: "supervisor_user_id",
-			WatchUserId:      "watch_user_id",
 			MainUserId:       "main_user_id",
 			OwnerUserId:      "owner_user_id",
 			TaskLabel:        "task_label",
+			SupervisorUserId: "supervisor_user_id",
+			WatchUserId:      "watch_user_id",
 			TargetId:         "target_id",
 			TargetType:       "target_type",
 			TargetName:       "target_name",
+			ApproverId:       "approver_id",
+			ApproDate:        "appro_date",
+			ApproStatus:      "appro_status",
+			ApproDesc:        "appro_desc",
+			EvaluatorId:      "evaluator_id",
+			EvaluateDate:     "evaluate_date",
+			EvaluateStatus:   "evaluate_status",
+			EvaluateDesc:     "evaluate_desc",
+			ReceiveDate:      "receive_date",
+			ActualCloseDate:  "actual_close_date",
 			Remark:           "remark",
 			CreatedBy:        "created_by",
 			CreatedName:      "created_name",
@@ -101,14 +121,24 @@ func NewPlatTaskDao(tenant string) PlatTaskDao {
 			TaskStartDate:    "task_start_date",
 			TaskEndDate:      "task_end_date",
 			TaskDesc:         "task_desc",
-			SupervisorUserId: "supervisor_user_id",
-			WatchUserId:      "watch_user_id",
 			MainUserId:       "main_user_id",
 			OwnerUserId:      "owner_user_id",
 			TaskLabel:        "task_label",
+			SupervisorUserId: "supervisor_user_id",
+			WatchUserId:      "watch_user_id",
 			TargetId:         "target_id",
 			TargetType:       "target_type",
 			TargetName:       "target_name",
+			ApproverId:       "approver_id",
+			ApproDate:        "appro_date",
+			ApproStatus:      "appro_status",
+			ApproDesc:        "appro_desc",
+			EvaluatorId:      "evaluator_id",
+			EvaluateDate:     "evaluate_date",
+			EvaluateStatus:   "evaluate_status",
+			EvaluateDesc:     "evaluate_desc",
+			ReceiveDate:      "receive_date",
+			ActualCloseDate:  "actual_close_date",
 			Remark:           "remark",
 			CreatedBy:        "created_by",
 			CreatedName:      "created_name",

+ 446 - 0
opms_parent/app/dao/plat/internal/plat_task_handle.go

@@ -0,0 +1,446 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"dashoo.cn/micro/app/model/plat"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+)
+
+// PlatTaskHandleDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type PlatTaskHandleDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns platTaskHandleColumns
+}
+
+// PlatTaskHandleColumns defines and stores column names for table plat_task_handle.
+type platTaskHandleColumns struct {
+	ID           string // 主键
+	TaskId       string // 任务ID
+	TaskStatus   string // 任务状态(10打开20关闭)
+	Step         string // 步骤号
+	MainUserId   string // 处理人ID
+	OwnerUserId  string // 团队成员ID
+	HandleUserId string // 处理人ID
+	HandleDate   string // 处理时间
+	HandleStatus string // 处理结果(10接收20提交30审批通过40审批退回)
+	HandleDesc   string // 处理说明
+	Remark       string // 备注
+	CreatedBy    string // 创建者
+	CreatedName  string // 创建人
+	CreatedTime  string // 创建时间
+	UpdatedBy    string // 更新者
+	UpdatedName  string // 更新人
+	UpdatedTime  string // 更新时间
+	DeletedTime  string // 删除时间
+}
+
+var (
+	// PlatTaskHandle is globally public accessible object for table plat_task_handle operations.
+	PlatTaskHandle = PlatTaskHandleDao{
+		M:     g.DB("default").Model("plat_task_handle").Safe(),
+		DB:    g.DB("default"),
+		Table: "plat_task_handle",
+		Columns: platTaskHandleColumns{
+			ID:           "ID",
+			TaskId:       "task_id",
+			TaskStatus:   "task_status",
+			Step:         "step",
+			MainUserId:   "main_user_id",
+			OwnerUserId:  "owner_user_id",
+			HandleUserId: "handle_user_id",
+			HandleDate:   "handle_date",
+			HandleStatus: "handle_status",
+			HandleDesc:   "handle_desc",
+			Remark:       "remark",
+			CreatedBy:    "created_by",
+			CreatedName:  "created_name",
+			CreatedTime:  "created_time",
+			UpdatedBy:    "updated_by",
+			UpdatedName:  "updated_name",
+			UpdatedTime:  "updated_time",
+			DeletedTime:  "deleted_time",
+		},
+	}
+)
+
+func NewPlatTaskHandleDao(tenant string) PlatTaskHandleDao {
+	var dao PlatTaskHandleDao
+	dao = PlatTaskHandleDao{
+		M:     g.DB(tenant).Model("plat_task_handle").Safe(),
+		DB:    g.DB(tenant),
+		Table: "plat_task_handle",
+		Columns: platTaskHandleColumns{
+			ID:           "ID",
+			TaskId:       "task_id",
+			TaskStatus:   "task_status",
+			Step:         "step",
+			MainUserId:   "main_user_id",
+			OwnerUserId:  "owner_user_id",
+			HandleUserId: "handle_user_id",
+			HandleDate:   "handle_date",
+			HandleStatus: "handle_status",
+			HandleDesc:   "handle_desc",
+			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 *PlatTaskHandleDao) Ctx(ctx context.Context) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *PlatTaskHandleDao) As(as string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *PlatTaskHandleDao) TX(tx *gdb.TX) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *PlatTaskHandleDao) Master() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Slave() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *PlatTaskHandleDao) Args(args ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) LeftJoin(table ...string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) RightJoin(table ...string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) InnerJoin(table ...string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Fields(fieldNamesOrMapStruct ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *PlatTaskHandleDao) Option(option int) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) OmitEmpty() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *PlatTaskHandleDao) Filter() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Where(where interface{}, args ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) WherePri(where interface{}, args ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *PlatTaskHandleDao) And(where interface{}, args ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *PlatTaskHandleDao) Or(where interface{}, args ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *PlatTaskHandleDao) Group(groupBy string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *PlatTaskHandleDao) Order(orderBy ...string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Limit(limit ...int) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Offset(offset int) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Page(page, limit int) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *PlatTaskHandleDao) Batch(batch int) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Cache(duration time.Duration, name ...string) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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 *PlatTaskHandleDao) Data(data ...interface{}) *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{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.PlatTaskHandle.
+// 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 *PlatTaskHandleDao) All(where ...interface{}) ([]*plat.PlatTaskHandle, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*plat.PlatTaskHandle
+	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.PlatTaskHandle.
+// 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 *PlatTaskHandleDao) One(where ...interface{}) (*plat.PlatTaskHandle, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *plat.PlatTaskHandle
+	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 *PlatTaskHandleDao) FindOne(where ...interface{}) (*plat.PlatTaskHandle, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *plat.PlatTaskHandle
+	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 *PlatTaskHandleDao) FindAll(where ...interface{}) ([]*plat.PlatTaskHandle, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*plat.PlatTaskHandle
+	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 *PlatTaskHandleDao) 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 *PlatTaskHandleDao) 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 *PlatTaskHandleDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *PlatTaskHandleDao) Chunk(limit int, callback func(entities []*plat.PlatTaskHandle, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*plat.PlatTaskHandle
+		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 *PlatTaskHandleDao) LockUpdate() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *PlatTaskHandleDao) LockShared() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *PlatTaskHandleDao) Unscoped() *PlatTaskHandleDao {
+	return &PlatTaskHandleDao{M: d.M.Unscoped()}
+}

+ 36 - 0
opms_parent/app/dao/plat/plat_task_handle.go

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

+ 20 - 0
opms_parent/app/handler/plat/task.go

@@ -53,6 +53,26 @@ func (h *TaskHandler) Create(ctx context.Context, req *model.AddPlatTaskReq, rsp
 	return nil
 }
 
+// Handle 督办任务处理
+func (h *TaskHandler) Handle(ctx context.Context, req *model.HandleReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	taskService, err := server.NewTaskService(ctx)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	err = taskService.Handle(req)
+	_, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
+	if err != nil {
+		g.Log().Error(err)
+		return err
+	}
+	return nil
+}
+
 // ChangeStatus 修改任务状态
 func (h *TaskHandler) ChangeStatus(ctx context.Context, req *model.ChangeStatusReq, rsp *comm_def.CommonMsg) error {
 	// 参数校验

+ 13 - 3
opms_parent/app/model/plat/internal/plat_task.go

@@ -13,19 +13,29 @@ type PlatTask struct {
 	Id               int         `orm:"id,primary"         json:"id"`               // 主键
 	TaskTitle        string      `orm:"task_title"         json:"taskTitle"`        // 任务标题
 	TaskType         string      `orm:"task_type"          json:"taskType"`         // 任务类型
-	TaskStatus       string      `orm:"task_status"        json:"taskStatus"`       // 任务状态(10进行中20关闭
+	TaskStatus       string      `orm:"task_status"        json:"taskStatus"`       // 任务状态(10发起  20进行中   30流程完成
 	IsOverdue        string      `orm:"is_overdue"         json:"isOverdue"`        // 是否超期(10否20是)
 	TaskStartDate    *gtime.Time `orm:"task_start_date"    json:"taskStartDate"`    // 任务开始时间
 	TaskEndDate      *gtime.Time `orm:"task_end_date"      json:"taskEndDate"`      // 任务结束时间
 	TaskDesc         string      `orm:"task_desc"          json:"taskDesc"`         // 任务说明
-	SupervisorUserId int         `orm:"supervisor_user_id" json:"supervisorUserId"` // 督办人
-	WatchUserId      int         `orm:"watch_user_id"      json:"watchUserId"`      // 监办人
 	MainUserId       int         `orm:"main_user_id"       json:"mainUserId"`       // 负责人ID
 	OwnerUserId      string      `orm:"owner_user_id"      json:"ownerUserId"`      // 团队成员ID
 	TaskLabel        string      `orm:"task_label"         json:"taskLabel"`        // 任务标签,号拼接
+	SupervisorUserId int         `orm:"supervisor_user_id" json:"supervisorUserId"` // 督办人ID
+	WatchUserId      int         `orm:"watch_user_id"      json:"watchUserId"`      // 监办人ID
 	TargetId         int         `orm:"target_id"          json:"targetId"`         // 关联对象ID
 	TargetType       string      `orm:"target_type"        json:"targetType"`       // 关联对象类型(10客户,20项目,30合同,40回款)
 	TargetName       string      `orm:"target_name"        json:"targetName"`       // 关联对象
+	ApproverId       int         `orm:"approver_id"        json:"approverId"`       // 审批人ID
+	ApproDate        *gtime.Time `orm:"appro_date"         json:"approDate"`        // 审批时间
+	ApproStatus      string      `orm:"appro_status"       json:"approStatus"`      // 审批结果
+	ApproDesc        string      `orm:"appro_desc"         json:"approDesc"`        // 审批说明
+	EvaluatorId      int         `orm:"evaluator_id"       json:"evaluatorId"`      // 评价人ID
+	EvaluateDate     *gtime.Time `orm:"evaluate_date"      json:"evaluateDate"`     // 评价时间
+	EvaluateStatus   string      `orm:"evaluate_status"    json:"evaluateStatus"`   // 评价结果
+	EvaluateDesc     string      `orm:"evaluate_desc"      json:"evaluateDesc"`     // 评价说明
+	ReceiveDate      *gtime.Time `orm:"receive_date"       json:"receiveDate"`      // 接收时间
+	ActualCloseDate  *gtime.Time `orm:"actual_close_date"  json:"actualCloseDate"`  // 实际完成时间
 	Remark           string      `orm:"remark"             json:"remark"`           // 备注
 	CreatedBy        int         `orm:"created_by"         json:"createdBy"`        // 创建者
 	CreatedName      string      `orm:"created_name"       json:"createdName"`      // 创建人

+ 31 - 0
opms_parent/app/model/plat/internal/plat_task_handle.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"
+)
+
+// PlatTaskHandle is the golang structure for table plat_task_handle.
+type PlatTaskHandle struct {
+	ID           int         `orm:"ID,primary"     json:"iD"`           // 主键
+	TaskId       int         `orm:"task_id"        json:"taskId"`       // 任务ID
+	TaskStatus   string      `orm:"task_status"    json:"taskStatus"`   // 任务状态(10打开20关闭)
+	Step         int         `orm:"step"           json:"step"`         // 步骤号
+	MainUserId   int         `orm:"main_user_id"   json:"mainUserId"`   // 处理人ID
+	OwnerUserId  string      `orm:"owner_user_id"  json:"ownerUserId"`  // 团队成员ID
+	HandleUserId int         `orm:"handle_user_id" json:"handleUserId"` // 处理人ID
+	HandleDate   *gtime.Time `orm:"handle_date"    json:"handleDate"`   // 处理时间
+	HandleStatus string      `orm:"handle_status"  json:"handleStatus"` // 处理结果(10接收20提交30审批通过40审批退回)
+	HandleDesc   string      `orm:"handle_desc"    json:"handleDesc"`   // 处理说明
+	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"`  // 删除时间
+}

+ 15 - 0
opms_parent/app/model/plat/plat_task.go

@@ -15,6 +15,11 @@ type PlatTask internal2.PlatTask
 
 // Fill with you ideas below.
 
+type PlatTaskEx struct {
+	internal2.PlatTask
+	Step         int         `orm:"step"           json:"step"`         // 步骤号
+}
+
 // 查询
 type SearchPlatTaskReq struct {
 	TaskTitle  string `json:"taskTitle"`
@@ -26,6 +31,7 @@ type SearchPlatTaskReq struct {
 	TargetType string `json:"targetType"`
 	MySelf     string `json:"mySelf"`
 	IsMain     string `json:"isMain"`
+	OperateType     string `json:"operateType"`
 	request.PageReq
 }
 
@@ -74,3 +80,12 @@ type ExportReq struct {
 type ExportContent struct {
 	Content []byte `json:"content"` // 导出数据流
 }
+
+// 督办处理接口
+type HandleReq struct {
+	TaskId       int    				`json:"taskId|min:1"  v:"required#任务Id不能为空|任务Id不能为空"`
+	Step         int    				`json:"step"    v:"required|min:10#步骤不能为空|步骤不能为空"` // 步骤号(10接收  15暂存  20提交  30审批(督办人)  40评价(监办人))
+	HandleStatus string 				`json:"handleStatus"  v:"required#处理结果不能为空"`
+	HandleDesc   string  				`json:"handleDesc"`
+	ProgressList []*PlatTaskProgress    `json:"progressList"`
+}

+ 14 - 0
opms_parent/app/model/plat/plat_task_handle.go

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

+ 2 - 3
opms_parent/app/service/plat/plat_followup.go

@@ -55,7 +55,7 @@ func (s *followupService) GetList(req *model.SearchPlatFollowupReq) (total int,
 		return
 	}
 
-	err = followupModel.Page(req.PageNum, req.PageSize).Order("follow_date DESC").Scan(&followupList)
+	err = followupModel.Page(req.GetPage()).Order("follow_date DESC").Scan(&followupList)
 	return
 }
 
@@ -70,8 +70,7 @@ func (s *followupService) Create(req *model.AddPlatFollowupReq) (err error) {
 	service.SetCreatedInfo(platFollowup, s.GetCxtUserId(), s.GetCxtUserName())
 	// 填充更新信息
 	//service.SetUpdatedInfo(platFollowup, s.GetCxtUserId(), s.GetCxtUserName())
-	Model := s.Dao.M
-	res, err := Model.Insert(platFollowup)
+	res, err := s.Dao.Insert(platFollowup)
 	if err != nil {
 		return
 	}

+ 1 - 2
opms_parent/app/service/plat/plat_followup_comment.go

@@ -56,8 +56,7 @@ func (s *followupCommentService) Create(req *model.AddPlatFollowupCommentReq) (e
 	service.SetCreatedInfo(platFollowupComment, s.GetCxtUserId(), s.GetCxtUserName())
 	// 填充更新信息
 	//service.SetUpdatedInfo(platFollowupComment, s.GetCxtUserId(), s.GetCxtUserName())
-	Model := s.Dao.M
-	_, err = Model.Insert(platFollowupComment)
+	_, err = s.Dao.Insert(platFollowupComment)
 	if err != nil {
 		return
 	}

+ 205 - 24
opms_parent/app/service/plat/plat_task.go

@@ -32,35 +32,44 @@ func NewTaskService(ctx context.Context) (svc *taskService, err error) {
 }
 
 // 任务信息列表
-func (s *taskService) GetList(req *model.SearchPlatTaskReq) (total int, TaskList []*model.PlatTask, err error) {
-	TaskModel := s.Dao.M
+func (s *taskService) GetList(req *model.SearchPlatTaskReq) (total int, TaskList []*model.PlatTaskEx, err error) {
+	TaskModel := s.Dao.InnerJoin("plat_task_handle", "plat_task_handle.task_id=plat_task.id")
 	if req.TaskTitle != "" {
-		TaskModel = TaskModel.Where("task_title LIKE ?", "%"+req.TaskTitle+"%")
+		TaskModel = TaskModel.Where("plat_task.task_title LIKE ?", "%"+req.TaskTitle+"%")
 	}
 	if req.TaskType != "" {
-		TaskModel = TaskModel.Where("task_type", req.TaskType)
+		TaskModel = TaskModel.Where("plat_task.task_type", req.TaskType)
 	}
 	if req.TaskStatus != "" {
-		TaskModel = TaskModel.Where("task_status", req.TaskStatus)
+		TaskModel = TaskModel.Where("plat_task.task_status", req.TaskStatus)
 	}
 	if req.IsOverdue != "" {
-		TaskModel = TaskModel.Where("is_overdue", req.IsOverdue)
+		TaskModel = TaskModel.Where("plat_task.is_overdue", req.IsOverdue)
 	}
 	if req.MainUserId != "" {
-		TaskModel = TaskModel.Where("main_user_id", req.MainUserId)
+		TaskModel = TaskModel.Where("plat_task.main_user_id", req.MainUserId)
 	}
 	if req.TargetId != "" {
-		TaskModel = TaskModel.Where("target_id", req.TargetId)
+		TaskModel = TaskModel.Where("plat_task.target_id", req.TargetId)
 	}
 	if req.TargetType != "" {
-		TaskModel = TaskModel.Where("target_type", req.TargetType)
+		TaskModel = TaskModel.Where("plat_task.target_type", req.TargetType)
 	}
 	if req.MySelf == "1" {
-		TaskModel = TaskModel.Where("created_by", s.GetCxtUserId())
+		TaskModel = TaskModel.Where("plat_task.created_by", s.GetCxtUserId())
 	}
 	if req.IsMain == "1" {
-		TaskModel = TaskModel.Where("main_user_id", s.GetCxtUserId())
+		TaskModel = TaskModel.Where("plat_task.main_user_id", s.GetCxtUserId())
 	}
+	if req.OperateType == "1" {
+		TaskModel = TaskModel.Where(fmt.Sprintf("plat_task_handle.task_status='10' AND (plat_task_handle.main_user_id=%v OR FIND_IN_SET(%v, plat_task_handle.owner_user_id))", s.GetCxtUserId(), s.GetCxtUserId()))
+	} else if req.OperateType == "2" {
+		TaskModel = TaskModel.Where("plat_task.created_by", s.GetCxtUserId())
+	} else if req.OperateType == "3" {
+		TaskModel = TaskModel.Where(fmt.Sprintf("plat_task_handle.task_status='20' AND plat_task_handle.handle_user_id=%v", s.GetCxtUserId()))
+	}
+	TaskModel.Group("plat_task.id")
+
 	total, err = TaskModel.Count()
 	if err != nil {
 		g.Log().Error(err)
@@ -68,7 +77,7 @@ func (s *taskService) GetList(req *model.SearchPlatTaskReq) (total int, TaskList
 		return
 	}
 
-	err = TaskModel.Page(req.PageNum, req.PageSize).Order("created_time DESC").Scan(&TaskList)
+	err = TaskModel.Page(req.GetPage()).Order("plat_task.created_time DESC").Fields("plat_task.*,plat_task_handle.step").Scan(&TaskList)
 	return
 }
 
@@ -172,17 +181,11 @@ func (s *taskService) Export(req *model.ExportReq) (content *model.ExportContent
 func (s *taskService) Statistics(req *model.SearchPlatTaskReq) (*model.TaskNumberCount, error) {
 	var result model.TaskNumberCount
 	// 统计数量
-	err := s.Dao.M.Fields(fmt.Sprintf("SUM(main_user_id='%v' AND task_status='10') ToDoNumber, SUM(main_user_id='%v' AND task_status='20') CompletedNumber, SUM(created_by='%v') CreateNumber", s.GetCxtUserId(), s.GetCxtUserId(), s.GetCxtUserId())).Scan(&result)
+	count, err := s.Dao.InnerJoin("plat_task_handle", "plat_task.Id=plat_task_handle.task_id").Where(fmt.Sprintf("plat_task_handle.task_status='10' AND (plat_task_handle.main_user_id=%v OR FIND_IN_SET(%v, plat_task_handle.owner_user_id))", s.GetCxtUserId(), s.GetCxtUserId())).Group("plat_task.Id").Count()
 	if err != nil {
-		if err == sql.ErrNoRows {
-			result.CompletedNumber = 0
-			result.CreateNumber = 0
-			result.ToDoNumber = 0
-			return &result, nil
-		} else {
-			return nil, err
-		}
+		return nil, err
 	}
+	result.ToDoNumber = count
 
 	return &result, nil
 }
@@ -201,13 +204,19 @@ func (s *taskService) Create(req *model.AddPlatTaskReq) (err error) {
 	service.SetCreatedInfo(platTask, s.GetCxtUserId(), s.GetCxtUserName())
 	// 填充更新信息
 	//service.SetUpdatedInfo(platTask, s.GetCxtUserId(), s.GetCxtUserName())
-	Model := s.Dao.M
-	res, err := Model.Insert(platTask)
+	res, err := s.Dao.Insert(platTask)
 	if err != nil {
 		return
 	}
-	// 流程日志
+	// 创建操作任务
 	id, _ := res.LastInsertId()
+	platTask.Id = int(id)
+	nextHandle := createNextTaskHandel(s, platTask, 10)
+	_, err = s.Dao.DB.Model("plat_task_handle").Insert(nextHandle)
+	if err != nil {
+		return
+	}
+	// 流程日志
 	err = CreateTaskLog(s, nil, int(id), s.GetCxtUserId(), s.GetCxtUserName(), "创建督办", "创建督办成功", "")
 
 	return
@@ -258,6 +267,154 @@ func (s *taskService) ChangeStatus(req *model.ChangeStatusReq) (err error) {
 	return
 }
 
+//步骤号(10接收  15暂存  20提交  30审批(督办人)  40评价(监办人))
+// 督办任务处理
+func (s *taskService) Handle(req *model.HandleReq) (err error) {
+	// 步骤号(10接收  15暂存  20提交  30审批(督办人)  40评价(监办人))
+	logNodeName := ""
+	logDesc := ""
+	var taskHandle model.PlatTaskHandle
+	err = s.Dao.DB.Model("plat_task_handle").Where(fmt.Sprintf("task_id='%v' AND step=%v AND task_status='10' AND (main_user_id=%v OR FIND_IN_SET(%v, owner_user_id))", req.Step, req.TaskId, s.GetCxtUserId(), s.GetCxtUserId())).Scan(&taskHandle)
+	if err != nil {
+		if err == sql.ErrNoRows {
+			return fmt.Errorf("数据不匹配,刷新数据重试")
+		}
+		return err
+	}
+	now := gtime.Now()
+	// 数据暂存,不做任何流程修改
+	if req.Step == 15 {
+		// 暂存
+		logNodeName = "暂存"
+		logDesc = s.GetCxtUserName() + "暂存进展信息"
+		// 1 标记删除旧的进展数据
+		_, err = s.Dao.DB.Model("plat_task_progress").Update(fmt.Sprintf("deleted_time='%v'", now.Format("Y-m-d H:i:s")), fmt.Sprintf("task_id='%v'", req.TaskId))
+		if err != nil {
+			return err
+		}
+		// 2 保存新的数据
+		_, err = s.Dao.DB.Model("plat_task_progress").Save(req.ProgressList)
+		if err != nil {
+			return err
+		}
+	} else {
+		var nextHandle = new (model.PlatTaskHandle)
+		task, err := s.Dao.Where("id", req.TaskId).FindOne()
+		if err != nil {
+			return err
+		}
+		// 构造更新数据
+		handleData := g.Map{
+			"task_status":      "20",
+			"handle_user_id":   s.GetCxtUserId(),
+			"handle_date":   	now.Format("Y-m-d H:i:s"),
+			"handle_status":    req.HandleStatus,
+			"handle_desc":      req.HandleDesc,
+			"updated_by":       s.GetCxtUserId(),
+			"updated_name":     s.GetCxtUserName(),
+			"updated_time":     now.Format("Y-m-d H:i:s"),
+		}
+		taskData := g.Map{
+			"updated_by":      s.GetCxtUserId(),
+			"updated_name":    s.GetCxtUserName(),
+			"updated_time":    now.Format("Y-m-d H:i:s"),
+		}
+		// 督办任务接收
+		if req.Step == 10 {
+			// 接收任务
+			taskData["task_status"] = "20"
+			taskData["receive_date"] = now.Format("Y-m-d H:i:s")
+			nextHandle = createNextTaskHandel(s, task, 20)
+			logNodeName = "接收"
+			logDesc = s.GetCxtUserName() + "接收督办任务"
+		} else if req.Step == 20 {
+			// 提交数据
+			nextHandle = createNextTaskHandel(s, task, 30)
+			logNodeName = "提交"
+			logDesc = s.GetCxtUserName() + "提交督办任务"
+			// 更新进展数据
+			for index, progress := range req.ProgressList {
+				// 填充创建信息
+				if progress.CreatedBy == 0 {
+					service.SetCreatedInfo(req.ProgressList[index], s.GetCxtUserId(), s.GetCxtUserName())
+				}
+				//	填充更新信息
+				service.SetUpdatedInfo(req.ProgressList[index], s.GetCxtUserId(), s.GetCxtUserName())
+			}
+			// 保存督办进展
+			// 1 标记删除旧的进展数据
+			_, err = s.Dao.DB.Model("plat_task_progress").Update(fmt.Sprintf("deleted_time='%v'", now.Format("Y-m-d H:i:s")), fmt.Sprintf("task_id='%v'", req.TaskId))
+			if err != nil {
+				return err
+			}
+			// 2 保存新的数据
+			_, err = s.Dao.DB.Model("plat_task_progress").Save(req.ProgressList)
+			if err != nil {
+				return err
+			}
+
+		} else if req.Step == 30 {
+			// 督办人审批
+			taskData["approver_id"] = s.GetCxtUserId()
+			taskData["appro_date"] = now.Format("Y-m-d H:i:s")
+			taskData["appro_status"] = req.HandleStatus
+			taskData["appro_desc"] = req.HandleDesc
+			logNodeName = "审批"
+			if req.HandleStatus == "审批通过" {
+				logDesc = s.GetCxtUserName() + "审批通过"
+				nextHandle = createNextTaskHandel(s, task, 40)
+			} else if req.HandleStatus == "审批退回" {
+				logDesc = s.GetCxtUserName() + "审批退回"
+				nextHandle = createNextTaskHandel(s, task, 20)
+			}
+		} else if req.Step == 40 {
+			// 监办人评价
+			taskData["evaluator_id"] = s.GetCxtUserId()
+			taskData["evaluate_date"] = now.Format("Y-m-d H:i:s")
+			taskData["evaluate_status"] = req.HandleStatus
+			taskData["evaluate_desc"] = req.HandleDesc
+			logNodeName = "评价"
+			if req.HandleStatus == "审批通过" {
+				// 监办人评价,审批通过,任务结束
+				logDesc = s.GetCxtUserName() + "审批通过"
+				nextHandle = nil
+				taskData["actual_close_date"] = now.Format("Y-m-d H:i:s")
+				taskData["task_status"] = "30"
+			} else if req.HandleStatus == "审批退回" {
+				logDesc = s.GetCxtUserName() + "审批通过"
+				nextHandle = createNextTaskHandel(s, task, 20)
+			}
+		}
+
+		// 更新数据
+		// 更新督办任务数据
+		_, err = s.Dao.Update(taskData, fmt.Sprintf("id='%v'", req.TaskId))
+		if err != nil {
+			return err
+		}
+		// 更新任务数据
+		_, err = s.Dao.DB.Model("plat_task_handle").Update(handleData, fmt.Sprintf("ID='%v'", taskHandle.ID))
+		if err != nil {
+			return err
+		}
+		// 创建下一条任务
+		if nextHandle != nil {
+			_, err = s.Dao.DB.Model("plat_task_handle").Save(nextHandle)
+			if err != nil {
+				return err
+			}
+		}
+	}
+
+	// 流程日志
+	err = CreateTaskLog(s, nil, req.TaskId, s.GetCxtUserId(), s.GetCxtUserName(), logNodeName, logDesc, "")
+	if err != nil {
+		return err
+	}
+
+	return fmt.Errorf("未知步骤,无法操作")
+}
+
 // 任务日志创建方法
 func CreateTaskLog(s1 *taskService, s2 *taskProgressService, taskId, userId int, userName, nodeName, desc, remark string) (err error) {
 	var log model.PlatTaskLog
@@ -301,3 +458,27 @@ func CreateTaskLog(s1 *taskService, s2 *taskProgressService, taskId, userId int,
 
 	return err
 }
+
+// 创建个人的督办任务(其中,暂存不会生成个人任务,不会改变任何东西,只会新增一条日志)
+func createNextTaskHandel(s *taskService, task *model.PlatTask, step int) *model.PlatTaskHandle {
+	// 步骤号(10接收  15暂存  20提交  30审批(督办人)  40评价(监办人))
+	var personTask model.PlatTaskHandle
+	personTask.TaskId = task.Id
+	personTask.TaskStatus = "10"
+	personTask.Step = step
+	// 督办任务为发起时
+	if step == 10 {
+		personTask.MainUserId = task.MainUserId
+		personTask.OwnerUserId = task.OwnerUserId
+	} else if step == 20 {
+		// 提交给督办人审批
+		personTask.MainUserId = task.SupervisorUserId
+	} else if step == 30 {
+		// 提交给监办人评价
+		personTask.MainUserId = task.WatchUserId
+	}
+	// 填充创建信息
+	service.SetCreatedInfo(&personTask, s.GetCxtUserId(), s.GetCxtUserName())
+
+	return &personTask
+}

+ 1 - 2
opms_parent/app/service/plat/plat_task_comment.go

@@ -56,8 +56,7 @@ func (s *taskCommentService) Create(req *model.AddPlatTaskCommentReq) (err error
 	service.SetCreatedInfo(platTaskComment, s.GetCxtUserId(), s.GetCxtUserName())
 	// 填充更新信息
 	//service.SetUpdatedInfo(platTaskComment, s.GetCxtUserId(), s.GetCxtUserName())
-	Model := s.Dao.M
-	_, err = Model.Insert(platTaskComment)
+	_, err = s.Dao.Insert(platTaskComment)
 	if err != nil {
 		return
 	}

+ 1 - 2
opms_parent/app/service/plat/plat_task_progress.go

@@ -53,8 +53,7 @@ func (s *taskProgressService) Create(req *model.AddPlatTaskProgressReq) (err err
 	service.SetCreatedInfo(platTaskProgress, s.GetCxtUserId(), s.GetCxtUserName())
 	// 填充更新信息
 	//service.SetUpdatedInfo(platTaskProgress, s.GetCxtUserId(), s.GetCxtUserName())
-	Model := s.Dao.M
-	_, err = Model.Insert(platTaskProgress)
+	_, err = s.Dao.Insert(platTaskProgress)
 	if err != nil {
 		return
 	}