WH01243 7 сар өмнө
parent
commit
f9a14e8d3e
2 өөрчлөгдсөн 7 нэмэгдсэн , 8 устгасан
  1. 5 5
      service/clue.go
  2. 2 3
      service/company.go

+ 5 - 5
service/clue.go

@@ -765,7 +765,7 @@ func batchDraw(data []map[string]interface{}, nowTime, seatNumber, name string,
 			labelChangeTime := gconv.String(v["labelChangeTime"])
 			label := gconv.Int64(v["label"])
 			trailstatusCode := gconv.String(v["trailstatus"])
-			LabelHandel(label, 3, clueId, "", trailstatusCode, labelChangeTime)
+			LabelHandel(label, 3, clueId, "", "01", trailstatusCode, labelChangeTime)
 			return ok1 && recordId > 0 && recordId1 > 0 && recordId2 > 0 && recordId3 > -1 && recordId4 > -1
 		}) {
 			logx.Info("领取线索成功")
@@ -1100,7 +1100,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 									"BCPCID":       common.GetRandom(32),
 									"operator_id":  this.PositionId,
 								})
-								LabelHandel(label, 2, clueId, level, trailstatusCode, labelChangeTime)
+								LabelHandel(label, 2, clueId, level, trailstatusCode, trailstatusCode, labelChangeTime)
 							}
 							JyBiTidb.Update("dwd_f_crm_clue_info", map[string]interface{}{"id": clueId}, updateData)
 						} else if is_assign == 1 {
@@ -1176,7 +1176,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
 									"BCPCID":       common.GetRandom(32),
 									"operator_id":  this.PositionId,
 								})
-								LabelHandel(label, 2, positionId, level, trailstatusCode, labelChangeTime)
+								LabelHandel(label, 2, positionId, level, trailstatusCode, trailstatusCode, labelChangeTime)
 							}
 							if sub_cluetype != "" && sub_cluetype != old_sub_cluetype {
 								updateData["position"] = position
@@ -1273,10 +1273,10 @@ func FindClueInfo(in *biservice.FindClueInfoReq) (map[string]interface{}, int64)
 }
 
 // 线索标签修改 label  labelChangeTime
-func LabelHandel(oldlabelType, labelType, clueId int64, level, trailstatusCode, labelChangeTime string) {
+func LabelHandel(oldlabelType, labelType, clueId int64, level, oldTrailstatusCode, trailstatusCode, labelChangeTime string) {
 	log.Println("线索标签修改:", oldlabelType, labelType, clueId, level, trailstatusCode, labelChangeTime)
 	//先查询以前什么类型
-	if trailstatusCode != "01" {
+	if trailstatusCode != "01" && oldTrailstatusCode != "01" {
 		return
 	}
 	updateLabelType := int64(0)

+ 2 - 3
service/company.go

@@ -265,8 +265,7 @@ func dclue(v, positionId, isTask, thispositionId int64) {
 				//标签变更
 				labelChangeTime := gconv.String((*clueData)["labelChangeTime"])
 				label := gconv.Int64((*clueData)["label"])
-				trailstatusCode := gconv.String((*clueData)["trailstatus"])
-				LabelHandel(label, 3, v, "", trailstatusCode, labelChangeTime)
+				LabelHandel(label, 3, v, "", trailstatus, trailstatus, labelChangeTime)
 				JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
 					"clue_id":      v,
 					"position_id":  oldpositionId,
@@ -342,7 +341,7 @@ func dclue(v, positionId, isTask, thispositionId int64) {
 				})
 				labelChangeTime := gconv.String((*clueData)["labelChangeTime"])
 				label := gconv.Int64((*clueData)["label"])
-				LabelHandel(label, 3, v, "", "01", labelChangeTime)
+				LabelHandel(label, 3, v, "", trailstatus, trailstatus, labelChangeTime)
 				JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
 					"clue_id":      v,
 					"position_id":  positionId,