|
@@ -762,10 +762,9 @@ func batchDraw(data []map[string]interface{}, nowTime, seatNumber, name string,
|
|
|
"operator_id": positionId,
|
|
|
})
|
|
|
//标签处理
|
|
|
- labelChangeTime := gconv.String(v["labelChangeTime"])
|
|
|
label := gconv.Int64(v["label"])
|
|
|
trailstatusCode := gconv.String(v["trailstatus"])
|
|
|
- LabelHandel(tx, label, 3, clueId, "", "01", trailstatusCode, labelChangeTime)
|
|
|
+ LabelHandel(tx, label, 3, clueId, "", "01", trailstatusCode, name, "/", 0)
|
|
|
return ok1 && recordId > 0 && recordId1 > 0 && recordId2 > 0 && recordId3 > -1 && recordId4 > -1
|
|
|
}) {
|
|
|
logx.Info("领取线索成功")
|
|
@@ -1089,6 +1088,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
}
|
|
|
if sub_cluetype != "" && sub_cluetype != old_sub_cluetype {
|
|
|
updateData["position"] = position
|
|
|
+ taskstatus := gconv.Int64((*clueData)["taskstatus"])
|
|
|
JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
|
|
|
"clue_id": clueId,
|
|
|
"position_id": -1,
|
|
@@ -1100,7 +1100,7 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
"BCPCID": common.GetRandom(32),
|
|
|
"operator_id": this.PositionId,
|
|
|
})
|
|
|
- LabelHandel(nil, label, 2, clueId, level, trailstatusCode, trailstatusCode, labelChangeTime)
|
|
|
+ LabelHandel(nil, label, 2, clueId, level, trailstatusCode, trailstatusCode, "", "", taskstatus)
|
|
|
}
|
|
|
JyBiTidb.Update("dwd_f_crm_clue_info", map[string]interface{}{"id": clueId}, updateData)
|
|
|
} else if is_assign == 1 {
|
|
@@ -1176,7 +1176,8 @@ func ClueImportSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
"BCPCID": common.GetRandom(32),
|
|
|
"operator_id": this.PositionId,
|
|
|
})
|
|
|
- LabelHandel(nil, label, 2, positionId, level, trailstatusCode, trailstatusCode, labelChangeTime)
|
|
|
+ taskstatus := gconv.Int64((*clueData)["taskstatus"])
|
|
|
+ LabelHandel(nil, label, 2, positionId, level, trailstatusCode, trailstatusCode, "", "", taskstatus)
|
|
|
}
|
|
|
if sub_cluetype != "" && sub_cluetype != old_sub_cluetype {
|
|
|
updateData["position"] = position
|
|
@@ -1273,45 +1274,36 @@ func FindClueInfo(in *biservice.FindClueInfoReq) (map[string]interface{}, int64)
|
|
|
}
|
|
|
|
|
|
// 线索标签修改 label labelChangeTime
|
|
|
-func LabelHandel(tx *sql.Tx, oldlabelType, labelType, clueId int64, level, oldTrailstatusCode, trailstatusCode, labelChangeTime string) {
|
|
|
- log.Println("线索标签修改:", oldlabelType, labelType, clueId, level, trailstatusCode, labelChangeTime)
|
|
|
+func LabelHandel(tx *sql.Tx, oldlabelType, labelType, clueId int64, level, oldTrailstatusCode, trailstatusCode, name, oldName string, status int64) {
|
|
|
+ log.Println("线索标签修改:", "oldlabelType:", oldlabelType, "labelType:", labelType, "clueId:", clueId, "level:", level, "oldTrailstatusCode:", oldTrailstatusCode, "trailstatusCode:", trailstatusCode, "status:", status)
|
|
|
//先查询以前什么类型
|
|
|
if trailstatusCode != "01" && oldTrailstatusCode != "01" {
|
|
|
+ log.Println("不属于商机类型", clueId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if status != 0 {
|
|
|
+ log.Println("不属于未完成", clueId)
|
|
|
return
|
|
|
}
|
|
|
updateLabelType := int64(0)
|
|
|
nowStr := time.Now().Format("2006-01-02")
|
|
|
- if labelType == 1 {
|
|
|
- //直接更新
|
|
|
- if labelChangeTime == nowStr {
|
|
|
- if oldlabelType != 1 {
|
|
|
- updateLabelType = labelType
|
|
|
- }
|
|
|
- } else {
|
|
|
- updateLabelType = labelType
|
|
|
- }
|
|
|
- } else if labelType == 2 {
|
|
|
+ if labelType == 2 {
|
|
|
if level != "A" && level != "B" && level != "C" {
|
|
|
return
|
|
|
}
|
|
|
//查询以前是什么数据
|
|
|
- if labelChangeTime == nowStr {
|
|
|
- //同一天修改过
|
|
|
- if oldlabelType != 1 {
|
|
|
- updateLabelType = labelType
|
|
|
- }
|
|
|
- } else {
|
|
|
+ //人员变更
|
|
|
+ if oldlabelType != 1 {
|
|
|
updateLabelType = labelType
|
|
|
}
|
|
|
} else {
|
|
|
//查询以前是什么数据
|
|
|
- if labelChangeTime == nowStr {
|
|
|
- //同一天修改过
|
|
|
- if oldlabelType != 3 {
|
|
|
- updateLabelType = oldlabelType
|
|
|
+ if oldName != name {
|
|
|
+ if oldlabelType == 1 {
|
|
|
+ updateLabelType = 1
|
|
|
+ } else {
|
|
|
+ updateLabelType = 3
|
|
|
}
|
|
|
- } else {
|
|
|
- updateLabelType = labelType
|
|
|
}
|
|
|
}
|
|
|
if updateLabelType > 0 {
|