浏览代码

Merge branch 'dev_v1.0.32_wh' of BaseService/biService into feature/v1.0.32

王浩 11 月之前
父节点
当前提交
e9e5a55072
共有 2 个文件被更改,包括 69 次插入73 次删除
  1. 47 49
      service/clue.go
  2. 22 24
      service/company.go

+ 47 - 49
service/clue.go

@@ -17,7 +17,7 @@ import (
 
 	"app.yhyue.com/moapp/jybase/mongodb"
 
-	common "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/es"
 	. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
@@ -452,30 +452,29 @@ func DistributeClueMore(saleMap map[string]map[string]interface{}, distributedAr
 							"BCPCID":       common.GetRandom(32),
 							"operator_id":  thispositionId,
 						})
-						if trailstatus != "08" {
-							JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
-								"clue_id":      v,
-								"position_id":  positionId,
-								"change_field": "trailstatus",
-								"change_type":  "基本信息变更",
-								"old_value":    "商机线索",
-								"new_value":    "新增",
-								"createtime":   nowTime,
-								"BCPCID":       common.GetRandom(32),
-								"operator_id":  thispositionId,
-							})
-							JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
-								"clue_id":      v,
-								"position_id":  positionId,
-								"change_field": "trailstatus",
-								"change_type":  "基本信息变更",
-								"old_value":    CodeTrail[trailstatus],
-								"new_value":    "商机线索",
-								"createtime":   nowTime,
-								"BCPCID":       common.GetRandom(32),
-								"operator_id":  thispositionId,
-							})
-						}
+
+						JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
+							"clue_id":      v,
+							"position_id":  positionId,
+							"change_field": "trailstatus",
+							"change_type":  "基本信息变更",
+							"old_value":    "商机线索",
+							"new_value":    "新增",
+							"createtime":   nowTime,
+							"BCPCID":       common.GetRandom(32),
+							"operator_id":  thispositionId,
+						})
+						JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
+							"clue_id":      v,
+							"position_id":  positionId,
+							"change_field": "trailstatus",
+							"change_type":  "基本信息变更",
+							"old_value":    CodeTrail[trailstatus],
+							"new_value":    "商机线索",
+							"createtime":   nowTime,
+							"BCPCID":       common.GetRandom(32),
+							"operator_id":  thispositionId,
+						})
 					} else {
 						logx.Info("私海插入失败 ", v, positionId, seatNumber)
 					}
@@ -742,30 +741,29 @@ func batchDraw(data []map[string]interface{}, nowTime, seatNumber, name string,
 				"operator_id": positionId,
 			})
 			recordId3, recordId4 := int64(0), int64(0)
-			if trailstatus != "08" {
-				recordId3 = JyBiTidb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
-					"clue_id":      clueId,
-					"position_id":  positionId,
-					"change_field": "trailstatus",
-					"change_type":  "基本信息变更",
-					"old_value":    "商机线索",
-					"new_value":    "新增",
-					"createtime":   nowTime,
-					"BCPCID":       common.GetRandom(32),
-					"operator_id":  positionId,
-				})
-				recordId4 = JyBiTidb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
-					"clue_id":      clueId,
-					"position_id":  positionId,
-					"change_field": "trailstatus",
-					"change_type":  "基本信息变更",
-					"old_value":    CodeTrail[trailstatus],
-					"new_value":    "商机线索",
-					"createtime":   nowTime,
-					"BCPCID":       common.GetRandom(32),
-					"operator_id":  positionId,
-				})
-			}
+			recordId3 = JyBiTidb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
+				"clue_id":      clueId,
+				"position_id":  positionId,
+				"change_field": "trailstatus",
+				"change_type":  "基本信息变更",
+				"old_value":    "商机线索",
+				"new_value":    "新增",
+				"createtime":   nowTime,
+				"BCPCID":       common.GetRandom(32),
+				"operator_id":  positionId,
+			})
+			recordId4 = JyBiTidb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
+				"clue_id":      clueId,
+				"position_id":  positionId,
+				"change_field": "trailstatus",
+				"change_type":  "基本信息变更",
+				"old_value":    CodeTrail[trailstatus],
+				"new_value":    "商机线索",
+				"createtime":   nowTime,
+				"BCPCID":       common.GetRandom(32),
+				"operator_id":  positionId,
+			})
+
 			return ok1 && recordId > 0 && recordId1 > 0 && recordId2 > 0 && recordId3 > -1 && recordId4 > -1
 		}) {
 			logx.Info("领取线索成功")

+ 22 - 24
service/company.go

@@ -337,30 +337,28 @@ func dclue(v, positionId, isTask, thispositionId int64) {
 					"BCPCID":       common.GetRandom(32),
 					"operator_id":  thispositionId,
 				})
-				if trailstatus != "08" {
-					JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
-						"clue_id":      v,
-						"position_id":  positionId,
-						"change_field": "trailstatus",
-						"change_type":  "基本信息变更",
-						"old_value":    "商机线索",
-						"new_value":    "新增",
-						"createtime":   nowTime,
-						"BCPCID":       common.GetRandom(32),
-						"operator_id":  thispositionId,
-					})
-					JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
-						"clue_id":      v,
-						"position_id":  positionId,
-						"change_field": "trailstatus",
-						"change_type":  "基本信息变更",
-						"old_value":    CodeTrail[trailstatus],
-						"new_value":    "商机线索",
-						"createtime":   nowTime,
-						"BCPCID":       common.GetRandom(32),
-						"operator_id":  thispositionId,
-					})
-				}
+				JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
+					"clue_id":      v,
+					"position_id":  positionId,
+					"change_field": "trailstatus",
+					"change_type":  "基本信息变更",
+					"old_value":    "商机线索",
+					"new_value":    "新增",
+					"createtime":   nowTime,
+					"BCPCID":       common.GetRandom(32),
+					"operator_id":  thispositionId,
+				})
+				JyBiTidb.Insert("dwd_f_crm_clue_change_record", map[string]interface{}{
+					"clue_id":      v,
+					"position_id":  positionId,
+					"change_field": "trailstatus",
+					"change_type":  "基本信息变更",
+					"old_value":    CodeTrail[trailstatus],
+					"new_value":    "商机线索",
+					"createtime":   nowTime,
+					"BCPCID":       common.GetRandom(32),
+					"operator_id":  thispositionId,
+				})
 			} else {
 				logx.Info("私海插入失败 ", v, positionId, seatNumber)
 			}