job.go 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. package main
  2. import (
  3. "database/sql"
  4. "fmt"
  5. "log"
  6. "strings"
  7. "time"
  8. "app.yhyue.com/moapp/jybase/date"
  9. "app.yhyue.com/moapp/jybase/redis"
  10. "app.yhyue.com/moapp/jybase/common"
  11. "app.yhyue.com/moapp/jybase/mongodb"
  12. )
  13. // 未支付订单 30分钟一次
  14. func orders() {
  15. //一个小时未支付进入线索 A
  16. log.Println("未支付订单定时任务开始")
  17. lastOrderId := cfg.LastOrderId
  18. selectTimeStart := time.Unix(time.Now().Unix()-7200, 0).Format(date.Date_Full_Layout)
  19. selectTimeEnd := time.Unix(time.Now().Unix()-3600, 0).Format(date.Date_Full_Layout)
  20. sql := fmt.Sprintf(`select * from dataexport_order where create_time <= "%s" and create_time >= "%s" and id > %s`, selectTimeEnd, selectTimeStart, fmt.Sprint(lastOrderId))
  21. data := Mysql.SelectBySql(sql)
  22. if data != nil && *data != nil && len(*data) > 0 {
  23. for _, v := range *data {
  24. order_status := common.IntAll(v["order_status"])
  25. is_backstage_order := common.IntAll(v["is_backstage_order"])
  26. product_type_str1 := `"大会员","VIP订阅","数据流量包","历史数据"`
  27. product_type := common.ObjToString(v["product_type"])
  28. if order_status == 0 && is_backstage_order == 0 && strings.Contains(product_type_str1, product_type) {
  29. ok1, _ := FormatData(v, "orders")
  30. if !ok1 {
  31. common.WriteSysConfig(&cfg)
  32. break
  33. }
  34. }
  35. cfg.LastOrderId = common.IntAll(v["id"])
  36. }
  37. }
  38. common.WriteSysConfig(&cfg)
  39. log.Println("未支付订单定时任务结束")
  40. }
  41. // 新注册用户 5分钟一次
  42. func users() {
  43. //判断节假日
  44. runOk := getRunOk()
  45. if !runOk {
  46. log.Println("不是工作日,任务暂停")
  47. return
  48. }
  49. //新用户注册后5分钟内进入线索 C
  50. log.Println("新注册用户定时任务开始")
  51. selectTimeEnd := cfg.LastUserId
  52. sql := fmt.Sprintf(`select * from dwd_f_userbase_baseinfo where createtime > "%s" and source = "0101" and status != 2`, selectTimeEnd)
  53. data := TiDb.SelectBySql(sql)
  54. if data != nil && *data != nil && len(*data) > 0 {
  55. for k, v := range *data {
  56. createtime := common.ObjToString(v["createtime"])
  57. FormatData(v, "users")
  58. if k == len(*data)-1 {
  59. cfg.LastUserId = createtime
  60. }
  61. }
  62. }
  63. common.WriteSysConfig(&cfg)
  64. log.Println("新注册用户定时任务结束")
  65. }
  66. // 留资 5分钟一次
  67. func saleLeads() {
  68. //判断节假日
  69. runOk := getRunOk()
  70. if !runOk {
  71. log.Println("不是工作日,任务暂停")
  72. return
  73. }
  74. //留资后5分钟内进入线索
  75. //分为免费留资和付费留资 付费B 免费C
  76. log.Println("用户留资定时任务开始")
  77. session := Mgo.GetMgoConn()
  78. lastId := cfg.LastId
  79. defer func() {
  80. Mgo.DestoryMongoConn(session)
  81. }()
  82. query := map[string]interface{}{}
  83. if lastId != "" {
  84. query["_id"] = map[string]interface{}{"$gt": mongodb.StringTOBsonId(lastId)}
  85. }
  86. log.Println("query :", query)
  87. iter := session.DB(cfg.Mgo.DbName).C("saleLeads").Find(&query).Sort("_id").Iter()
  88. thisData := map[string]interface{}{}
  89. for {
  90. if !iter.Next(&thisData) {
  91. break
  92. }
  93. ok1, _ := FormatData(thisData, "saleLeads")
  94. if !ok1 {
  95. common.WriteSysConfig(&cfg)
  96. break
  97. }
  98. cfg.LastId = mongodb.BsonIdToSId(thisData["_id"])
  99. }
  100. common.WriteSysConfig(&cfg)
  101. log.Println("用户留资定时任务结束")
  102. }
  103. func FormatData(data map[string]interface{}, item string) (bool, bool) {
  104. userId, uId, positionId, source, cluename, phone, sourceCode, keyword := common.ObjToString(data["user_id"]), "", "", "", "", "", "", []string{}
  105. role, industry, department, departments, position, name, top_cluetype, sub_cluetype, follow_project_area, level := "", "", "", "", "", "", "", "", "", ""
  106. query, topname, subname, belong_to, sourceName := map[string]interface{}{}, "", "", "01", ""
  107. nowTime := time.Now().Format("2006-01-02 15:04:05")
  108. if item == "orders" { //订单
  109. if !mongodb.IsObjectIdHex(userId) {
  110. positionId = userId
  111. userMapping := TiDb.FindOne("dwd_f_userbase_id_mapping", map[string]interface{}{"position_id": userId}, "", "")
  112. if userMapping != nil && len(*userMapping) > 0 {
  113. userId = common.ObjToString((*userMapping)["userid"])
  114. }
  115. }
  116. query["userid"] = userId
  117. userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
  118. if userInfo != nil && len(*userInfo) > 0 {
  119. uId = common.ObjToString((*userInfo)["uid"])
  120. source = common.ObjToString((*userInfo)["source"])
  121. belong_to = common.ObjToString((*userInfo)["belong_to"])
  122. }
  123. cluename = common.ObjToString(data["company_name"])
  124. phone = common.ObjToString(data["user_phone"])
  125. } else if item == "message" {
  126. userMapping := TiDb.FindOne("dwd_f_userbase_id_mapping", map[string]interface{}{"base_user_id": common.Int64All(data["own_id"])}, "", "")
  127. if userMapping != nil && len(*userMapping) > 0 {
  128. userId = common.ObjToString((*userMapping)["userid"])
  129. positionId = fmt.Sprint((*userMapping)["position_id"])
  130. }
  131. query["userid"] = userId
  132. userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
  133. if userInfo != nil && len(*userInfo) > 0 {
  134. uId = common.ObjToString((*userInfo)["uid"])
  135. source = common.ObjToString((*userInfo)["source"])
  136. belong_to = common.ObjToString((*userInfo)["belong_to"])
  137. phone = common.ObjToString((*userInfo)["phone"])
  138. }
  139. } else if item == "users" { //注册用户
  140. userId = mongodb.BsonIdToSId(data["userid"])
  141. //新用户没有uid、source要等5分钟
  142. cluename = common.ObjToString(data["company_name"])
  143. phone = common.ObjToString(data["phone"])
  144. if phone != "" {
  145. contactsData := TiDb.SelectBySql("select * from dwd_f_userbase_contacts where phone = ? and is_delete = 1", phone)
  146. if contactsData != nil && len(*contactsData) > 0 {
  147. if common.ObjToString((*contactsData)[0]["baseinfo_id"]) != "" {
  148. uId = common.ObjToString((*contactsData)[0]["baseinfo_id"])
  149. query["uid"] = uId
  150. } else {
  151. query["userid"] = userId
  152. }
  153. } else {
  154. query["userid"] = userId
  155. }
  156. userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
  157. if userInfo != nil && len(*userInfo) > 0 {
  158. uId = common.ObjToString((*userInfo)["uid"])
  159. source = common.ObjToString((*userInfo)["source"])
  160. belong_to = common.ObjToString((*userInfo)["belong_to"])
  161. }
  162. }
  163. } else if item == "saleLeads" { //留资
  164. userId = common.ObjToString(data["userid"])
  165. if !mongodb.IsObjectIdHex(userId) {
  166. positionId = userId
  167. userMapping := TiDb.FindOne("dwd_f_userbase_id_mapping", map[string]interface{}{"position_id": userId}, "", "")
  168. if userMapping != nil && len(*userMapping) > 0 {
  169. userId = common.ObjToString((*userMapping)["userid"])
  170. }
  171. }
  172. cluename = common.ObjToString(data["company"])
  173. phone = common.ObjToString(data["phone"])
  174. role = common.ObjToString(data["companyType"])
  175. industry = common.ObjToString(data["industry"])
  176. department = common.ObjToString(data["branch"])
  177. departments = common.ObjToString(data["department"])
  178. position = common.ObjToString(data["position"])
  179. name = common.ObjToString(data["name"])
  180. sourceCode = common.ObjToString(data["source"])
  181. keywordArr := data["keyword"]
  182. if keywordArr != nil {
  183. keyword = common.ObjArrToStringArr(data["keyword"].([]interface{}))
  184. }
  185. contactsData := TiDb.SelectBySql("select * from dwd_f_userbase_contacts where phone = ? and is_delete = 1", phone)
  186. if contactsData != nil && len(*contactsData) > 0 {
  187. if common.ObjToString((*contactsData)[0]["baseinfo_id"]) != "" {
  188. uId = common.ObjToString((*contactsData)[0]["baseinfo_id"])
  189. query["uid"] = uId
  190. } else {
  191. query["userid"] = userId
  192. }
  193. } else {
  194. query["userid"] = userId
  195. }
  196. userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
  197. if userInfo != nil && len(*userInfo) > 0 {
  198. uId = common.ObjToString((*userInfo)["uid"])
  199. source = common.ObjToString((*userInfo)["source"])
  200. belong_to = common.ObjToString((*userInfo)["belong_to"])
  201. userId = common.ObjToString((*userInfo)["userid"])
  202. }
  203. } else if item == "eventReg" { //渠道
  204. userId = common.ObjToString(data["userid"])
  205. cluename = common.ObjToString(data["company"])
  206. phone = common.ObjToString(data["sign_phone"])
  207. role = common.ObjToString(data["company_type"])
  208. department = common.ObjToString(data["branch"])
  209. position = common.ObjToString(data["position"])
  210. name = common.ObjToString(data["sign_name"])
  211. sourceCode = common.ObjToString(data["source_code"])
  212. sourceName = common.ObjToString(data["source_name"])
  213. contactsData := TiDb.SelectBySql("select * from dwd_f_userbase_contacts where phone = ? and is_delete = 1", phone)
  214. if contactsData != nil && len(*contactsData) > 0 {
  215. if common.ObjToString((*contactsData)[0]["baseinfo_id"]) != "" {
  216. uId = common.ObjToString((*contactsData)[0]["baseinfo_id"])
  217. query["uid"] = uId
  218. } else {
  219. query["userid"] = userId
  220. }
  221. } else {
  222. query["userid"] = userId
  223. }
  224. userInfo := TiDb.FindOne("dwd_f_userbase_baseinfo", query, "", "")
  225. if userInfo != nil && len(*userInfo) > 0 {
  226. uId = common.ObjToString((*userInfo)["uid"])
  227. source = common.ObjToString((*userInfo)["source"])
  228. belong_to = common.ObjToString((*userInfo)["belong_to"])
  229. userId = common.ObjToString((*userInfo)["userid"])
  230. }
  231. if role == "集成商" || role == "设计院" {
  232. role = "其他-" + role
  233. }
  234. }
  235. if cluename == "" && item != "message" && item != "orders" {
  236. cluename = phone
  237. }
  238. isGroup, isCommerce := GetCompanyType(cluename) //判断是否集团公司、工商库
  239. if source == "0104" || strings.HasPrefix(belong_to, "02") || source == "0102" || source == "0103" || phone == "" {
  240. log.Println("线索分配失败,线索过滤!!", item, source, phone, userId)
  241. saveHlyj(belong_to, item, phone, name, sourceName, cluename, position, nowTime, isGroup, isCommerce)
  242. return true, false
  243. }
  244. if uId == "" {
  245. if isExists, _ := redis.Exists("bidx", "bidx_userId_"+userId); isExists {
  246. redisInt := redis.GetInt("bidx", "bidx_userId_"+userId)
  247. if redisInt > 4 {
  248. log.Println("线索分配失败,线索缺少信息,任务已执行超过1次", item, userId, phone)
  249. return true, true
  250. } else {
  251. redis.Incr("bidx", "bidx_userId_"+userId)
  252. }
  253. } else {
  254. redis.Put("bidx", "bidx_userId_"+userId, 1, 3600)
  255. }
  256. log.Println("线索分配失败,线索缺少信息", item, phone, userId)
  257. return false, false
  258. }
  259. if item == "orders" { //订单没信息再查一遍留资
  260. qid := positionId
  261. if qid == "" {
  262. qid = userId
  263. }
  264. saleLeadsData, ok := Mgo.Find("saleLeads", map[string]interface{}{"userid": qid}, map[string]interface{}{"_id": -1}, nil, false, 0, 1)
  265. if ok && saleLeadsData != nil && len(*saleLeadsData) > 0 {
  266. sdata := (*saleLeadsData)[0]
  267. role = common.ObjToString(sdata["companyType"])
  268. industry = common.ObjToString(sdata["industry"])
  269. department = common.ObjToString(sdata["branch"])
  270. departments = common.ObjToString(sdata["department"])
  271. position = common.ObjToString(sdata["position"])
  272. name = common.ObjToString(sdata["name"])
  273. }
  274. }
  275. top_cluetype, sub_cluetype, level, topname, subname = getClueType(item, data, sourceCode) //查留资来源名字
  276. if topname == "市场活动" && item == "saleLeads" {
  277. log.Println("市场活动留资过滤 ", userId, phone)
  278. return true, false
  279. }
  280. if strings.HasPrefix(belong_to, "03") {
  281. isOk := saveEverything(userId, phone, item, subname, sourceCode)
  282. log.Println("渠道线索电销", userId, phone, item, subname, sourceCode)
  283. if !isOk {
  284. return true, false
  285. }
  286. }
  287. follow_project_area = getAreaCode(userId) //关注项目区域
  288. log.Println("data +++", top_cluetype, sub_cluetype, level, follow_project_area, isGroup, isCommerce)
  289. if top_cluetype == "" || sub_cluetype == "" || level == "" {
  290. log.Println("线索分配失败,线索过滤top_cluetype!!", item, uId, phone, userId)
  291. return true, true
  292. }
  293. position_id, seatNumber, saleName, saleData, pIsOk := autoDraw(level, cluename, isGroup, isCommerce)
  294. log.Println("data -------", position_id, seatNumber, saleName)
  295. if position_id > 0 && seatNumber != "" {
  296. uCount, oks := TiDb.FindOne("dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, "", ""), true
  297. if uCount != nil && len(*uCount) > 0 {
  298. batch_import := common.ObjToString((*uCount)["batch_import"])
  299. if batch_import != "" && item == "users" {
  300. return true, true
  301. }
  302. oks = UpdateClue(*uCount, saleData, item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, position_id, source, sourceCode, keyword, belong_to, isGroup, isCommerce, pIsOk)
  303. } else {
  304. oks = SaveClue(item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber, position_id, source, sourceCode, keyword, belong_to, isGroup, isCommerce)
  305. if oks {
  306. TiDb.UpdateOrDeleteBySql(`update dwd_f_crm_clue_autodraw_record set count = count + 1 where seatNumber = ? and clue_level = ?`, seatNumber, level)
  307. }
  308. }
  309. if !oks {
  310. log.Println("线索分配失败!!", item, position_id, seatNumber, uId, userId, phone)
  311. return false, false
  312. }
  313. }
  314. return true, true
  315. }
  316. func SaveClue(item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber string, positionId int64, source, sourceCode string, keyword []string, belong_to string, isGroup, isCommerce int) bool {
  317. nowTime := time.Now().Format("2006-01-02 15:04:05")
  318. nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
  319. clueId, uodateId1, uodateId2, uodateId3, uodateId4, uodateId5, uodateId6 := int64(0), int64(0), int64(0), int64(0), int64(0), int64(0), int64(0)
  320. if TiDb.ExecTx("保存线索", func(tx *sql.Tx) bool {
  321. keywords := ""
  322. if sourceCode == "app_xzcyh" {
  323. if len(keyword) > 0 && keyword[0] != "" {
  324. keywords = strings.Join(keyword, ",")
  325. }
  326. }
  327. if cluename == "" {
  328. cluename = phone
  329. }
  330. clueId = TiDb.InsertByTx(tx, "dwd_f_crm_clue_info", map[string]interface{}{
  331. "userid": userId,
  332. "uid": uId,
  333. "seatNumber": seatNumber,
  334. "position_id": positionId,
  335. "is_assign": 1,
  336. "comeintime": nowTime,
  337. "createtime": nowTime,
  338. "updatetime": nowTime,
  339. "cluename": cluename,
  340. "top_cluetype": top_cluetype,
  341. "sub_cluetype": sub_cluetype,
  342. "trailstatus": "01",
  343. "name": name,
  344. "phone": phone,
  345. "position": position,
  346. "department": common.If(sourceCode == "app_xzcyh", departments, department),
  347. "industry": industry,
  348. "follow_project_area": follow_project_area,
  349. "role": role,
  350. "comeinsource_private": 2,
  351. "is_task": 1,
  352. "task_time": nowTime,
  353. "tasktime": common.If(item == "users", nowTimes, nowTime),
  354. "taskstatus": 0,
  355. "tasksource": "线索自动分配" + "-" + topname + "-" + subname,
  356. "business_scope": common.If(sourceCode == "app_xzcyh", keywords, nil),
  357. "company_nature": isGroup,
  358. "company_verification": isCommerce,
  359. })
  360. uodateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  361. "clue_id": clueId,
  362. "position_id": positionId,
  363. "change_type": "创建线索",
  364. "new_value": "系统自动创建",
  365. "createtime": nowTime,
  366. "BCPCID": common.GetRandom(32),
  367. "operator_id": -1,
  368. })
  369. uodateId2 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  370. "clue_id": clueId,
  371. "position_id": positionId,
  372. "change_field": "position_id",
  373. "change_type": "所属人变更",
  374. "old_value": "/",
  375. "new_value": saleName,
  376. "createtime": nowTime,
  377. "BCPCID": common.GetRandom(32),
  378. "operator_id": -1,
  379. })
  380. uodateId3 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  381. "clue_id": clueId,
  382. "position_id": positionId,
  383. "change_field": "trailstatus",
  384. "change_type": "基本信息变更",
  385. "old_value": "商机线索",
  386. "new_value": "新增",
  387. "createtime": nowTime,
  388. "BCPCID": common.GetRandom(32),
  389. "operator_id": -1,
  390. })
  391. uodateId4 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  392. "clue_id": clueId,
  393. "position_id": positionId,
  394. "change_type": "加入任务车",
  395. "new_value": "线索自动分配" + "-" + topname + "-" + subname,
  396. "createtime": nowTime,
  397. "BCPCID": common.GetRandom(32),
  398. "operator_id": -1,
  399. })
  400. uodateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  401. "clue_id": clueId,
  402. "position_id": positionId,
  403. "change_field": "top_cluetype",
  404. "change_type": "基本信息变更",
  405. "old_value": "/",
  406. "new_value": topname,
  407. "createtime": nowTime,
  408. "BCPCID": common.GetRandom(32),
  409. "operator_id": -1,
  410. })
  411. uodateId6 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  412. "clue_id": clueId,
  413. "position_id": positionId,
  414. "change_field": "sub_cluetype",
  415. "change_type": "基本信息变更",
  416. "old_value": "/",
  417. "new_value": subname,
  418. "createtime": nowTime,
  419. "BCPCID": common.GetRandom(32),
  420. "operator_id": -1,
  421. })
  422. return clueId > -1 && uodateId1 > -1 && uodateId2 > -1 && uodateId3 > -1 && uodateId4 > -1 && uodateId5 > -1 && uodateId6 > -1
  423. }) {
  424. log.Println("线索分配成功")
  425. if TiDb.Count("dwd_f_userbase_contacts", map[string]interface{}{"phone": phone}) == 0 {
  426. TiDb.Insert("dwd_f_userbase_contacts", map[string]interface{}{
  427. "status": 1,
  428. "is_delete": 1,
  429. "createtime": nowTime,
  430. "updatetime": nowTime,
  431. "phone": phone,
  432. "baseinfo_id": uId,
  433. "SOURCE": source,
  434. })
  435. }
  436. return true
  437. } else {
  438. log.Println("线索分配失败!!!", clueId, uodateId1, uodateId2, uodateId3, uodateId4, uodateId5, uodateId6, " 用户信息 ", item, position, seatNumber, uId, userId, phone)
  439. return false
  440. }
  441. }
  442. func UpdateClue(data map[string]interface{}, saleData []map[string]interface{}, item, userId, uId, top_cluetype, sub_cluetype, topname, subname, cluename, name, saleName, phone, position, department, departments, industry, follow_project_area, role, seatNumber string, positionId int64, source, sourceCode string, keyword []string, belong_to string, isGroup, isCommerce int, pIsOk bool) bool {
  443. nowTime := time.Now().Format("2006-01-02 15:04:05")
  444. nowTimes := time.Unix(time.Now().Unix()+3600*12, 0).Format("2006-01-02 15:04:05")
  445. //trailstatus = 无意向 为变更线索状态
  446. //没有变更所属人查任务车,有车不变
  447. trailstatus := common.ObjToString(data["trailstatus"])
  448. trailstatusTime := common.ObjToString(data["trailstatus_time"])
  449. var trailstatusTimes time.Time
  450. if trailstatusTime != "" {
  451. trailstatusTimes, _ = time.ParseInLocation(date.Date_Full_Layout, trailstatusTime, time.Local)
  452. }
  453. clueId := common.Int64All(data["id"])
  454. is_assign := common.IntAll(data["is_assign"])
  455. oldsaleName, oldTaskTime, taskTime, is_task, taskstatus := "", "", "", 0, 0
  456. old_position_id, old_seatNumber := common.Int64All(data["position_id"]), common.ObjToString(data["seatNumber"])
  457. oldTaskTime = common.ObjToString(data["tasktime"])
  458. is_task = common.IntAll(data["is_task"])
  459. taskstatus = common.IntAll(data["taskstatus"])
  460. BCPCID := common.GetRandom(32)
  461. old_name := common.ObjToString(data["name"])
  462. old_position := common.ObjToString(data["position"])
  463. old_department := common.ObjToString(data["department"])
  464. old_follow_project_area := common.ObjToString(data["follow_project_area"])
  465. old_role := common.ObjToString(data["role"])
  466. old_cluename := common.ObjToString(data["cluename"])
  467. old_top_cluetype := common.ObjToString(data["top_cluetype"])
  468. old_sub_cluetype := common.ObjToString(data["sub_cluetype"])
  469. old_topname, old_subname := "", ""
  470. is_transfer := common.IntAll(data["is_transfer"])
  471. if taskstatus == 1 || is_task == 0 {
  472. taskTime = common.ObjToString(common.If(item != "users", nowTime, nowTimes))
  473. } else {
  474. if is_task == 1 {
  475. if oldTaskTime != "" {
  476. t1, err := time.Parse("2006-01-02 15:04:05", oldTaskTime)
  477. if err == nil && time.Now().Before(t1) {
  478. taskTime = nowTime
  479. } else {
  480. taskTime = oldTaskTime
  481. }
  482. }
  483. }
  484. }
  485. //加入任务车判断节假日
  486. count, counts, t := 0, 0, time.Now()
  487. for {
  488. count++
  489. currentTime := t.AddDate(0, 0, -count)
  490. if currentTime.Weekday() == time.Sunday || currentTime.Weekday() == time.Saturday {
  491. isok := false
  492. for k, v := range DateMap {
  493. if currentTime.Format(date.Date_Short_Layout) == k && v == 2 {
  494. isok = true
  495. }
  496. }
  497. if isok {
  498. counts++
  499. }
  500. } else {
  501. isok := true
  502. for k, v := range DateMap {
  503. if currentTime.Format(date.Date_Short_Layout) == k && v == 1 {
  504. isok = false
  505. }
  506. }
  507. if isok {
  508. counts++
  509. }
  510. }
  511. if counts >= 2 {
  512. break
  513. }
  514. }
  515. recordCount := TiDb.CountBySql(`select count(1) from dwd_f_crm_trail_content where clue_id = ? and createtime > ?`, clueId, t.AddDate(0, 0, -count).Format(date.Date_Full_Layout))
  516. //
  517. clueUpdateData := map[string]interface{}{
  518. "updatetime": nowTime,
  519. "top_cluetype": top_cluetype,
  520. "sub_cluetype": sub_cluetype,
  521. "userid": userId,
  522. "comeinsource_private": 2,
  523. "tasksource": "线索来源自动更新" + "-" + topname + "-" + subname,
  524. "company_nature": isGroup,
  525. "company_verification": isCommerce,
  526. }
  527. if cluename != "" {
  528. clueUpdateData["cluename"] = cluename
  529. }
  530. if item != "orders" && item != "users" {
  531. if name != "" {
  532. clueUpdateData["name"] = name
  533. }
  534. if position != "" {
  535. clueUpdateData["position"] = position
  536. }
  537. if department != "" {
  538. clueUpdateData["department"] = department
  539. }
  540. if follow_project_area != "" {
  541. clueUpdateData["follow_project_area"] = follow_project_area
  542. }
  543. if role != "" {
  544. clueUpdateData["role"] = role
  545. }
  546. // clueUpdateData["industry"] = industry
  547. }
  548. if sourceCode == "app_xzcyh" {
  549. if departments != "" {
  550. clueUpdateData["department"] = departments
  551. department = departments
  552. }
  553. business_scope := common.ObjToString(data["business_scope"])
  554. keywords := ""
  555. if len(keyword) > 0 && keyword[0] != "" {
  556. keywords = strings.Join(keyword, ",")
  557. if business_scope != "" {
  558. clueUpdateData["business_scope"] = business_scope + "," + keywords
  559. } else {
  560. clueUpdateData["business_scope"] = keywords
  561. }
  562. }
  563. }
  564. if trailstatus == "00" || old_position_id == 0 || is_assign != 1 || pIsOk {
  565. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  566. } else {
  567. clueUpdateData["seatNumber"] = seatNumber
  568. clueUpdateData["position_id"] = positionId
  569. clueUpdateData["comeintime"] = nowTime
  570. clueUpdateData["is_assign"] = 1
  571. clueUpdateData["comeinsource_open"] = nil
  572. clueUpdateData["level_open"] = nil
  573. clueUpdateData["clue_level"] = nil
  574. for _, v := range saleData {
  575. if common.ObjToString(data["seatNumber"]) == common.ObjToString(v["seat_number"]) {
  576. oldsaleName = common.ObjToString(v["name"])
  577. }
  578. }
  579. }
  580. } else {
  581. clueUpdateData["seatNumber"] = old_seatNumber
  582. clueUpdateData["position_id"] = old_position_id
  583. clueUpdateData["is_assign"] = 1
  584. clueUpdateData["comeinsource_open"] = nil
  585. clueUpdateData["level_open"] = nil
  586. clueUpdateData["clue_level"] = nil
  587. }
  588. if trailstatus != "08" && is_assign == 0 {
  589. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  590. } else {
  591. clueUpdateData["trailstatus"] = "01"
  592. clueUpdateData["trailstatus_time"] = nowTime
  593. }
  594. }
  595. is_ok := false
  596. if (trailstatus != "08" && recordCount <= 0) || is_assign == 0 {
  597. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  598. } else {
  599. if item == "eventReg" {
  600. eData := TiDb.Find("dwd_f_crm_clue_change_record", map[string]interface{}{"clue_id": clueId, "change_type": "加入任务车"}, "", "", -1, -1)
  601. if eData != nil && len(*eData) > 0 {
  602. for _, e := range *eData {
  603. new_value := common.ObjToString(e["new_value"])
  604. if strings.Contains(new_value, subname) {
  605. is_ok = true
  606. }
  607. }
  608. }
  609. if !is_ok {
  610. if old_sub_cluetype != sub_cluetype || is_assign == 0 {
  611. if taskTime == "" {
  612. taskTime = nowTime
  613. }
  614. clueUpdateData["task_time"] = nowTime
  615. clueUpdateData["tasktime"] = taskTime
  616. clueUpdateData["taskstatus"] = 0
  617. }
  618. if is_transfer != 1 {
  619. clueUpdateData["is_task"] = 1
  620. }
  621. }
  622. } else {
  623. if old_sub_cluetype != sub_cluetype || is_assign == 0 {
  624. if taskTime == "" {
  625. taskTime = nowTime
  626. }
  627. clueUpdateData["task_time"] = nowTime
  628. clueUpdateData["tasktime"] = taskTime
  629. clueUpdateData["taskstatus"] = 0
  630. }
  631. if is_transfer != 1 {
  632. clueUpdateData["is_task"] = 1
  633. }
  634. }
  635. }
  636. }
  637. ok, updateId14 := true, true
  638. updateId1, updateId2, updateId3, updateId4, updateId5 := int64(0), int64(0), int64(0), int64(0), int64(0)
  639. updateId6, updateId7, updateId8, updateId9, updateId10 := int64(0), int64(0), int64(0), int64(0), int64(0)
  640. updateId11, updateId12, updateId13 := int64(0), int64(0), int64(0)
  641. if TiDb.ExecTx("更新线索", func(tx *sql.Tx) bool {
  642. //线索
  643. ok = TiDb.UpdateByTx(tx, "dwd_f_crm_clue_info", map[string]interface{}{"uid": uId}, clueUpdateData)
  644. //变更记录
  645. if (trailstatus == "00" || old_position_id == 0 || pIsOk) && is_assign == 1 {
  646. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  647. } else if old_position_id == 0 {
  648. updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  649. "clue_id": clueId,
  650. "position_id": positionId,
  651. "change_field": "position_id",
  652. "change_type": "所属人变更",
  653. "old_value": common.If(oldsaleName != "", oldsaleName, "/"),
  654. "new_value": common.If(saleName != "", saleName, "/"),
  655. "createtime": nowTime,
  656. "BCPCID": common.GetRandom(32),
  657. "operator_id": -1,
  658. })
  659. updateId3 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  660. "clue_id": clueId,
  661. "position_id": positionId,
  662. "change_field": "trailstatus",
  663. "change_type": "基本信息变更",
  664. "old_value": CodeTrail[trailstatus],
  665. "new_value": "新增",
  666. "createtime": nowTime,
  667. "BCPCID": common.GetRandom(32),
  668. "operator_id": -1,
  669. })
  670. } else {
  671. updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  672. "clue_id": clueId,
  673. "position_id": positionId,
  674. "change_field": "position_id",
  675. "change_type": "所属人变更",
  676. "old_value": common.If(oldsaleName != "", oldsaleName, "/"),
  677. "new_value": common.If(saleName != "", saleName, "/"),
  678. "createtime": nowTime,
  679. "BCPCID": common.GetRandom(32),
  680. "operator_id": -1,
  681. })
  682. updateId2 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  683. "clue_id": clueId,
  684. "position_id": common.Int64All(data["position_id"]),
  685. "change_field": "trailstatus",
  686. "change_type": "基本信息变更",
  687. "old_value": "无意向客户",
  688. "new_value": "流失",
  689. "createtime": nowTime,
  690. "BCPCID": common.GetRandom(32),
  691. "operator_id": -1,
  692. })
  693. updateId3 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  694. "clue_id": clueId,
  695. "position_id": positionId,
  696. "change_field": "trailstatus",
  697. "change_type": "基本信息变更",
  698. "old_value": "商机线索",
  699. "new_value": "新增",
  700. "createtime": nowTime,
  701. "BCPCID": common.GetRandom(32),
  702. "operator_id": -1,
  703. })
  704. updateId4 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  705. "clue_id": clueId,
  706. "position_id": positionId,
  707. "change_field": "trailstatus",
  708. "change_type": "基本信息变更",
  709. "old_value": "无意向客户",
  710. "new_value": "商机线索",
  711. "createtime": nowTime,
  712. "BCPCID": common.GetRandom(32),
  713. "operator_id": -1,
  714. })
  715. }
  716. } else if trailstatus != "08" && is_assign == 0 {
  717. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  718. } else {
  719. updateId1 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  720. "clue_id": clueId,
  721. "position_id": positionId,
  722. "change_field": "position_id",
  723. "change_type": "所属人变更",
  724. "old_value": common.If(oldsaleName != "", oldsaleName, "/"),
  725. "new_value": common.If(saleName != "", saleName, "/"),
  726. "createtime": nowTime,
  727. "BCPCID": common.GetRandom(32),
  728. "operator_id": -1,
  729. })
  730. if trailstatus != "01" {
  731. updateId4 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  732. "clue_id": clueId,
  733. "position_id": positionId,
  734. "change_field": "trailstatus",
  735. "change_type": "基本信息变更",
  736. "old_value": CodeTrail[trailstatus],
  737. "new_value": "商机线索",
  738. "createtime": nowTime,
  739. "BCPCID": common.GetRandom(32),
  740. "operator_id": -1,
  741. })
  742. }
  743. updateId3 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  744. "clue_id": clueId,
  745. "position_id": positionId,
  746. "change_field": "trailstatus",
  747. "change_type": "基本信息变更",
  748. "old_value": "商机线索",
  749. "new_value": "新增",
  750. "createtime": nowTime,
  751. "BCPCID": common.GetRandom(32),
  752. "operator_id": -1,
  753. })
  754. }
  755. }
  756. if (trailstatus != "08" && recordCount <= 0) || is_assign == 0 {
  757. if trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400 {
  758. } else {
  759. if old_sub_cluetype != sub_cluetype && !is_ok {
  760. if is_transfer != 1 {
  761. updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  762. "clue_id": clueId,
  763. "position_id": common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"])),
  764. "change_type": "加入任务车",
  765. "new_value": "线索来源自动更新" + "-" + topname + "-" + subname,
  766. "createtime": nowTime,
  767. "BCPCID": common.GetRandom(32),
  768. "operator_id": -1,
  769. })
  770. } else {
  771. cdata := TiDb.FindOne("dwd_f_csm_customer_info", map[string]interface{}{"clue_id": clueId}, "", "")
  772. if cdata != nil && len(*cdata) > 0 {
  773. kcpositionId := common.Int64All((*cdata)["position_id"])
  774. tasksource := common.ObjToString((*cdata)["tasksource"])
  775. taskstatus := common.IntAll((*cdata)["taskstatus"])
  776. updateId5 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  777. "clue_id": clueId,
  778. "position_id": kcpositionId,
  779. "change_type": "加入任务车",
  780. "new_value": "线上主动留资",
  781. "createtime": nowTime,
  782. "BCPCID": common.GetRandom(32),
  783. "operator_id": -1,
  784. })
  785. if taskstatus == 1 {
  786. tasksource = "10"
  787. } else {
  788. if tasksource != "" && !strings.Contains(tasksource, "10") {
  789. if !strings.Contains(tasksource, "10") {
  790. tasksource += ",10"
  791. }
  792. } else {
  793. tasksource = "10"
  794. }
  795. }
  796. updateId14 = TiDb.UpdateByTx(tx, "dwd_f_csm_customer_info", map[string]interface{}{"clue_id": clueId}, map[string]interface{}{
  797. "tasksource": tasksource,
  798. "tasktime": nowTime,
  799. "is_task": 1,
  800. "taskstatus": 0,
  801. })
  802. }
  803. }
  804. }
  805. }
  806. }
  807. if old_top_cluetype != "" {
  808. pcodeData := TiDb.FindOne("dwd_d_crm_cluetype_code", map[string]interface{}{"code": old_top_cluetype}, "", "")
  809. if pcodeData != nil && len(*pcodeData) > 0 {
  810. old_topname = common.ObjToString((*pcodeData)["name"])
  811. }
  812. }
  813. if old_sub_cluetype != "" {
  814. pcodeData := TiDb.FindOne("dwd_d_crm_cluetype_code", map[string]interface{}{"code": old_sub_cluetype}, "", "")
  815. if pcodeData != nil && len(*pcodeData) > 0 {
  816. old_subname = common.ObjToString((*pcodeData)["name"])
  817. }
  818. }
  819. if item != "orders" {
  820. if old_name != name && name != "" {
  821. updateId6 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  822. "clue_id": clueId,
  823. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  824. "change_field": "name",
  825. "change_type": "基本信息变更",
  826. "old_value": common.If(old_name != "", old_name, "/"),
  827. "new_value": common.If(name != "", name, "/"),
  828. "createtime": nowTime,
  829. "BCPCID": BCPCID,
  830. "operator_id": -1,
  831. })
  832. }
  833. if old_position != position && position != "" {
  834. updateId7 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  835. "clue_id": clueId,
  836. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  837. "change_field": "position",
  838. "change_type": "基本信息变更",
  839. "old_value": common.If(old_position != "", old_position, "/"),
  840. "new_value": common.If(position != "", position, "/"),
  841. "createtime": nowTime,
  842. "BCPCID": BCPCID,
  843. "operator_id": -1,
  844. })
  845. }
  846. if old_department != department && department != "" {
  847. updateId8 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  848. "clue_id": clueId,
  849. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  850. "change_field": "department",
  851. "change_type": "基本信息变更",
  852. "old_value": common.If(old_department != "", old_department, "/"),
  853. "new_value": common.If(department != "", department, "/"),
  854. "createtime": nowTime,
  855. "BCPCID": BCPCID,
  856. "operator_id": -1,
  857. })
  858. }
  859. if old_role != role && role != "" {
  860. updateId9 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  861. "clue_id": clueId,
  862. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  863. "change_field": "role",
  864. "change_type": "基本信息变更",
  865. "old_value": common.If(old_role != "", old_role, "/"),
  866. "new_value": common.If(role != "", role, "/"),
  867. "createtime": nowTime,
  868. "BCPCID": BCPCID,
  869. "operator_id": -1,
  870. })
  871. }
  872. if old_follow_project_area != follow_project_area && follow_project_area != "" {
  873. old_area, old_area_arr := "", []string{}
  874. new_area, new_area_arr := "", []string{}
  875. for _, v := range strings.Split(old_follow_project_area, ",") {
  876. old_area_arr = append(old_area_arr, CodeArea[v])
  877. }
  878. for _, v := range strings.Split(follow_project_area, ",") {
  879. new_area_arr = append(new_area_arr, CodeArea[v])
  880. }
  881. old_area = strings.Join(old_area_arr, ",")
  882. new_area = strings.Join(new_area_arr, ",")
  883. updateId10 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  884. "clue_id": clueId,
  885. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  886. "change_field": "follow_project_area",
  887. "change_type": "基本信息变更",
  888. "old_value": common.If(old_area != "", old_area, "/"),
  889. "new_value": common.If(new_area != "", new_area, "/"),
  890. "createtime": nowTime,
  891. "BCPCID": BCPCID,
  892. "operator_id": -1,
  893. })
  894. }
  895. if old_cluename != cluename && cluename != "" {
  896. updateId11 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  897. "clue_id": clueId,
  898. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  899. "change_field": "cluename",
  900. "change_type": "基本信息变更",
  901. "old_value": common.If(old_cluename != "", old_cluename, "/"),
  902. "new_value": common.If(cluename != "", cluename, "/"),
  903. "createtime": nowTime,
  904. "BCPCID": BCPCID,
  905. "operator_id": -1,
  906. })
  907. }
  908. }
  909. if old_top_cluetype != top_cluetype {
  910. updateId12 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  911. "clue_id": clueId,
  912. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  913. "change_field": "top_cluetype",
  914. "change_type": "基本信息变更",
  915. "old_value": common.If(old_topname != "", old_topname, "/"),
  916. "new_value": common.If(topname != "", topname, "/"),
  917. "createtime": nowTime,
  918. "BCPCID": BCPCID,
  919. "operator_id": -1,
  920. })
  921. }
  922. if old_sub_cluetype != sub_cluetype {
  923. updateId13 = TiDb.InsertByTx(tx, "dwd_f_crm_clue_change_record", map[string]interface{}{
  924. "clue_id": clueId,
  925. "position_id": common.If(trailstatus == "00" && trailstatusTime != "" && time.Now().Unix()-trailstatusTimes.Unix() < 86400, -1, common.If(trailstatus == "00" || is_assign == 0, positionId, common.Int64All(data["position_id"]))),
  926. "change_field": "sub_cluetype",
  927. "change_type": "基本信息变更",
  928. "old_value": common.If(old_subname != "", old_subname, "/"),
  929. "new_value": common.If(subname != "", subname, "/"),
  930. "createtime": nowTime,
  931. "BCPCID": BCPCID,
  932. "operator_id": -1,
  933. })
  934. }
  935. return ok && updateId1 > -1 && updateId2 > -1 && updateId3 > -1 && updateId4 > -1 && updateId5 > -1 && updateId6 > -1 && updateId7 > -1 && updateId8 > -1 && updateId9 > -1 && updateId10 > -1 && updateId11 > -1 && updateId12 > -1 && updateId13 > -1 && updateId14
  936. }) {
  937. log.Println("线索更新成功")
  938. if TiDb.Count("dwd_f_userbase_contacts", map[string]interface{}{"phone": phone}) == 0 {
  939. TiDb.Insert("dwd_f_userbase_contacts", map[string]interface{}{
  940. "status": 1,
  941. "is_delete": 1,
  942. "createtime": nowTime,
  943. "updatetime": nowTime,
  944. "phone": phone,
  945. "baseinfo_id": uId,
  946. "SOURCE": source,
  947. })
  948. }
  949. return true
  950. } else {
  951. log.Println("线索更新失败!!!", ok, updateId1, updateId2, updateId3, updateId4, updateId5, updateId6, updateId7, updateId8, updateId9, updateId10, updateId11, updateId12, updateId13, updateId14, " 用户信息 ", item, position, seatNumber, uId, userId, phone)
  952. return false
  953. }
  954. }