challenge.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/app/admin/main/workflow/model"
  5. "go-common/app/admin/main/workflow/model/param"
  6. "go-common/app/admin/main/workflow/model/search"
  7. "go-common/library/ecode"
  8. "go-common/library/log"
  9. bm "go-common/library/net/http/blademaster"
  10. "go-common/library/net/http/blademaster/binding"
  11. "go-common/library/net/http/blademaster/middleware/permit"
  12. )
  13. func challList(ctx *bm.Context) {
  14. params := ctx.Request.Form
  15. cidStr := params.Get("cid")
  16. gidStr := params.Get("gid")
  17. midStr := params.Get("mid")
  18. tidStr := params.Get("tid")
  19. roundsStr := params.Get("rounds")
  20. statesStr := params.Get("states")
  21. ctimeFrom := params.Get("ctime_from")
  22. ctimeTo := params.Get("ctime_to")
  23. order := params.Get("order")
  24. sort := params.Get("sort_order")
  25. pageStr := params.Get("pn")
  26. pagesizeStr := params.Get("ps")
  27. cc := &search.ChallSearchCommonCond{}
  28. numsmap := []*intsParam{
  29. {value: cidStr, p: &cc.IDs},
  30. {value: gidStr, p: &cc.Gids},
  31. {value: midStr, p: &cc.Mids},
  32. {value: tidStr, p: &cc.Tids},
  33. {value: statesStr, p: &cc.States},
  34. {value: roundsStr, p: &cc.Rounds},
  35. }
  36. var pn, ps int64
  37. nummap := []*intParam{
  38. {value: pageStr, p: &pn},
  39. {value: pagesizeStr, p: &ps},
  40. }
  41. if err := dealNumsmap(numsmap); err != nil {
  42. ctx.JSON(nil, ecode.RequestErr)
  43. return
  44. }
  45. if err := dealNummap(nummap); err != nil {
  46. ctx.JSON(nil, ecode.RequestErr)
  47. return
  48. }
  49. cc.Order = order
  50. if cc.Order == "" {
  51. cc.Order = "id"
  52. }
  53. if cc.Order == "last_time" {
  54. cc.Order = "ctime"
  55. }
  56. cc.Sort = adjustOrder("challenge", sort)
  57. if cc.Sort != "asc" {
  58. cc.Sort = "desc"
  59. }
  60. if ctimeFrom != "" {
  61. cc.CTimeFrom = ctimeFrom
  62. }
  63. if ctimeTo != "" {
  64. cc.CTimeTo = ctimeTo
  65. }
  66. cc.FormatState()
  67. cc.Fields = []string{"id"}
  68. cc.PN, _ = strconv.Atoi(pageStr)
  69. cc.PS, _ = strconv.Atoi(pagesizeStr)
  70. ctx.JSON(wkfSvc.ChallList(ctx, cc))
  71. }
  72. func challListCommon(ctx *bm.Context) {
  73. var (
  74. IPers interface{}
  75. ok bool
  76. pers []string
  77. err error
  78. )
  79. v := new(param.ChallengeListCommonParam)
  80. if err = ctx.Bind(v); err != nil {
  81. return
  82. }
  83. cc := &search.ChallSearchCommonCond{}
  84. cc.Business = v.Business
  85. cc.IDs = v.IDs
  86. cc.Oids = v.Oids
  87. cc.Mids = v.Mids
  88. cc.ObjectMids = v.ObjectMids
  89. cc.Gids = v.Gids
  90. cc.TypeIDs = v.TypeIDs
  91. cc.Tids = v.Tids
  92. cc.Rounds = v.Rounds
  93. cc.AssigneeAdminIDs = v.AssigneeAdminIDs
  94. cc.AssigneeAdminNames = v.AssigneeAdminNames
  95. cc.AdminIDs = v.AdminIDs
  96. cc.CTimeTo = v.CTimeTo
  97. cc.CTimeFrom = v.CTimeFrom
  98. cc.Order = v.Order
  99. cc.Sort = v.Sort
  100. cc.States = v.States
  101. cc.BusinessStates = v.BusinessStates
  102. cc.PN = v.PN
  103. cc.PS = v.PS
  104. cc.CTimeFrom = v.CTimeFrom
  105. cc.CTimeTo = v.CTimeTo
  106. cc.FormatState()
  107. if v.Title != "" {
  108. cc.KWFields = append(cc.KWFields, "title")
  109. cc.KW = append(cc.KW, v.Title)
  110. }
  111. if v.Content != "" {
  112. cc.KWFields = append(cc.KWFields, "content")
  113. cc.KW = append(cc.KW, v.Content)
  114. }
  115. if IPers, ok = ctx.Get(permit.CtxPermissions); ok {
  116. pers = IPers.([]string)
  117. }
  118. if ok = isPermitChallList(pers, cc); !ok {
  119. ctx.JSON(nil, ecode.AccessDenied)
  120. ctx.Abort()
  121. return
  122. }
  123. cc.Fields = []string{"id", "gid"}
  124. ctx.JSON(wkfSvc.ChallListCommon(ctx, cc))
  125. }
  126. func challListV3(ctx *bm.Context) {
  127. v := new(param.ChallengeListV3Param)
  128. if err := ctx.Bind(v); err != nil {
  129. return
  130. }
  131. cc := &search.ChallSearchCommonCond{}
  132. cc.Fields = []string{"id", "oid", "mid"}
  133. cc.Business = v.Business
  134. cc.IDs = v.IDs
  135. cc.Oids = v.Oids
  136. cc.Mids = v.Mids
  137. cc.Gids = v.Gids
  138. cc.TypeIDs = v.TypeIDs
  139. cc.Tids = v.Tids
  140. cc.Rounds = v.Roles
  141. cc.AssigneeAdminIDs = v.AssigneeAdminIDs
  142. cc.AssigneeAdminNames = v.AssigneeAdminNames
  143. cc.AdminIDs = v.AdminIDs
  144. cc.CTimeTo = v.CTimeTo
  145. cc.CTimeFrom = v.CTimeFrom
  146. cc.Order = v.Order
  147. cc.Sort = v.Sort
  148. cc.States = v.States
  149. cc.BusinessStates = v.BusinessStates
  150. cc.PN = v.PN
  151. cc.PS = v.PS
  152. cc.CTimeFrom = v.CTimeFrom
  153. cc.CTimeTo = v.CTimeTo
  154. cc.KW = v.KW
  155. cc.KWFields = v.KWField
  156. cc.FormatState()
  157. ctx.JSON(wkfSvc.ChallListV3(ctx, cc))
  158. }
  159. func challDetail(ctx *bm.Context) {
  160. v := &struct {
  161. Cid int64 `form:"cid" validate:"required,gt=0"`
  162. }{}
  163. if err := ctx.Bind(v); err != nil {
  164. return
  165. }
  166. ctx.JSON(wkfSvc.ChallDetail(ctx, v.Cid))
  167. }
  168. func upChallBusState(ctx *bm.Context) {
  169. reqUpFields := &struct {
  170. Cid int64 `form:"cid" json:"cid"`
  171. AssigneeAdminid int64 `json:"adminid"`
  172. BusState int8 `form:"business_state" json:"business_state" validate:"min=0,max=14"`
  173. }{}
  174. if err := ctx.BindWith(reqUpFields, binding.FormPost); err != nil {
  175. return
  176. }
  177. adminID, adminName := adminInfo(ctx)
  178. ctx.JSON(nil, wkfSvc.UpChallBusState(ctx, reqUpFields.Cid, adminID, adminName, reqUpFields.BusState))
  179. }
  180. func batchUpChallBusState(ctx *bm.Context) {
  181. var (
  182. err error
  183. reqUpFields = new(struct {
  184. Cids []int64 `form:"cids,split" json:"cids" validate:"required,gt=0"`
  185. AssigneeAdminid int64 `json:"adminid"`
  186. BusState int8 `form:"business_state" json:"business_state" validate:"min=0,max=14"`
  187. })
  188. )
  189. if err = ctx.BindWith(reqUpFields, binding.FormPost); err != nil {
  190. return
  191. }
  192. adminID, adminName := adminInfo(ctx)
  193. ctx.JSON(nil, wkfSvc.BatchUpChallBusState(ctx, reqUpFields.Cids, adminID, adminName, reqUpFields.BusState))
  194. }
  195. func upChallBusStateV3(ctx *bm.Context) {
  196. bcbsp := new(param.BatchChallBusStateParam)
  197. if err := ctx.BindWith(bcbsp, binding.FormPost); err != nil {
  198. return
  199. }
  200. bcbsp.AssigneeAdminID, bcbsp.AssigneeAdminName = adminInfo(ctx)
  201. ctx.JSON(nil, wkfSvc.SetChallBusState(ctx, bcbsp))
  202. }
  203. func upBusChallsBusState(ctx *bm.Context) {
  204. var (
  205. err error
  206. reqUpFields struct {
  207. Business int8 `form:"business" json:"business" validate:"required,min=1"`
  208. Oid int64 `form:"oid" json:"oid" validate:"required,min=1"`
  209. AssigneeAdminid int64 `form:"adminid" json:"adminid" validate:"required,min=1"`
  210. State int8 `form:"business_state" json:"business_state" validate:"min=0,max=14"`
  211. PreStates []int8 `form:"pre_business_states" json:"pre_business_states" validate:"dive,gt=-1"` // business_state修改前的状态
  212. Extra map[string]interface{} `form:"extra" json:"extra"`
  213. }
  214. )
  215. if err = ctx.BindWith(&reqUpFields, binding.JSON); err != nil {
  216. log.Error("/business/busState/update bind failed error(%v)", err)
  217. return
  218. }
  219. if len(reqUpFields.PreStates) <= 0 {
  220. reqUpFields.PreStates = append(reqUpFields.PreStates, int8(0))
  221. }
  222. upCids, err := wkfSvc.UpBusChallsBusState(ctx, reqUpFields.Business, reqUpFields.State, reqUpFields.PreStates, reqUpFields.Oid, reqUpFields.AssigneeAdminid, reqUpFields.Extra)
  223. log.Info("call upBusChallsBusState param(%v) upcids(%v)", reqUpFields, upCids)
  224. ctx.JSON(map[string]interface{}{"cids": upCids}, err)
  225. }
  226. func setChallResult(ctx *bm.Context) {
  227. crp := &param.ChallResParam{}
  228. if err := ctx.BindWith(crp, binding.FormPost); err != nil {
  229. return
  230. }
  231. crp.AdminID, crp.AdminName = adminInfo(ctx)
  232. ctx.JSON(nil, wkfSvc.SetChallResult(ctx, crp))
  233. }
  234. func batchSetChallResult(ctx *bm.Context) {
  235. bcrp := &param.BatchChallResParam{}
  236. if err := ctx.BindWith(bcrp, binding.FormPost); err != nil {
  237. return
  238. }
  239. bcrp.AdminID, bcrp.AdminName = adminInfo(ctx)
  240. ctx.JSON(nil, wkfSvc.BatchSetChallResult(ctx, bcrp))
  241. }
  242. func setChallStateV3(ctx *bm.Context) {
  243. bcrp := &param.BatchChallResParam{}
  244. if err := ctx.BindWith(bcrp, binding.FormPost); err != nil {
  245. return
  246. }
  247. bcrp.AdminID, bcrp.AdminName = adminInfo(ctx)
  248. ctx.JSON(nil, wkfSvc.BatchSetChallResult(ctx, bcrp))
  249. }
  250. func rstChallResult(ctx *bm.Context) {
  251. crp := new(param.ChallRstParam)
  252. if err := ctx.BindWith(crp, binding.FormPost); err != nil {
  253. return
  254. }
  255. crp.AdminID, crp.AdminName = adminInfo(ctx)
  256. //force to pending
  257. crp.State = model.Pending
  258. ctx.JSON(nil, wkfSvc.RstChallResult(ctx, crp))
  259. }
  260. func rstChallResultV3(ctx *bm.Context) {
  261. crp := new(param.ChallRstParam)
  262. if err := ctx.BindWith(crp, binding.FormPost); err != nil {
  263. return
  264. }
  265. crp.AdminID, crp.AdminName = adminInfo(ctx)
  266. // TODO(zhoujiahui): force to pending now
  267. crp.State = model.Pending
  268. ctx.JSON(nil, wkfSvc.RstChallResult(ctx, crp))
  269. }
  270. func upChallExtra(ctx *bm.Context) {
  271. cep := &param.ChallExtraParam{}
  272. if err := ctx.BindWith(cep, binding.JSON); err != nil {
  273. return
  274. }
  275. cep.AdminID, cep.AdminName = adminInfo(ctx)
  276. ctx.JSON(nil, wkfSvc.UpChallExtraV2(ctx, cep))
  277. }
  278. func upChallExtraV3(ctx *bm.Context) {
  279. cep3 := &param.ChallExtraParamV3{}
  280. if err := ctx.BindWith(cep3, binding.Form); err != nil {
  281. return
  282. }
  283. cep3.AdminID, cep3.AdminName = adminInfo(ctx)
  284. ctx.JSON(nil, wkfSvc.UpChallExtraV3(ctx, cep3))
  285. }
  286. func batchUpChallExtra(ctx *bm.Context) {
  287. bcep := new(param.BatchChallExtraParam)
  288. if err := ctx.BindWith(bcep, binding.JSON); err != nil {
  289. return
  290. }
  291. bcep.AdminID, bcep.AdminName = adminInfo(ctx)
  292. ctx.JSON(nil, wkfSvc.BatchUpChallExtraV2(ctx, bcep))
  293. }
  294. func listChallBusiness(ctx *bm.Context) {
  295. v := new(struct {
  296. Cids []int64 `form:"cids,split" validate:"required,gt=0"`
  297. })
  298. if err := ctx.Bind(v); err != nil {
  299. return
  300. }
  301. ctx.JSON(wkfSvc.BusinessList(ctx, v.Cids))
  302. }
  303. func upChall(ctx *bm.Context) {
  304. cup := new(param.ChallUpParam)
  305. if err := ctx.BindWith(cup, binding.FormPost); err != nil {
  306. return
  307. }
  308. cup.AdminID, cup.AdminName = adminInfo(ctx)
  309. ctx.JSON(nil, wkfSvc.UpChall(ctx, cup))
  310. }
  311. func upChallV3(ctx *bm.Context) {
  312. cup := new(param.ChallUpParam)
  313. if err := ctx.BindWith(cup, binding.FormPost); err != nil {
  314. return
  315. }
  316. cup.AdminID, cup.AdminName = adminInfo(ctx)
  317. ctx.JSON(nil, wkfSvc.UpChall(ctx, cup))
  318. }
  319. func platformChallCount(ctx *bm.Context) {
  320. var (
  321. assigneeAdminID int64
  322. ok bool
  323. IUid interface{}
  324. IPers interface{}
  325. permissionMap map[int8]int64
  326. )
  327. if IUid, ok = ctx.Get("uid"); ok {
  328. assigneeAdminID = IUid.(int64)
  329. }
  330. if IPers, ok = ctx.Get(permit.CtxPermissions); ok {
  331. permissionMap = parsePermission(IPers.([]string))
  332. }
  333. ctx.JSON(wkfSvc.PlatformChallCount(ctx, assigneeAdminID, permissionMap))
  334. }
  335. func platformChallListPending(ctx *bm.Context) {
  336. var (
  337. err error
  338. pclp *param.ChallListParam
  339. assigneeAdminID int64
  340. ok bool
  341. IPers interface{}
  342. IUid interface{}
  343. permissionMap map[int8]int64
  344. )
  345. pclp = new(param.ChallListParam)
  346. if err = ctx.Bind(pclp); err != nil {
  347. return
  348. }
  349. if len(pclp.Businesses) != len(pclp.AssignNum) {
  350. ctx.JSON("business and AssignNum length not equal", ecode.RequestErr)
  351. return
  352. }
  353. if pclp.PS == 0 {
  354. pclp.PS = 10
  355. }
  356. if IUid, ok = ctx.Get("uid"); ok {
  357. assigneeAdminID = IUid.(int64)
  358. }
  359. if IPers, ok = ctx.Get(permit.CtxPermissions); ok {
  360. permissionMap = parsePermission(IPers.([]string))
  361. }
  362. ctx.JSON(wkfSvc.PlatformChallListPending(ctx, assigneeAdminID, permissionMap, pclp))
  363. }
  364. func platformHandlingChalllist(ctx *bm.Context) {
  365. var (
  366. err error
  367. assigneeAdminID int64
  368. ok bool
  369. permissionMap map[int8]int64
  370. IUid interface{}
  371. IPers interface{}
  372. )
  373. chdlp := new(param.ChallHandlingDoneListParam)
  374. if err = ctx.Bind(chdlp); err != nil {
  375. return
  376. }
  377. if IUid, ok = ctx.Get("uid"); ok {
  378. assigneeAdminID = IUid.(int64)
  379. }
  380. if IPers, ok = ctx.Get(permit.CtxPermissions); ok {
  381. permissionMap = parsePermission(IPers.([]string))
  382. }
  383. ctx.JSON(wkfSvc.PlatformChallListHandlingDone(ctx, chdlp, permissionMap, assigneeAdminID, model.PlatformStateHandling))
  384. }
  385. func platformDoneChallList(ctx *bm.Context) {
  386. var (
  387. err error
  388. assigneeAdminID int64
  389. ok bool
  390. permissionMap map[int8]int64
  391. IUid interface{}
  392. IPers interface{}
  393. )
  394. chdlp := new(param.ChallHandlingDoneListParam)
  395. if err = ctx.Bind(chdlp); err != nil {
  396. return
  397. }
  398. if IUid, ok = ctx.Get("uid"); ok {
  399. assigneeAdminID = IUid.(int64)
  400. }
  401. if IPers, ok = ctx.Get(permit.CtxPermissions); ok {
  402. permissionMap = parsePermission(IPers.([]string))
  403. }
  404. ctx.JSON(wkfSvc.PlatformChallListHandlingDone(ctx, chdlp, permissionMap, assigneeAdminID, model.PlatformStateDone))
  405. }
  406. func platformCreatedChallList(ctx *bm.Context) {
  407. var (
  408. err error
  409. cclp *param.ChallCreatedListParam
  410. adminID int64
  411. IUid interface{}
  412. ok bool
  413. )
  414. cclp = new(param.ChallCreatedListParam)
  415. if err = ctx.Bind(cclp); err != nil {
  416. return
  417. }
  418. if cclp.PS == 0 {
  419. cclp.PS = 10
  420. }
  421. if IUid, ok = ctx.Get("uid"); ok {
  422. adminID = IUid.(int64)
  423. }
  424. cond := new(search.ChallSearchCommonCond)
  425. cond.Fields = []string{"id", "gid"}
  426. cond.Business = cclp.Businesses
  427. cond.AdminIDs = []int64{adminID}
  428. cond.Order = cclp.Order
  429. cond.Sort = cclp.Sort
  430. cond.PS = cclp.PS
  431. cond.PN = cclp.PN
  432. ctx.JSON(wkfSvc.PlatformChallListCreated(ctx, cond))
  433. }
  434. func platformRelease(ctx *bm.Context) {
  435. var (
  436. exist bool
  437. IUid interface{}
  438. IPers interface{}
  439. permissionMap map[int8]int64
  440. assigneeAdminID int64
  441. )
  442. if IUid, exist = ctx.Get("uid"); !exist {
  443. ctx.JSON(nil, ecode.UserNotExist)
  444. return
  445. }
  446. assigneeAdminID = IUid.(int64)
  447. if IPers, exist = ctx.Get(permit.CtxPermissions); !exist {
  448. ctx.JSON(nil, ecode.MethodNoPermission)
  449. return
  450. }
  451. permissionMap = parsePermission(IPers.([]string))
  452. ctx.JSON(nil, wkfSvc.PlatformRelease(ctx, permissionMap, assigneeAdminID))
  453. }
  454. func platformCheckIn(ctx *bm.Context) {
  455. var (
  456. exist bool
  457. IUid interface{}
  458. assigneeAdminID int64
  459. )
  460. if IUid, exist = ctx.Get("uid"); !exist {
  461. ctx.JSON(nil, ecode.UserNotExist)
  462. return
  463. }
  464. assigneeAdminID = IUid.(int64)
  465. ctx.JSON(nil, wkfSvc.PlatformCheckIn(ctx, assigneeAdminID))
  466. }
  467. func isPermitChallList(pers []string, cond *search.ChallSearchCommonCond) (ok bool) {
  468. if cond.Business == 0 {
  469. return
  470. }
  471. var (
  472. business int8
  473. round int64
  474. )
  475. if len(cond.Rounds) != 0 {
  476. round = cond.Rounds[0]
  477. }
  478. business = cond.Business
  479. switch business {
  480. case 2: //稿件申诉
  481. switch round {
  482. case 0:
  483. for _, per := range pers {
  484. if per == ArchiveAppealRound1 {
  485. cond.Rounds = append(cond.Rounds, 1)
  486. ok = true
  487. }
  488. if per == ArchiveAppealRound2 {
  489. cond.Rounds = append(cond.Rounds, 2)
  490. ok = true
  491. }
  492. if per == ArchiveAppealRound3 {
  493. cond.Rounds = append(cond.Rounds, 3)
  494. ok = true
  495. }
  496. }
  497. case 1:
  498. for _, per := range pers {
  499. if per == ArchiveAppealRound1 {
  500. cond.Rounds = append(cond.Rounds, 1)
  501. ok = true
  502. }
  503. }
  504. case 2:
  505. for _, per := range pers {
  506. if per == ArchiveAppealRound2 {
  507. cond.Rounds = append(cond.Rounds, 2)
  508. ok = true
  509. }
  510. }
  511. case 3:
  512. for _, per := range pers {
  513. if per == ArchiveAppealRound3 {
  514. cond.Rounds = append(cond.Rounds, 3)
  515. ok = true
  516. }
  517. }
  518. }
  519. case 3: // 短点评投诉
  520. switch round {
  521. case 0:
  522. for _, per := range pers {
  523. if per == ReviewShortComplainRoun1 {
  524. cond.Rounds = append(cond.Rounds, 1)
  525. ok = true
  526. }
  527. if per == ReviewShortComplainRoun2 {
  528. cond.Rounds = append(cond.Rounds, 2)
  529. ok = true
  530. }
  531. }
  532. case 1:
  533. for _, per := range pers {
  534. if per == ReviewShortComplainRoun1 {
  535. cond.Rounds = append(cond.Rounds, 1)
  536. ok = true
  537. }
  538. }
  539. case 2:
  540. for _, per := range pers {
  541. if per == ReviewShortComplainRoun2 {
  542. cond.Rounds = append(cond.Rounds, 2)
  543. ok = true
  544. }
  545. }
  546. }
  547. case 4: // 长点评投诉
  548. switch round {
  549. case 0:
  550. for _, per := range pers {
  551. if per == ReviewLongComplainRoun1 {
  552. cond.Rounds = append(cond.Rounds, 1)
  553. ok = true
  554. }
  555. if per == ReviewLongComplainRoun2 {
  556. cond.Rounds = append(cond.Rounds, 2)
  557. ok = true
  558. }
  559. }
  560. case 1:
  561. for _, per := range pers {
  562. if per == ReviewLongComplainRoun1 {
  563. cond.Rounds = append(cond.Rounds, 1)
  564. ok = true
  565. }
  566. }
  567. case 2:
  568. for _, per := range pers {
  569. if per == ReviewLongComplainRoun2 {
  570. cond.Rounds = append(cond.Rounds, 2)
  571. ok = true
  572. }
  573. }
  574. }
  575. case 5: // 小黑屋申诉
  576. switch round {
  577. case 0:
  578. for _, per := range pers {
  579. if per == CreditAppealRoun1 {
  580. cond.Rounds = append(cond.Rounds, 1)
  581. ok = true
  582. }
  583. if per == CreditAppealRoun2 {
  584. cond.Rounds = append(cond.Rounds, 2)
  585. ok = true
  586. }
  587. if per == CreditAppealRoun3 {
  588. cond.Rounds = append(cond.Rounds, 3)
  589. ok = true
  590. }
  591. if per == CreditAppealRoun4 {
  592. cond.Rounds = append(cond.Rounds, 4)
  593. ok = true
  594. }
  595. if per == CreditAppealRoun5 {
  596. cond.Rounds = append(cond.Rounds, 5)
  597. ok = true
  598. }
  599. if per == CreditAppealRoun6 {
  600. cond.Rounds = append(cond.Rounds, 6)
  601. ok = true
  602. }
  603. if per == CreditAppealRoun7 {
  604. cond.Rounds = append(cond.Rounds, 7)
  605. ok = true
  606. }
  607. if per == CreditAppealRoun8 {
  608. cond.Rounds = append(cond.Rounds, 8)
  609. ok = true
  610. }
  611. }
  612. case 1:
  613. for _, per := range pers {
  614. if per == CreditAppealRoun1 {
  615. cond.Rounds = append(cond.Rounds, 1)
  616. ok = true
  617. }
  618. }
  619. case 2:
  620. for _, per := range pers {
  621. if per == CreditAppealRoun2 {
  622. cond.Rounds = append(cond.Rounds, 2)
  623. ok = true
  624. }
  625. }
  626. case 3:
  627. for _, per := range pers {
  628. if per == CreditAppealRoun3 {
  629. cond.Rounds = append(cond.Rounds, 2)
  630. ok = true
  631. }
  632. }
  633. case 4:
  634. for _, per := range pers {
  635. if per == CreditAppealRoun4 {
  636. cond.Rounds = append(cond.Rounds, 2)
  637. ok = true
  638. }
  639. }
  640. case 5:
  641. for _, per := range pers {
  642. if per == CreditAppealRoun5 {
  643. cond.Rounds = append(cond.Rounds, 2)
  644. ok = true
  645. }
  646. }
  647. case 6:
  648. for _, per := range pers {
  649. if per == CreditAppealRoun6 {
  650. cond.Rounds = append(cond.Rounds, 2)
  651. ok = true
  652. }
  653. }
  654. case 7:
  655. for _, per := range pers {
  656. if per == CreditAppealRoun7 {
  657. cond.Rounds = append(cond.Rounds, 2)
  658. ok = true
  659. }
  660. }
  661. case 8:
  662. for _, per := range pers {
  663. if per == CreditAppealRoun8 {
  664. cond.Rounds = append(cond.Rounds, 2)
  665. ok = true
  666. }
  667. }
  668. }
  669. case 6: // 稿件审核
  670. switch round {
  671. case 0:
  672. for _, per := range pers {
  673. if per == ArchiveAuditRound1 {
  674. cond.Rounds = append(cond.Rounds, 1)
  675. ok = true
  676. }
  677. }
  678. case 1:
  679. for _, per := range pers {
  680. if per == ArchiveAuditRound1 {
  681. cond.Rounds = append(cond.Rounds, 1)
  682. ok = true
  683. }
  684. }
  685. }
  686. case 9: //频道举报
  687. switch round {
  688. case 0:
  689. for _, per := range pers {
  690. if per == ChannelComplainRound1 {
  691. cond.Rounds = append(cond.Rounds, 1)
  692. ok = true
  693. }
  694. if per == ChannelComplainRound1 {
  695. cond.Rounds = append(cond.Rounds, 2)
  696. ok = true
  697. }
  698. }
  699. case 1:
  700. for _, per := range pers {
  701. if per == ChannelComplainRound1 {
  702. cond.Rounds = append(cond.Rounds, 1)
  703. ok = true
  704. }
  705. }
  706. case 2:
  707. for _, per := range pers {
  708. if per == ChannelComplainRound2 {
  709. cond.Rounds = append(cond.Rounds, 2)
  710. ok = true
  711. }
  712. }
  713. }
  714. }
  715. return
  716. }