process.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. package rcrt
  2. import (
  3. "encoding/json"
  4. "errors"
  5. "hongze/hrms_api/models/base"
  6. "hongze/hrms_api/models/rcrt"
  7. "hongze/hrms_api/models/system"
  8. "hongze/hrms_api/utils"
  9. "strings"
  10. "time"
  11. )
  12. // 设置一面面试结果
  13. func SetProcessFirstRecommend(adminInfo *system.SysAdmin, req *rcrt.ProcessFirstRecommendReq) (err error, errMsg string) {
  14. process := new(rcrt.Process)
  15. //判断流程是否存在
  16. processInfo, err := process.GetProcessByProcessId(req.ProcessId)
  17. if err != nil {
  18. if err == utils.ErrNoRow {
  19. errMsg = "流程不存在或者已经被删除"
  20. err = errors.New(errMsg + "Err:" + err.Error())
  21. return
  22. }
  23. errMsg = "查询招聘流程出错"
  24. err = errors.New(errMsg + "Err:" + err.Error())
  25. return
  26. }
  27. //判断招聘流程状态
  28. if processInfo.Status >= utils.RcrtProcessStatusWaitSecondResult {
  29. errMsg = "一面信息已确认,不允许修改"
  30. err = errors.New(errMsg)
  31. return
  32. }
  33. //更新招聘流程
  34. updateStr := []string{"first_admin_id", "first_time", "first_recommend", "first_detail", "first_remark", "first_result_admin_id", "status", "first_result", "first_result_time"}
  35. processInfo.FirstTime, _ = time.ParseInLocation(utils.FormatDate, req.FirstTime, time.Local)
  36. processInfo.FirstDetail = req.FirstDetail
  37. processInfo.FirstRecommend = req.FirstRecommend
  38. processInfo.FirstRemark = req.FirstRemark
  39. processInfo.FirstAdminId = adminInfo.AdminId
  40. //根据一面建议结果,来处理
  41. if req.FirstRecommend == 1 {
  42. processInfo.Status = utils.RcrtProcessStatusWaitSecondResult
  43. } else {
  44. processInfo.Status = utils.RcrtProcessStatusOut
  45. }
  46. processInfo.FirstResult = req.FirstRecommend
  47. processInfo.FirstResultAdminId = adminInfo.AdminId
  48. processInfo.FirstResultTime = time.Now()
  49. err = processInfo.Update(updateStr)
  50. if err != nil {
  51. errMsg = "更新招聘流程出错"
  52. err = errors.New(errMsg + "Err:" + err.Error())
  53. return
  54. }
  55. //添加淘汰简历
  56. if req.FirstRecommend != 1 {
  57. //如果更新简历为淘汰状态,则新增淘汰简历
  58. outCv := new(rcrt.OutCv)
  59. //判断淘汰简历是否已存在
  60. _, err = outCv.GetOutCvByCvId(processInfo.CvId)
  61. if err != nil {
  62. if err == utils.ErrNoRow {
  63. err = nil
  64. } else {
  65. errMsg = "查询淘汰简历出错"
  66. err = errors.New(errMsg + "Err:" + err.Error())
  67. return
  68. }
  69. } else {
  70. //该流程已存在
  71. errMsg = "该淘汰简历已存在"
  72. err = errors.New(errMsg)
  73. return
  74. }
  75. cv := new(rcrt.Cv)
  76. //判断简历是否存在
  77. cvInfo, tErr := cv.GetCvByCvId(processInfo.CvId)
  78. if tErr != nil {
  79. if tErr == utils.ErrNoRow {
  80. errMsg = "简历不存在或者已经被删除"
  81. err = errors.New(errMsg + "Err:" + tErr.Error())
  82. return
  83. }
  84. errMsg = "查询简历出错"
  85. err = errors.New(errMsg + "Err:" + tErr.Error())
  86. return
  87. }
  88. //新增淘汰简历
  89. var processStage int8
  90. if processInfo.ThirdResultAdminId > 0 {
  91. processStage = 3
  92. } else if processInfo.SecondAdminId > 0 {
  93. processStage = 2
  94. } else if processInfo.FirstAdminId > 0 {
  95. processStage = 1
  96. }
  97. outCv.CvId = cvInfo.CvId
  98. outCv.CvName = cvInfo.CvName
  99. outCv.CvTitle = cvInfo.CvTitle
  100. outCv.CvUrl = cvInfo.CvUrl
  101. outCv.CvFileName = cvInfo.CvFileName
  102. outCv.Position = cvInfo.Position
  103. outCv.AdminId = adminInfo.AdminId
  104. outCv.OutStage = 2
  105. outCv.OutTime = time.Now()
  106. outCv.ProcessId = processInfo.ProcessId
  107. outCv.ProcessStage = processStage
  108. outCv.Enabled = 1
  109. err = outCv.Add()
  110. if err != nil {
  111. errMsg = "添加淘汰简历出错"
  112. err = errors.New(errMsg + "Err:" + err.Error())
  113. return
  114. }
  115. }
  116. return
  117. }
  118. // 设置二面面试结果
  119. func SetProcessSecondRecommend(adminInfo *system.SysAdmin, req *rcrt.ProcessSecondRecommendReq) (err error, errMsg string) {
  120. process := new(rcrt.Process)
  121. //判断流程是否存在
  122. processInfo, err := process.GetProcessByProcessId(req.ProcessId)
  123. if err != nil {
  124. if err == utils.ErrNoRow {
  125. errMsg = "流程不存在或者已经被删除"
  126. err = errors.New(errMsg + "Err:" + err.Error())
  127. return
  128. }
  129. errMsg = "查询招聘流程出错"
  130. err = errors.New(errMsg + "Err:" + err.Error())
  131. return
  132. }
  133. //判断招聘流程状态
  134. if processInfo.Status >= utils.RcrtProcessStatusWaitThirdResult {
  135. errMsg = "二面信息已确认,不允许修改"
  136. err = errors.New(errMsg)
  137. return
  138. }
  139. //更新招聘流程
  140. updateStr := []string{"second_admin_id", "second_time", "second_recommend", "second_video_url", "person_test"}
  141. processInfo.SecondTime, _ = time.ParseInLocation(utils.FormatDate, req.SecondTime, time.Local)
  142. processInfo.SecondVideoUrl = req.SecondVideoUrl
  143. processInfo.SecondRecommend = req.SecondRecommend
  144. processInfo.SecondAdminId = adminInfo.AdminId
  145. processInfo.PersonTest = req.PersonTest
  146. err = processInfo.Update(updateStr)
  147. if err != nil {
  148. errMsg = "更新招聘流程出错"
  149. err = errors.New(errMsg + "Err:" + err.Error())
  150. return
  151. }
  152. return
  153. }
  154. // 确认一面结果/确认二面结果
  155. func SetProcessResult(adminInfo *system.SysAdmin, req *rcrt.ProcessResultReq) (err error, errMsg string) {
  156. process := new(rcrt.Process)
  157. //判断流程是否存在
  158. processInfo, err := process.GetProcessByProcessId(req.ProcessId)
  159. if err != nil {
  160. if err == utils.ErrNoRow {
  161. errMsg = "流程不存在或者已经被删除"
  162. err = errors.New(errMsg + "Err:" + err.Error())
  163. return
  164. }
  165. errMsg = "查询招聘流程出错"
  166. err = errors.New(errMsg + "Err:" + err.Error())
  167. return
  168. }
  169. //判断招聘流程状态
  170. if processInfo.Status != utils.RcrtProcessStatusWaitSecondResult && processInfo.Status != utils.RcrtProcessStatusWaitFirstResult && processInfo.Status != utils.RcrtProcessStatusWaitThirdResult {
  171. errMsg = "不是待确认状态,不允许修改"
  172. err = errors.New(errMsg)
  173. return
  174. }
  175. //更新招聘流程
  176. var updateStr []string
  177. var outStage int8
  178. if processInfo.Status == utils.RcrtProcessStatusWaitFirstResult {
  179. if req.Stage > 0 && req.Stage != 1 {
  180. errMsg = "操作失败:只允许一面确认操作"
  181. err = errors.New(errMsg)
  182. return
  183. }
  184. updateStr = []string{"first_result_admin_id", "status", "first_result", "first_result_time"}
  185. if req.Status == 1 {
  186. processInfo.Status = utils.RcrtProcessStatusWaitSecondResult
  187. } else {
  188. outStage = 2
  189. processInfo.Status = utils.RcrtProcessStatusOut
  190. }
  191. processInfo.FirstResult = req.Status
  192. processInfo.FirstResultAdminId = adminInfo.AdminId
  193. processInfo.FirstResultTime = time.Now()
  194. } else if processInfo.Status == utils.RcrtProcessStatusWaitSecondResult {
  195. if req.Stage > 0 && req.Stage != 2 {
  196. errMsg = "操作失败:只允许二面确认操作"
  197. err = errors.New(errMsg)
  198. return
  199. }
  200. updateStr = []string{"second_result_admin_id", "status", "second_result", "second_result_time"}
  201. if req.Status == 1 {
  202. processInfo.Status = utils.RcrtProcessStatusWaitThirdResult
  203. } else {
  204. outStage = 3
  205. processInfo.Status = utils.RcrtProcessStatusOut
  206. }
  207. processInfo.SecondResult = req.Status
  208. processInfo.SecondResultAdminId = adminInfo.AdminId
  209. processInfo.SecondResultTime = time.Now()
  210. } else {
  211. if req.Stage > 0 && req.Stage != 3 {
  212. errMsg = "操作失败:只允许三面确认操作"
  213. err = errors.New(errMsg)
  214. return
  215. }
  216. updateStr = []string{"third_result_admin_id", "status", "third_result", "third_result_time"}
  217. if req.Status == 1 {
  218. processInfo.Status = utils.RcrtProcessStatusWPass
  219. } else {
  220. outStage = 4
  221. processInfo.Status = utils.RcrtProcessStatusOut
  222. }
  223. processInfo.ThirdResult = req.Status
  224. processInfo.ThirdResultAdminId = adminInfo.AdminId
  225. processInfo.ThirdResultTime = time.Now()
  226. }
  227. err = processInfo.Update(updateStr)
  228. if err != nil {
  229. errMsg = "更新招聘流程出错"
  230. err = errors.New(errMsg + "Err:" + err.Error())
  231. return
  232. }
  233. //添加淘汰简历
  234. if req.Status == 2 {
  235. //如果更新简历为淘汰状态,则新增淘汰简历
  236. outCv := new(rcrt.OutCv)
  237. //判断淘汰简历是否已存在
  238. _, err = outCv.GetOutCvByCvId(processInfo.CvId)
  239. if err != nil {
  240. if err == utils.ErrNoRow {
  241. err = nil
  242. } else {
  243. errMsg = "查询淘汰简历出错"
  244. err = errors.New(errMsg + "Err:" + err.Error())
  245. return
  246. }
  247. } else {
  248. //该流程已存在
  249. errMsg = "该淘汰简历已存在"
  250. err = errors.New(errMsg)
  251. return
  252. }
  253. cv := new(rcrt.Cv)
  254. //判断简历是否存在
  255. cvInfo, tErr := cv.GetCvByCvId(processInfo.CvId)
  256. if tErr != nil {
  257. if tErr == utils.ErrNoRow {
  258. errMsg = "简历不存在或者已经被删除"
  259. err = errors.New(errMsg + "Err:" + tErr.Error())
  260. return
  261. }
  262. errMsg = "查询简历出错"
  263. err = errors.New(errMsg + "Err:" + tErr.Error())
  264. return
  265. }
  266. var processStage int8
  267. if processInfo.ThirdResultAdminId > 0 {
  268. processStage = 3
  269. } else if processInfo.SecondAdminId > 0 {
  270. processStage = 2
  271. } else if processInfo.FirstAdminId > 0 {
  272. processStage = 1
  273. }
  274. //新增招聘流程
  275. outCv.CvId = cvInfo.CvId
  276. outCv.CvName = cvInfo.CvName
  277. outCv.CvTitle = cvInfo.CvTitle
  278. outCv.CvUrl = cvInfo.CvUrl
  279. outCv.CvFileName = cvInfo.CvFileName
  280. outCv.Position = cvInfo.Position
  281. outCv.AdminId = adminInfo.AdminId
  282. outCv.OutStage = outStage
  283. outCv.ProcessId = processInfo.ProcessId
  284. outCv.ProcessStage = processStage
  285. outCv.Enabled = 1
  286. outCv.OutTime = time.Now()
  287. outCv.ProcessId = processInfo.ProcessId
  288. err = outCv.Add()
  289. if err != nil {
  290. errMsg = "添加淘汰简历出错"
  291. err = errors.New(errMsg + "Err:" + err.Error())
  292. return
  293. }
  294. }
  295. return
  296. }
  297. // SetProcessCancel 取消面试
  298. func SetProcessCancel(adminInfo *system.SysAdmin, req *rcrt.ProcessDelReq) (err error, errMsg string) {
  299. //查询流程简历是否存在
  300. process := new(rcrt.Process)
  301. //判断流程是否存在
  302. processInfo, err := process.GetProcessByProcessId(req.ProcessId)
  303. if err != nil {
  304. if err == utils.ErrNoRow {
  305. errMsg = "流程不存在或者已经被删除"
  306. err = errors.New(errMsg + "Err:" + err.Error())
  307. return
  308. }
  309. errMsg = "查询招聘流程出错"
  310. err = errors.New(errMsg + "Err:" + err.Error())
  311. return
  312. }
  313. //判断招聘流程状态
  314. if processInfo.Status == utils.RcrtProcessStatusOut {
  315. errMsg = "该简历已被淘汰,无法取消"
  316. err = errors.New(errMsg)
  317. return
  318. } else if processInfo.Status == utils.RcrtProcessStatusWPass {
  319. errMsg = "该简历已通过,无法取消"
  320. err = errors.New(errMsg)
  321. return
  322. }
  323. updateStr := []string{"status"}
  324. processInfo.Status = utils.RcrtProcessStatusOut
  325. //更新流程简历为
  326. err = processInfo.Update(updateStr)
  327. if err != nil {
  328. errMsg = "更新招聘流程出错"
  329. err = errors.New(errMsg + "Err:" + err.Error())
  330. return
  331. }
  332. //添加到淘汰简历列表
  333. //如果更新简历为淘汰状态,则新增淘汰简历
  334. outCv := new(rcrt.OutCv)
  335. //判断淘汰简历是否已存在
  336. _, err = outCv.GetOutCvByCvId(processInfo.CvId)
  337. if err != nil {
  338. if err == utils.ErrNoRow {
  339. err = nil
  340. } else {
  341. errMsg = "查询淘汰简历出错"
  342. err = errors.New(errMsg + "Err:" + err.Error())
  343. return
  344. }
  345. } else {
  346. //该流程已存在
  347. errMsg = "该淘汰简历已存在"
  348. err = errors.New(errMsg)
  349. return
  350. }
  351. var processStage int8
  352. if processInfo.ThirdResultAdminId > 0 {
  353. processStage = 3
  354. } else if processInfo.SecondAdminId > 0 {
  355. processStage = 2
  356. } else if processInfo.FirstAdminId > 0 {
  357. processStage = 1
  358. }
  359. cv := new(rcrt.Cv)
  360. //判断简历是否存在
  361. cvInfo, tErr := cv.GetCvByCvId(processInfo.CvId)
  362. if tErr != nil {
  363. if tErr == utils.ErrNoRow {
  364. errMsg = "简历不存在或者已经被删除"
  365. err = errors.New(errMsg + "Err:" + tErr.Error())
  366. return
  367. }
  368. errMsg = "查询简历出错"
  369. err = errors.New(errMsg + "Err:" + tErr.Error())
  370. return
  371. }
  372. //新增招聘流程
  373. outCv.CvId = cvInfo.CvId
  374. outCv.CvName = cvInfo.CvName
  375. outCv.CvTitle = cvInfo.CvTitle
  376. outCv.CvUrl = cvInfo.CvUrl
  377. outCv.CvFileName = cvInfo.CvFileName
  378. outCv.Position = cvInfo.Position
  379. outCv.AdminId = adminInfo.AdminId
  380. outCv.OutStage = 0
  381. outCv.ProcessId = processInfo.ProcessId
  382. outCv.OutTime = time.Now()
  383. outCv.ProcessId = processInfo.ProcessId
  384. outCv.ProcessStage = processStage
  385. outCv.Enabled = 1
  386. err = outCv.Add()
  387. if err != nil {
  388. errMsg = "添加淘汰简历出错"
  389. err = errors.New(errMsg + "Err:" + err.Error())
  390. return
  391. }
  392. return
  393. }
  394. // ResetProcess 重置面试流程
  395. func ResetProcess(adminInfo *system.SysAdmin, cvId, processId int64, stage int8) (err error, errMsg string) {
  396. process := new(rcrt.Process)
  397. var processInfo *rcrt.Process
  398. isUpdateProcessInfo := false //是否更新流程简历
  399. if processId > 0 {
  400. isUpdateProcessInfo = true
  401. //判断流程是否存在
  402. processInfo, err = process.GetProcessByProcessId(processId)
  403. if err != nil {
  404. if err == utils.ErrNoRow {
  405. errMsg = "流程不存在或者已经被删除"
  406. err = errors.New(errMsg + "Err:" + err.Error())
  407. return
  408. }
  409. errMsg = "查询招聘流程出错"
  410. err = errors.New(errMsg + "Err:" + err.Error())
  411. return
  412. }
  413. } else {
  414. cv := new(rcrt.Cv)
  415. //判断简历是否存在
  416. cvInfo, tmpErr := cv.GetCvByCvId(cvId)
  417. if tmpErr != nil {
  418. if err == utils.ErrNoRow {
  419. errMsg = "简历不存在或者已经被删除"
  420. err = errors.New(errMsg + "Err:" + tmpErr.Error())
  421. return
  422. }
  423. errMsg = "查询简历出错"
  424. err = errors.New(errMsg + "Err:" + tmpErr.Error())
  425. return
  426. }
  427. //判断简历状态
  428. if cvInfo.Status == 0 {
  429. errMsg = "简历状态异常, 不允许重复设置"
  430. err = errors.New(errMsg)
  431. return
  432. }
  433. //更新简历
  434. cvInfo.Status = 1
  435. cvInfo.ResultAdminId = adminInfo.AdminId
  436. err = cvInfo.Update([]string{"status", "result_admin_id"})
  437. if err != nil {
  438. errMsg = "更新简历出错"
  439. err = errors.New(errMsg + "Err:" + err.Error())
  440. return
  441. }
  442. {
  443. outCv := new(rcrt.OutCv)
  444. outCvInfo, tmpErr := outCv.GetOutCvByCvId(cvId)
  445. if tmpErr != nil {
  446. if tmpErr != utils.ErrNoRow {
  447. errMsg = "查询淘汰简历出错"
  448. err = errors.New(errMsg + "Err:" + tmpErr.Error())
  449. return
  450. }
  451. }
  452. //更新淘汰简历
  453. if outCvInfo != nil {
  454. outCvInfo.Enabled = 0
  455. err = outCvInfo.Update([]string{"enabled"})
  456. if err != nil {
  457. errMsg = "更新淘汰简历出错"
  458. err = errors.New(errMsg + "Err:" + err.Error())
  459. return
  460. }
  461. }
  462. }
  463. //新增/查找对应的流程数据
  464. {
  465. process := new(rcrt.Process)
  466. //判断简历流程是否已存在
  467. processInfo, err = process.GetProcessByCvId(cvId)
  468. if err != nil {
  469. if err != utils.ErrNoRow {
  470. errMsg = "查询招聘流程出错"
  471. err = errors.New(errMsg + "Err:" + err.Error())
  472. return
  473. }
  474. //新增招聘流程
  475. processInfo = &rcrt.Process{
  476. CvId: cvId,
  477. CvName: cvInfo.CvName,
  478. HrEmailId: cvInfo.HrEmailId,
  479. CvUrl: cvInfo.CvUrl,
  480. CvTitle: cvInfo.CvTitle,
  481. CvFileName: cvInfo.CvFileName,
  482. }
  483. err = processInfo.Add()
  484. if err != nil {
  485. errMsg = "重置招聘流程出错"
  486. err = errors.New(errMsg + "Err:" + err.Error())
  487. return
  488. }
  489. } else {
  490. isUpdateProcessInfo = true
  491. }
  492. }
  493. }
  494. // 判断是否需要变更流程简历
  495. if isUpdateProcessInfo {
  496. //判断招聘流程状态
  497. if processInfo.Status != utils.RcrtProcessStatusWaitSecondResult && processInfo.Status != utils.RcrtProcessStatusWaitThirdResult && processInfo.Status != utils.RcrtProcessStatusOut {
  498. errMsg = "不是待二面结果、待三面结果、已淘汰状态,不允许重置"
  499. err = errors.New(errMsg)
  500. return
  501. }
  502. //更新招聘流程
  503. updateStr := []string{"status"}
  504. processInfo.Status = stage - 1
  505. switch stage {
  506. case 1:
  507. if processInfo.FirstAdminId == 0 {
  508. errMsg = `当前状态异常,不允许重置`
  509. err = errors.New(errMsg)
  510. return
  511. }
  512. processInfo.FirstResult = 0
  513. processInfo.FirstRecommend = 0
  514. updateStr = append(updateStr, "first_result", "first_recommend")
  515. case 2:
  516. if processInfo.SecondAdminId == 0 {
  517. errMsg = `当前状态异常,不允许重置`
  518. err = errors.New(errMsg)
  519. return
  520. }
  521. processInfo.SecondResult = 0
  522. updateStr = append(updateStr, "second_result")
  523. case 3:
  524. if processInfo.ThirdResultAdminId == 0 {
  525. errMsg = `当前状态异常,不允许重置`
  526. err = errors.New(errMsg)
  527. return
  528. }
  529. processInfo.ThirdResult = 0
  530. updateStr = append(updateStr, "third_result")
  531. }
  532. err = processInfo.Update(updateStr)
  533. if err != nil {
  534. errMsg = "重置招聘流程出错"
  535. err = errors.New(errMsg + "Err:" + err.Error())
  536. return
  537. }
  538. }
  539. return
  540. }
  541. func DealPersonTest() (err error) {
  542. page := new(base.Page)
  543. page.SetPageSize(1000)
  544. page.SetCurrent(1)
  545. item := new(rcrt.Process)
  546. var pars []interface{}
  547. condition := ` p.first_detail like "%性格%"`
  548. var tmpList []*rcrt.ProcessListTmpItem
  549. _, tmpList, err = item.SelectPage(page, condition, pars)
  550. if err != nil {
  551. err = errors.New("获取失败,Err:"+err.Error())
  552. return
  553. }
  554. if len(tmpList) == 0 {
  555. return
  556. }
  557. for _, v1 := range tmpList {
  558. tmpItem := new(rcrt.Process)
  559. tmpItem = &v1.Process
  560. contentMap := make(map[string]interface{})
  561. newFirstDetail := v1.FirstDetail
  562. newPersonTest := ""
  563. //json转为map数据结构
  564. err = json.Unmarshal([]byte(v1.FirstDetail), &contentMap)
  565. for k2, v2 := range contentMap {
  566. if k2 == "性格" {
  567. switch v2.(type) {
  568. case string:
  569. newPersonTest = v2.(string)
  570. }
  571. break
  572. }
  573. }
  574. if newPersonTest != "" {
  575. pos := strings.Index(newFirstDetail, `"性格`)
  576. newFirstDetail = string([]byte(newFirstDetail)[0:pos-1])
  577. newFirstDetail +="}"
  578. //更新性格字段和一面详情字段, 更新性格字段为v2
  579. updateStr := []string{"first_detail", "person_test"}
  580. tmpItem.FirstDetail = newFirstDetail
  581. tmpItem.PersonTest = newPersonTest
  582. err = tmpItem.Update(updateStr)
  583. if err != nil {
  584. err = errors.New("更新性格字段失败,Err:"+err.Error())
  585. return
  586. }
  587. }
  588. }
  589. return
  590. }