瀏覽代碼

feat: bi页面跳转

zhangxinlei1996 1 年之前
父節點
當前提交
da9778e528
共有 6 個文件被更改,包括 35 次插入33 次删除
  1. 6 6
      api/etc/push.yaml
  2. 1 1
      api/internal/logic/pushmsglogic.go
  3. 3 2
      api/timetask/timetask.go
  4. 9 8
      service/custom.go
  5. 8 8
      service/sale_chance.go
  6. 8 8
      service/sale_clue.go

+ 6 - 6
api/etc/push.yaml

@@ -6,34 +6,34 @@ SaleClue:
   Create:
     Title: "创建销售线索通知"
     Content: "%s于%s创建销售线索"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/Clue_part/clue_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:
     Title: "销售线索跟进任务即将到期提醒"
     Content: "%s即将到期,请及时跟进。"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/Clue_part/clue_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"
 SaleChance:
   Create:
     Title: "创建销售机会通知"
     Content: "%s于%s创建销售机会,下次跟进时间为%s"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    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:
     Title: "销售机会跟进任务即将到期提醒"
     Content: "%s即将到期,请及时跟进。"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    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"
 Custom:
   Create:
     Title: "创建客户通知"
     Content: "%s于%s创建客户,下次跟进时间为%s"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    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:
     Title: "客户跟进任务即将到期提醒"
     Content: "%s即将到期,请及时跟进。"
-    PcHref: "/succbi/crm_system/app/crm.app/task_follow/Intermediate_part/middle_opp_project.spg?E_chance_id=%v"
+    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"
 #PushTime: "0 0 8 * * *"
 PushTime: "0 50 13 * * *"

+ 1 - 1
api/internal/logic/pushmsglogic.go

@@ -46,7 +46,7 @@ func (l *PushMsgLogic) PushMsg(req *types.PushMsgReq) (resp *types.Reply, err er
 		baseUserIdArr = append(baseUserIdArr, resp.UserId)
 		//查询mgo
 	}
-	u := &service.User{
+	u := &service.User{ 
 		BaseUserIds: baseUserIdArr,
 	}
 	m := u.GetUserId(req.EntId)

+ 3 - 2
api/timetask/timetask.go

@@ -45,6 +45,7 @@ func sendMess() {
 		cm.CrmMysql.SelectByBath(500, func(l *[]map[string]interface{}) bool {
 			for _, v := range *l {
 				name := gconv.String(v["name"])
+				taskId := gconv.Int(v["id"])
 				positionId := gconv.Int64(v["position_id"])
 				source := gconv.Int(v["source"]) //1:线索 2:机会 3:客户
 				sourceId := gconv.Int(v["source_id"])
@@ -73,11 +74,11 @@ func sendMess() {
 				}
 				m := user.GetUserId(resp.EntId)
 				for k, v := range m {
-					service.StationMailPush(k, gconv.String(v), strings.Replace(title, " ", "%20", -1), strings.Replace(fmt.Sprintf(content, name), " ", "%20", -1), fmt.Sprintf(pcHref, sourceId), mobileHref)
+					service.StationMailPush(k, gconv.String(v), strings.Replace(title, " ", "%20", -1), strings.Replace(fmt.Sprintf(content, name), " ", "%20", -1), fmt.Sprintf(pcHref, gconv.String(v), taskId, sourceId), mobileHref)
 				}
 			}
 			return true
-		}, `select a.name,b.position_id,a.source,a.source_id from task a left join task_team b on (a.id =b.task_id and b.role=1)
+		}, `select a.id,a.name,b.position_id,a.source,a.source_id from task a left join task_team b on (a.id =b.task_id and b.role=1)
 			where a.status!=3 and a.next_follow_time >= ? and a.next_follow_time < ?`, st, et)
 
 		log.Println("end cron")

+ 9 - 8
service/custom.go

@@ -54,7 +54,7 @@ func (this *CustomService) Add(ctx context.Context) int64 {
 	//判断处理方式
 	//转办
 	baseUserIdArr := []int64{}
-	customId := int64(-1)
+	customId, taskId := int64(-1), int64(-1)
 
 	if this.Types == 2 {
 		transferArr := []int64{}
@@ -79,19 +79,19 @@ func (this *CustomService) Add(ctx context.Context) int64 {
 		//任务
 		argsTask = append(argsTask, this.EntId, this.CustomAllName+"的跟进任务", 3, this.PositionId, 1, nowtime, 1, 0, qu.If(this.NextfollowUpTime == 0, nil, nextFollowTime))
 
-		customId = SaveCustom(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.EmployCustomId, this.PositionId, this.CreateName, transferArr)
+		customId, taskId = SaveCustom(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.EmployCustomId, this.PositionId, this.CreateName, transferArr)
 		if customId < 0 {
 			return -1
 		}
 	} 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, 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)
-		//任务
+		//任务s
 		argsTask = append(argsTask, this.EntId, this.CustomAllName+"的跟进任务", 3, this.PositionId, 2, nowtime, 1, 0, qu.If(this.NextfollowUpTime == 0, nil, nextFollowTime))
 		//任务团队
 		argsTaskTeam = append(argsTaskTeam, this.PositionId, this.EntUserId, this.CreateName, 1, nowtime)
 		//存库
-		customId = SaveCustom(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.EmployCustomId, this.PositionId, this.CreateName, []int64{})
+		customId, taskId = SaveCustom(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.EmployCustomId, this.PositionId, this.CreateName, []int64{})
 		if customId < 0 {
 			return -1
 		}
@@ -106,7 +106,7 @@ 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, customId), cm.Push.Custom.Create.MobileHref)
+		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)
 	}
 
 	return 1
@@ -136,8 +136,9 @@ func EmployUpdate(tx *sql.Tx, employ_info_id, employ_custom_id, positionId int64
 	return cm.CrmMysql.UpdateByTx(tx, tablename, map[string]interface{}{"id": id, "position_id": positionId}, map[string]interface{}{key: 1})
 }
 
-func SaveCustom(ctx context.Context, argsCustom, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId int64, createPerson string, transferArr []int64) int64 {
+func SaveCustom(ctx context.Context, argsCustom, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId int64, createPerson string, transferArr []int64) (int64, int64) {
 	customId := int64(-1)
+	taskId := int64(-1)
 	//存库
 	cm.CrmMysql.ExecTx("创建客户", func(tx *sql.Tx) bool {
 		//插入客户
@@ -145,7 +146,7 @@ func SaveCustom(ctx context.Context, argsCustom, argsTask, argsTaskTeam []interf
 		//传过来的argTask没有来源id,需要append
 		argsTask = append(argsTask, customId)
 		//任务车存储
-		taskId := TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
+		taskId = TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
 		ok := EmployUpdate(tx, employ_info_id, employ_custom_id, positionId, "is_create_custom")
 		//插入台账
 		ok2 := SaveLedger(ctx, positionId, customId, taskId, "创建客户", fmt.Sprintf("%s创建了客户", createPerson), createPerson)
@@ -155,7 +156,7 @@ func SaveCustom(ctx context.Context, argsCustom, argsTask, argsTaskTeam []interf
 		log.Println("SaveCustom err:", customId, taskId, ok)
 		return false
 	})
-	return customId
+	return customId, taskId
 }
 
 //SaveLedger 操作台帐相关

+ 8 - 8
service/sale_chance.go

@@ -52,7 +52,7 @@ func (this *SaleChanceService) Add(ctx context.Context) int64 {
 	nextFollowTime := time.Unix(this.NextfollowUpTime, 0).Format(date.Date_Full_Layout)
 
 	baseUserIdArr := []int64{}
-	chanceId := int64(-1)
+	chanceId, taskId := int64(-1), int64(-1)
 	//判断处理方式
 	//转办
 	if this.Types == 2 {
@@ -77,7 +77,7 @@ func (this *SaleChanceService) Add(ctx context.Context) int64 {
 		//任务
 		argsTask = append(argsTask, this.EntId, this.ChanceName+"的跟进任务", 2, this.PositionId, 1, nowtime, 1, 0, qu.If(this.NextfollowUpTime == 0, nil, nextFollowTime))
 
-		chanceId = SaveChange(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.CustomId, this.PositionId, this.BusinessType, this.CreateName, transferArr)
+		chanceId, taskId = SaveChange(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.CustomId, this.PositionId, this.BusinessType, this.CreateName, transferArr)
 
 		if chanceId < 0 {
 			return -1
@@ -90,7 +90,7 @@ func (this *SaleChanceService) Add(ctx context.Context) int64 {
 		//任务团队
 		argsTaskTeam = append(argsTaskTeam, this.PositionId, this.EntUserId, this.CreateName, 1, nowtime)
 		//存库
-		chanceId = SaveChange(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.CustomId, this.PositionId, this.BusinessType, this.CreateName, []int64{})
+		chanceId, taskId = SaveChange(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, this.CustomId, this.PositionId, this.BusinessType, this.CreateName, []int64{})
 		if chanceId < 0 {
 			return -1
 		}
@@ -106,7 +106,7 @@ 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, chanceId), cm.Push.SaleChance.Create.MobileHref)
+		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)
 
 	}
 
@@ -122,16 +122,16 @@ func SaleChangeAdd(tx *sql.Tx, args []interface{}) int64 {
 }
 
 // Save 存库
-func SaveChange(ctx context.Context, argsChange, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId, tplId int64, createName string, transferArr []int64) int64 {
+func SaveChange(ctx context.Context, argsChange, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId, tplId int64, createName string, transferArr []int64) (int64, int64) {
 	//存库
-	changeId := int64(-1)
+	changeId, taskId := int64(-1), int64(-1)
 	cm.CrmMysql.ExecTx("创建机会", func(tx *sql.Tx) bool {
 		//插入机会
 		changeId = SaleChangeAdd(tx, argsChange)
 		//传过来的argTask没有来源id,需要append
 		argsTask = append(argsTask, changeId)
 		//任务车存储
-		taskId := TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
+		taskId = TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
 		//操作台帐
 		ok1 := SaveLedger(ctx, positionId, changeId, taskId, "创建销售机会", fmt.Sprintf("%s创建了销售机会", createName), createName)
 		//是否创建销售计划
@@ -146,7 +146,7 @@ func SaveChange(ctx context.Context, argsChange, argsTask, argsTaskTeam []interf
 		return false
 	})
 
-	return changeId
+	return changeId, taskId
 }
 
 // TaskExecutePlanAdd 任务执行计划存储

+ 8 - 8
service/sale_clue.go

@@ -44,7 +44,7 @@ func (this *SaleClueService) Add(ctx context.Context) int64 {
 	argsTask := []interface{}{}
 	argsTaskTeam := []interface{}{}
 	baseUserIdArr := []int64{}
-	clueId := int64(-1)
+	clueId, taskId := int64(-1), int64(-1)
 	//判断处理方式
 	//转办
 	if this.Types == 2 {
@@ -70,7 +70,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, nowtime, this.CreateName)
 		//任务
 		argsTask = append(argsTask, this.EntId, this.ClueName+"的跟进任务", 1, this.PositionId, 1, nowtime, 1, 0, qu.If(this.FollowUpTime == 0, nil, nextFollowTime))
-		clueId = Save(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, 0, this.PositionId, this.CreateName, transferArr)
+		clueId, taskId = Save(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, 0, this.PositionId, this.CreateName, transferArr)
 		if clueId < 0 {
 			return -1
 		}
@@ -82,7 +82,7 @@ func (this *SaleClueService) Add(ctx context.Context) int64 {
 		//任务团队
 		argsTaskTeam = append(argsTaskTeam, this.PositionId, this.EntUserId, this.CreateName, 1, nowtime)
 		//存库
-		clueId = Save(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, 0, this.PositionId, this.CreateName, []int64{})
+		clueId, taskId = Save(ctx, args, argsTask, argsTaskTeam, this.EmployInfoId, 0, this.PositionId, this.CreateName, []int64{})
 		if clueId < 0 {
 			return -1
 		}
@@ -97,7 +97,7 @@ func (this *SaleClueService) 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.SaleClue.Create.Title, fmt.Sprintf(cm.Push.SaleClue.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1)), fmt.Sprintf(cm.Push.SaleClue.Create.PcHref, clueId), cm.Push.SaleClue.Create.MobileHref)
+		StationMailPush(userId, positionId, cm.Push.SaleClue.Create.Title, fmt.Sprintf(cm.Push.SaleClue.Create.Content, this.CreateName, strings.Replace(date.NowFormat(YYYYMMDDHHMM), " ", "%20", -1)), fmt.Sprintf(cm.Push.SaleClue.Create.PcHref, positionId, taskId, clueId), cm.Push.SaleClue.Create.MobileHref)
 	}
 	return 1
 
@@ -141,8 +141,8 @@ func TaskAdd(tx *sql.Tx, args, taskTeamArgs []interface{}, transferArr []int64,
 }
 
 //Save 存库
-func Save(ctx context.Context, argsClue, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId int64, createName string, transferArr []int64) int64 {
-	clueId := int64(-1)
+func Save(ctx context.Context, argsClue, argsTask, argsTaskTeam []interface{}, employ_info_id, employ_custom_id, positionId int64, createName string, transferArr []int64) (int64, int64) {
+	clueId, taskId := int64(-1), int64(-1)
 	//存库
 	cm.CrmMysql.ExecTx("创建线索", func(tx *sql.Tx) bool {
 		//插入线索
@@ -150,7 +150,7 @@ func Save(ctx context.Context, argsClue, argsTask, argsTaskTeam []interface{}, e
 		//传过来的argTask没有来源id,需要append
 		argsTask = append(argsTask, clueId)
 		//任务车存储
-		taskId := TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
+		taskId = TaskAdd(tx, argsTask, argsTaskTeam, transferArr, positionId)
 		//是否创建销售线索
 		ok1 := EmployUpdate(tx, employ_info_id, employ_custom_id, positionId, "is_create_clue")
 		//操作台帐
@@ -161,5 +161,5 @@ func Save(ctx context.Context, argsClue, argsTask, argsTaskTeam []interface{}, e
 		log.Println("save clue err: ", clueId, taskId, ok1, ok2)
 		return false
 	})
-	return clueId
+	return clueId, taskId
 }