瀏覽代碼

feat: 非必需参数

zhangxinlei1996 1 年之前
父節點
當前提交
c5b496f145
共有 3 個文件被更改,包括 8 次插入6 次删除
  1. 3 2
      service/custom.go
  2. 3 2
      service/sale_chance.go
  3. 2 2
      service/sale_clue.go

+ 3 - 2
service/custom.go

@@ -7,6 +7,7 @@ import (
 	"log"
 	"time"
 
+	qu "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
@@ -77,9 +78,9 @@ func (this *CustomService) Add(ctx context.Context) int64 {
 		}
 	} else if this.Types == 1 {
 		//客户
-		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.EmployInfoId, this.EmployCustomId, this.CustomType, this.CustomAllName, this.CustomAbbreviation, this.Summary, this.CustomLevel, this.CustomIndustry, this.CustomDetailIndustry, this.Province, this.City, this.District, this.Address, this.CompanyPhone, this.Remarks, this.CreateName, nowtime)
+		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.EmployInfoId, this.EmployCustomId, this.CustomType, this.CustomAllName, this.CustomAbbreviation, this.Summary, qu.If(this.CustomLevel == 0, nil, this.CustomLevel), this.CustomIndustry, this.CustomDetailIndustry, qu.If(this.Province == "", nil, this.Province), qu.If(this.City == "", nil, this.City), qu.If(this.District == "", nil, this.District), qu.If(this.Address == "", nil, this.Address), qu.If(this.CompanyPhone == "", nil, this.CompanyPhone), qu.If(this.Remarks == "", nil, this.Remarks), this.CreateName, nowtime)
 		//任务
-		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.CustomAllName+"的跟进任务", 3, this.PositionId, 1, nowtime, 1, nextFollowTime)
+		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.CustomAllName+"的跟进任务", 3, this.PositionId, 1, nowtime, 1, qu.If(this.NextfollowUpTime == 0, nil, nextFollowTime))
 		//存库
 		if !SaveCustom(ctx, args, argsTask, this.EmployInfoId, this.EmployCustomId, this.PositionId, this.CreateName) {
 			return 0

+ 3 - 2
service/sale_chance.go

@@ -7,6 +7,7 @@ import (
 	"log"
 	"time"
 
+	qu "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
@@ -78,9 +79,9 @@ func (this *SaleChanceService) Add(ctx context.Context) int64 {
 		}
 	} else if this.Types == 1 {
 		//线索
-		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.EmployInfoId, this.CustomId, this.BusinessType, this.ChanceName, this.Summary, this.ChanceClassify, expect_deal_time, this.ExpectedMoney, this.Remarks, nowtime)
+		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.EmployInfoId, this.CustomId, this.BusinessType, this.ChanceName, this.Summary, this.ChanceClassify, qu.If(this.ExpectedOrderTime == 0, nil, expect_deal_time), qu.If(this.ExpectedMoney == 0, nil, this.ExpectedMoney), qu.If(this.Remarks == "", nil, this.Remarks), nowtime)
 		//任务
-		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.ChanceName+"的跟进任务", 2, this.PositionId, 1, nowtime, 1, nextFollowTime)
+		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.ChanceName+"的跟进任务", 2, this.PositionId, 1, nowtime, 1, qu.If(this.NextfollowUpTime == 0, nil, nextFollowTime))
 		//存库
 		if !SaveChange(ctx, args, argsTask, argsFollowRecord, this.PositionId, this.BusinessType, this.CreateName) {
 			return 0

+ 2 - 2
service/sale_clue.go

@@ -7,6 +7,7 @@ import (
 	"log"
 	"time"
 
+	qu "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
@@ -33,7 +34,6 @@ type SaleClueService struct {
 //Add 创建线索
 func (this *SaleClueService) Add(ctx context.Context) int64 {
 	nowtime := time.Now().Format(date.Date_Full_Layout)
-	log.Println(this.FollowUpTime, time.Unix(this.FollowUpTime, 0))
 	nextFollowTime := time.Unix(this.FollowUpTime, 0).Format(date.Date_Full_Layout)
 	args := []interface{}{}
 	argsTask := []interface{}{}
@@ -69,7 +69,7 @@ func (this *SaleClueService) Add(ctx context.Context) int64 {
 		//线索
 		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))
 		//任务
-		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.ClueName+"的跟进任务", 1, this.PositionId, 1, nowtime, 1, nextFollowTime)
+		argsTask = append(argsTask, this.PositionId, this.EntId, this.EntUserId, this.ClueName+"的跟进任务", 1, this.PositionId, 1, nowtime, 1, qu.If(this.FollowUpTime == 0, nil, nextFollowTime))
 		//存库
 		if !Save(ctx, args, argsTask, argsFollowRecord, this.PositionId, this.CreateName) {
 			return 0