|
@@ -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, "", "01", trailstatusCode, labelChangeTime)
|
|
|
+ LabelHandel(tx, 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, trailstatusCode, labelChangeTime)
|
|
|
+ LabelHandel(nil, 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, trailstatusCode, labelChangeTime)
|
|
|
+ LabelHandel(nil, label, 2, positionId, level, trailstatusCode, trailstatusCode, labelChangeTime)
|
|
|
}
|
|
|
if sub_cluetype != "" && sub_cluetype != old_sub_cluetype {
|
|
|
updateData["position"] = position
|
|
@@ -1273,7 +1273,7 @@ func FindClueInfo(in *biservice.FindClueInfoReq) (map[string]interface{}, int64)
|
|
|
}
|
|
|
|
|
|
// 线索标签修改 label labelChangeTime
|
|
|
-func LabelHandel(oldlabelType, labelType, clueId int64, level, oldTrailstatusCode, trailstatusCode, labelChangeTime string) {
|
|
|
+func LabelHandel(tx *sql.Tx, oldlabelType, labelType, clueId int64, level, oldTrailstatusCode, trailstatusCode, labelChangeTime string) {
|
|
|
log.Println("线索标签修改:", oldlabelType, labelType, clueId, level, trailstatusCode, labelChangeTime)
|
|
|
//先查询以前什么类型
|
|
|
if trailstatusCode != "01" && oldTrailstatusCode != "01" {
|
|
@@ -1315,11 +1315,21 @@ func LabelHandel(oldlabelType, labelType, clueId int64, level, oldTrailstatusCod
|
|
|
}
|
|
|
}
|
|
|
if updateLabelType > 0 {
|
|
|
- JyBiTidb.Update("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
- "id": clueId,
|
|
|
- }, map[string]interface{}{
|
|
|
- "label": updateLabelType,
|
|
|
- "labelChangeTime": nowStr,
|
|
|
- })
|
|
|
+ ok := false
|
|
|
+ if tx == nil {
|
|
|
+ ok = TiDb.Update("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
+ "uid": uId,
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "label": updateLabelType,
|
|
|
+ "labelChangeTime": nowStr,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ok = TiDb.UpdateByTx(tx, "dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
+ "uid": uId,
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "label": updateLabelType,
|
|
|
+ "labelChangeTime": nowStr,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|