Browse Source

feat: 消息跳转

zhangxinlei1996 1 năm trước cách đây
mục cha
commit
e4b4525867
3 tập tin đã thay đổi với 15 bổ sung4 xóa
  1. 2 2
      api/etc/push.yaml
  2. 7 1
      service/custom.go
  3. 6 1
      service/sale_chance.go

+ 2 - 2
api/etc/push.yaml

@@ -16,7 +16,7 @@ SaleClue:
 SaleChance:
   Create:
     Title: "创建销售机会通知"
-    Content: "%s于%s创建销售机会,下次跟进时间为%s"
+    Content: "%s于%s创建销售机会%s"
     PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/Chance_part/opportunity_Information_max.spg?E_position_id=%v&E_task_id=%v&E_cust_oppo_lead=%v&E_control_editing=1"
     MobileHref: "/jy_mobile/message/msgGuide"
   Due:
@@ -27,7 +27,7 @@ SaleChance:
 Custom:
   Create:
     Title: "创建客户通知"
-    Content: "%s于%s创建客户,下次跟进时间为%s"
+    Content: "%s于%s创建客户%s"
     PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/Customer_part/customer_information_max.spg?E_position_id=%v&E_task_id=%v&E_cust_oppo_lead=%v&E_control_editing=1"
     MobileHref: "/jy_mobile/message/msgGuide"
   Due:

+ 7 - 1
service/custom.go

@@ -107,7 +107,13 @@ func (this *CustomService) Add(ctx context.Context) int64 {
 		vb.WriteString(gconv.String(v) + ",")
 		userId := strings.TrimRight(kb.String(), ",")
 		positionId := strings.TrimRight(vb.String(), ",")
-		StationMailPush(userId, positionId, cm.Push.Custom.Create.Title, fmt.Sprintf(cm.Push.Custom.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)), fmt.Sprintf(cm.Push.Custom.Create.PcHref, positionId, taskId, customId), cm.Push.Custom.Create.MobileHref)
+
+		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)
+		StationMailPush(userId, positionId, cm.Push.Custom.Create.Title, content, fmt.Sprintf(cm.Push.Custom.Create.PcHref, positionId, taskId, customId), cm.Push.Custom.Create.MobileHref)
 	}
 
 	return 1

+ 6 - 1
service/sale_chance.go

@@ -110,7 +110,12 @@ func (this *SaleChanceService) Add(ctx context.Context) int64 {
 		vb.WriteString(gconv.String(v) + ",")
 		userId := strings.TrimRight(kb.String(), ",")
 		positionId := strings.TrimRight(vb.String(), ",")
-		StationMailPush(userId, positionId, cm.Push.SaleChance.Create.Title, fmt.Sprintf(cm.Push.SaleChance.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1), strings.Replace(time.Unix(this.NextfollowUpTime, 0).Format(YYYYMMDDHHMM), " ", "%20", -1)), fmt.Sprintf(cm.Push.SaleChance.Create.PcHref, positionId, taskId, chanceId), cm.Push.SaleChance.Create.MobileHref)
+		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)
+		StationMailPush(userId, positionId, cm.Push.SaleChance.Create.Title, content, fmt.Sprintf(cm.Push.SaleChance.Create.PcHref, positionId, taskId, chanceId), cm.Push.SaleChance.Create.MobileHref)
 
 	}