فهرست منبع

feat:创建线索增加来源

wangchuanjin 1 سال پیش
والد
کامیت
4f5e2b4792
5فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 1 0
      api/application.api
  2. 0 1
      api/internal/handler/routes.go
  3. 1 0
      api/internal/logic/clueaddlogic.go
  4. 1 0
      api/internal/types/types.go
  5. 4 3
      service/sale_clue.go

+ 1 - 0
api/application.api

@@ -29,6 +29,7 @@ type (
 		User         []int64 `json:"user,optional"`         //企业用户id
 		EmployInfoId int64   `json:"employInfoId,optional"` //资讯收录id
 		CreateName   string  `json:"createName"`            //创建人
+		Channel      string  `json:"channel"`               //来源
 	}
 
 	SaleChanceReq {

+ 0 - 1
api/internal/handler/routes.go

@@ -73,6 +73,5 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Handler: canAddReqHandler(serverCtx),
 			},
 		},
-		rest.WithMaxBytes(104857600),
 	)
 }

+ 1 - 0
api/internal/logic/clueaddlogic.go

@@ -43,6 +43,7 @@ func (l *ClueAddLogic) ClueAdd(req *types.ClueAddReq) (resp *types.Reply, err er
 		CreateName:   req.CreateName,
 		BaseUserId:   req.BaseUserId,
 		EntDeptId:    req.EntDeptId,
+		Channel:      req.Channel,
 	}
 	status, error_msg := service.CanAdd(req.EntId, "more_create_clue", req.EmployInfoId, 0, req.PositionId)
 	if status <= 0 {

+ 1 - 0
api/internal/types/types.go

@@ -30,6 +30,7 @@ type ClueAddReq struct {
 	User         []int64 `json:"user,optional"`         //企业用户id
 	EmployInfoId int64   `json:"employInfoId,optional"` //资讯收录id
 	CreateName   string  `json:"createName"`            //创建人
+	Channel      string  `json:"channel"`               //来源
 }
 
 type SaleChanceReq struct {

+ 4 - 3
service/sale_clue.go

@@ -37,6 +37,7 @@ type SaleClueService struct {
 	User         []int64
 	FollowUpTime int64
 	CreateName   string
+	Channel      string
 }
 
 //Add 创建线索
@@ -70,7 +71,7 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 			baseUserIdArr = append(baseUserIdArr, resp.UserId)
 		}
 		//线索
-		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.ClueName, this.CluesSource, this.Summary, this.EmployInfoId, 0, nowtime, this.CreateName)
+		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.ClueName, this.CluesSource, this.Summary, this.EmployInfoId, 0, nowtime, this.CreateName, this.Channel)
 		//任务
 		argsTask = append(argsTask, this.EntId, this.ClueName+"的跟进任务", 1, this.PositionId, 1, nowtime, 1, 0, qu.If(this.FollowUpTime == 0, nil, nextFollowTime), nil, nil)
 		clueId, taskId = Save(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, 0, this.PositionId, this.CreateName, transferArr, this.EntId, this.EntUserId, this.EntDeptId)
@@ -79,7 +80,7 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 		}
 	} else if this.Types == 1 {
 		//线索
-		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.ClueName, this.CluesSource, this.Summary, this.EmployInfoId, 0, time.Now().Format(date.Date_Full_Layout), this.CreateName)
+		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.ClueName, this.CluesSource, this.Summary, this.EmployInfoId, 0, time.Now().Format(date.Date_Full_Layout), this.CreateName, this.Channel)
 		//任务
 
 		argsTask = append(argsTask, this.EntId, this.ClueName+"的跟进任务", 1, this.PositionId, 2, nowtime, 1, 0, qu.If(this.FollowUpTime == 0, nil, nextFollowTime), nil, nil)
@@ -129,7 +130,7 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 
 //SaleClueAdd 线索存储
 func SaleClueAdd(tx *sql.Tx, args []interface{}) int64 {
-	fields := []string{"position_id", "ent_id", "ent_user_id", "name", "source", "summary", "employ_info_id", "is_close", "create_time", "create_person"}
+	fields := []string{"position_id", "ent_id", "ent_user_id", "name", "source", "summary", "employ_info_id", "is_close", "create_time", "create_person", "channel"}
 	_, id := cm.CrmMysql.InsertBatchByTx(tx, entity.SALE_CLUE, fields, args)
 	return id
 }