|
@@ -24,7 +24,7 @@ func RelatedCompanyIsCustom(companyName string) bool {
|
|
|
func ClueTransfer(clueId, changeType, kcType, mainClueId int64, clueName string) (status int, err error) {
|
|
|
if changeType == 1 { //电销中修改线索名称
|
|
|
status, err = DxUpdateClueName(clueId, clueName)
|
|
|
- } else { //客成修改名称
|
|
|
+ } else { //客成修改名称
|
|
|
if kcType == 1 { //回电销
|
|
|
status, err = ClueTransferDx(clueId, mainClueId)
|
|
|
} else { //划转到关联客户客成
|
|
@@ -130,7 +130,7 @@ func ClueTransferDx(clueId, mainClueId int64) (status int, err error) {
|
|
|
//查询原主账号电销人员
|
|
|
is_assign := 1
|
|
|
status = 1
|
|
|
- positionId, kcPositionId, seatNumber, isFreeze := GetSalePerson(mainClueId)
|
|
|
+ positionId, kcPositionId, seatNumber, kcName, isFreeze := GetSalePerson(mainClueId)
|
|
|
if isFreeze || positionId == 0 {
|
|
|
is_assign = 0
|
|
|
}
|
|
@@ -177,7 +177,7 @@ func ClueTransferDx(clueId, mainClueId int64) (status int, err error) {
|
|
|
"position_id": common.If(kcPositionId > 0, kcPositionId, -1),
|
|
|
"change_field": "position_id",
|
|
|
"change_type": "客户成功经理",
|
|
|
- "old_value": kcPositionId,
|
|
|
+ "old_value": kcName,
|
|
|
"new_value": "/",
|
|
|
"createtime": nowTime,
|
|
|
"BCPCID": common.GetRandom(32),
|
|
@@ -235,12 +235,13 @@ func ClueTransferKc(clueId int64, clueName string) (int, error) {
|
|
|
return -1, errors.New("更新客成信息出错")
|
|
|
}
|
|
|
|
|
|
-func GetSalePerson(mainClueId int64) (positionId, kcPosId int64, seatNumber string, isFreeze bool) {
|
|
|
+func GetSalePerson(mainClueId int64) (positionId, kcPosId int64, seatNumber, kcName string, isFreeze bool) {
|
|
|
isFreeze = false
|
|
|
- clueData := entity.JyBiTidb.SelectBySql("SELECT a.position_id,a.seatNumber,b.position_id as kcPosId FROM dwd_f_crm_clue_info a LEFT JOIN dwd_f_csm_customer_info b ON a.id = b.clue_id WHERE a.id = ?", mainClueId)
|
|
|
+ clueData := entity.JyBiTidb.SelectBySql("SELECT a.position_id,a.seatNumber,b.position_id as kcPosId,b.name as kcName FROM dwd_f_crm_clue_info a LEFT JOIN dwd_f_csm_customer_info b ON a.id = b.clue_id WHERE a.id = ?", mainClueId)
|
|
|
if clueData != nil && len(*clueData) > 0 {
|
|
|
positionId = common.Int64All((*clueData)[0]["position_id"])
|
|
|
seatNumber = common.InterfaceToStr((*clueData)[0]["seatNumber"])
|
|
|
+ kcName = common.InterfaceToStr((*clueData)[0]["kcName"])
|
|
|
kcPosId = common.Int64All((*clueData)[0]["kcPosId"])
|
|
|
}
|
|
|
|
|
@@ -287,6 +288,7 @@ func GetSalePerson(mainClueId int64) (positionId, kcPosId int64, seatNumber stri
|
|
|
seatNumber = gconv.String((*sdata)[0]["seat_number"])
|
|
|
//newPerson = gconv.String((*sdata)[0]["name"])
|
|
|
}
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
}
|