Ver código fonte

feat: 推送文案调整

zhangxinlei1996 1 ano atrás
pai
commit
adf72331c2
5 arquivos alterados com 47 adições e 41 exclusões
  1. 6 3
      api/etc/push.yaml
  2. 6 5
      api/internal/config/config.go
  3. 5 5
      service/custom.go
  4. 15 15
      service/sale_chance.go
  5. 15 13
      service/sale_clue.go

+ 6 - 3
api/etc/push.yaml

@@ -5,7 +5,8 @@ TestId: "6103bb722abfa5f4d81bb1d1"
 SaleClue:
   Create:
     Title: "创建销售线索通知"
-    Content: "%s于%s创建销售线索"
+    MySelfContent: "%s于%s创建销售线索,下次跟进时间为%s。"
+    TransferContent: "%s于%s创建销售线索,并将其转办给您,下次跟进时间为%s。"
     MyselfPcHref: "/succbi/crm_system/app/crm.app/task_follow/task_follow_up.spg?E_position_id=%v&E_control_editing=1&E_task_id=%v&E_cust_oppo_lead=%v"
     TransferPcHref: "/succbi/crm_system/app/crm.app/task_management.spg?E_position_id=%v&E_control_editing=1"
     MobileHref: "/jy_mobile/message/msgGuide"
@@ -17,7 +18,8 @@ SaleClue:
 SaleChance:
   Create:
     Title: "创建销售机会通知"
-    Content: "%s于%s创建销售机会%s"
+    MySelfContent: "%s于%s创建销售机会,下次跟进时间为%s。"
+    TransferContent: "%s于%s创建销售机会,并将其转办给您,下次跟进时间为%s。"
     MyselfPcHref: "/succbi/crm_system/app/crm.app/task_follow/task_follow_up.spg?E_position_id=%v&E_control_editing=1&E_task_id=%v&E_cust_oppo_lead=%v"
     TransferPcHref: "/succbi/crm_system/app/crm.app/task_management.spg?E_position_id=%v&E_control_editing=1"
     MobileHref: "/jy_mobile/message/msgGuide"
@@ -29,7 +31,8 @@ SaleChance:
 Custom:
   Create:
     Title: "创建客户通知"
-    Content: "%s于%s创建客户%s"
+    MySelfContent: "%s于%s创建客户,下次跟进时间为%s。"
+    TransferContent: "%s于%s创建客户,并将其转办给您,下次跟进时间为%s。"
     MyselfPcHref: "/succbi/crm_system/app/crm.app/task_follow/task_follow_up.spg?E_position_id=%v&E_control_editing=1&E_task_id=%v&E_cust_oppo_lead=%v"
     TransferPcHref: "/succbi/crm_system/app/crm.app/task_management.spg?E_position_id=%v&E_control_editing=1"
     MobileHref: "/jy_mobile/message/msgGuide"

+ 6 - 5
api/internal/config/config.go

@@ -49,11 +49,12 @@ type Push struct {
 }
 
 type Create struct {
-	Title          string
-	Content        string
-	MyselfPcHref   string
-	TransferPcHref string
-	MobileHref     string
+	Title           string
+	MySelfContent   string
+	TransferContent string
+	MyselfPcHref    string
+	TransferPcHref  string
+	MobileHref      string
 }
 
 type Due struct {

+ 5 - 5
service/custom.go

@@ -122,17 +122,17 @@ func (this *CustomService) Add(ctx context.Context) (int64, string) {
 		userId := strings.TrimRight(kb.String(), ",")
 		positionId := strings.TrimRight(vb.String(), ",")
 
-		nexttime := ""
-		if this.NextfollowUpTime != 0 {
-			nexttime = strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)
-		}
-		content := fmt.Sprintf(cm.Push.Custom.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), nexttime)
+		next := strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)
 
 		pcHref := ""
+		content := ""
 		if this.Types == 1 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, customId)
+			content = fmt.Sprintf(cm.Push.Custom.Create.MySelfContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
+
 		} else if this.Types == 2 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, positionId)
+			content = fmt.Sprintf(cm.Push.Custom.Create.TransferContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		}
 
 		StationMailPush(userId, positionId, cm.Push.Custom.Create.Title, content, pcHref, cm.Push.Custom.Create.MobileHref)

+ 15 - 15
service/sale_chance.go

@@ -104,16 +104,16 @@ func (this *SaleChanceService) Add(ctx context.Context) (int64, string) {
 		}
 		baseUserIdArr = append(baseUserIdArr, this.BaseUserId)
 
-		//自办 创建 群聊
-		gp := &Group{
-			EntId:      this.EntId,
-			PositionId: this.PositionId,
-			UserIdArr:  []int64{},
-			AppId:      this.AppId,
-			EntUserId:  this.EntUserId,
-			AccountId:  this.AccountId,
-		}
-		groupId = gp.GroupAdd()
+		// //自办 创建 群聊
+		// gp := &Group{
+		// 	EntId:      this.EntId,
+		// 	PositionId: this.PositionId,
+		// 	UserIdArr:  []int64{},
+		// 	AppId:      this.AppId,
+		// 	EntUserId:  this.EntUserId,
+		// 	AccountId:  this.AccountId,
+		// }
+		// groupId = gp.GroupAdd()
 	}
 
 	u := &User{BaseUserIds: baseUserIdArr}
@@ -125,17 +125,17 @@ func (this *SaleChanceService) Add(ctx context.Context) (int64, string) {
 		vb.WriteString(gconv.String(v) + ",")
 		userId := strings.TrimRight(kb.String(), ",")
 		positionId := strings.TrimRight(vb.String(), ",")
-		nexttime := ""
-		if this.NextfollowUpTime != 0 {
-			nexttime = strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)
-		}
-		content := fmt.Sprintf(cm.Push.SaleChance.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), nexttime)
 
+		next := strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)
+		content := ""
 		pcHref := ""
 		if this.Types == 1 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, chanceId)
+			content = fmt.Sprintf(cm.Push.SaleChance.Create.MySelfContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
+
 		} else if this.Types == 2 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, positionId)
+			content = fmt.Sprintf(cm.Push.SaleChance.Create.TransferContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		}
 
 		StationMailPush(userId, positionId, cm.Push.SaleChance.Create.Title, content, pcHref, cm.Push.SaleChance.Create.MobileHref)

+ 15 - 13
service/sale_clue.go

@@ -68,9 +68,7 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 			}
 			transferArr = append(transferArr, resp.PositionId)
 			baseUserIdArr = append(baseUserIdArr, resp.UserId)
-			//查询mgo
 		}
-
 		//线索
 		args = append(args, this.PositionId, this.EntId, this.EntUserId, this.ClueName, this.CluesSource, this.Summary, this.EmployInfoId, 0, nowtime, this.CreateName)
 		//任务
@@ -95,15 +93,15 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 		baseUserIdArr = append(baseUserIdArr, this.BaseUserId)
 
 		//自办 创建 群聊
-		gp := &Group{
-			EntId:      this.EntId,
-			PositionId: this.PositionId,
-			UserIdArr:  []int64{},
-			AppId:      this.AppId,
-			EntUserId:  this.EntUserId,
-			AccountId:  this.AccountId,
-		}
-		groupId = gp.GroupAdd()
+		// gp := &Group{
+		// 	EntId:      this.EntId,
+		// 	PositionId: this.PositionId,
+		// 	UserIdArr:  []int64{},
+		// 	AppId:      this.AppId,
+		// 	EntUserId:  this.EntUserId,
+		// 	AccountId:  this.AccountId,
+		// }
+		// groupId = gp.GroupAdd()
 	}
 	u := &User{BaseUserIds: baseUserIdArr}
 
@@ -114,13 +112,17 @@ func (this *SaleClueService) Add(ctx context.Context) (int64, string) {
 		vb.WriteString(gconv.String(v) + ",")
 		userId := strings.TrimRight(kb.String(), ",")
 		positionId := strings.TrimRight(vb.String(), ",")
-		pcHref := ""
+		content, pcHref := "", ""
+		next := strings.Replace(time.Unix(this.FollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)
+
 		if this.Types == 1 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.MyselfPcHref, positionId, taskId, clueId)
+			content = fmt.Sprintf(cm.Push.SaleClue.Create.MySelfContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		} else if this.Types == 2 {
 			pcHref = fmt.Sprintf(cm.Push.SaleClue.Create.TransferPcHref, positionId)
+			content = fmt.Sprintf(cm.Push.SaleClue.Create.TransferContent, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), next)
 		}
-		StationMailPush(userId, positionId, cm.Push.SaleClue.Create.Title, fmt.Sprintf(cm.Push.SaleClue.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1)), pcHref, cm.Push.SaleClue.Create.MobileHref)
+		StationMailPush(userId, positionId, cm.Push.SaleClue.Create.Title, content, pcHref, cm.Push.SaleClue.Create.MobileHref)
 	}
 	return 1, groupId
 }