activity.go 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598
  1. package cygx
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "github.com/rdlucklib/rdluck_tools/paging"
  6. "hongze/hz_crm_api/controllers"
  7. "hongze/hz_crm_api/models"
  8. "hongze/hz_crm_api/models/cygx"
  9. "hongze/hz_crm_api/services"
  10. cygxService "hongze/hz_crm_api/services/cygx"
  11. "hongze/hz_crm_api/services/elastic"
  12. "hongze/hz_crm_api/utils"
  13. "strconv"
  14. "strings"
  15. "time"
  16. )
  17. // 活动
  18. type ActivityCoAntroller struct {
  19. controllers.BaseAuthController
  20. }
  21. // @Title 活动客户列表
  22. // @Description 活动客户列表接口
  23. // @Param IsZxdy query bool false "是否展示专项调研类型"
  24. // @Success 200 {object} cygx.ActivityCcustomerTypeList
  25. // @router /activity/customerTypelist [get]
  26. func (this *ActivityCoAntroller) List() {
  27. br := new(models.BaseResponse).Init()
  28. defer func() {
  29. this.Data["json"] = br
  30. this.ServeJSON()
  31. }()
  32. isZxdy, _ := this.GetBool("IsZxdy", false)
  33. sysUser := this.SysUser
  34. if sysUser == nil {
  35. br.Msg = "请登录"
  36. br.ErrMsg = "请登录,SysUser Is Empty"
  37. br.Ret = 408
  38. return
  39. }
  40. resp := new(cygx.ActivityCcustomerTypeList)
  41. var condition string
  42. if !isZxdy {
  43. condition += ` AND is_activity = 1 `
  44. } else {
  45. condition += ` AND is_apecial = 1 `
  46. }
  47. list, err := cygx.GetActivityCcustomerTypeList(condition)
  48. if err != nil {
  49. br.Msg = "获取失败"
  50. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  51. return
  52. }
  53. resp.List = list
  54. br.Ret = 200
  55. br.Success = true
  56. br.Msg = "获取成功"
  57. br.Data = resp
  58. }
  59. // @Title 活动内容的保存与发布
  60. // @Description 活动内容的保存与发布接口
  61. // @Param request body cygx.ActivityRep true "type json string"
  62. // @Success 200 操作成功
  63. // @router /activity/PreserveAndPublish [post]
  64. func (this *ActivityCoAntroller) PreserveAndPublish() {
  65. br := new(models.BaseResponse).Init()
  66. defer func() {
  67. this.Data["json"] = br
  68. this.ServeJSON()
  69. }()
  70. AdminUser := this.SysUser
  71. if AdminUser == nil {
  72. br.Msg = "请登录"
  73. br.ErrMsg = "请登录,用户信息为空"
  74. br.Ret = 408
  75. return
  76. }
  77. var req cygx.ActivityRep
  78. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  79. if err != nil {
  80. br.Msg = "参数解析异常!"
  81. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  82. return
  83. }
  84. //处理识图建会的会议信息列表 因为活动发布处理的业务逻辑过多,方便后期统一维护这里 根据 list 数据类型自己拼接 活动的 body 查研观向 11.12
  85. listImgToText := req.ListImgToText
  86. if len(listImgToText) > 0 {
  87. var errmsg string
  88. req, err, errmsg = cygxService.MakeActivityReqText(listImgToText)
  89. if err != nil {
  90. br.Msg = "识图建会失败!"
  91. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  92. return
  93. }
  94. if errmsg != "" {
  95. br.Msg = "识图建会失败," + errmsg
  96. br.ErrMsg = "识图建会失败," + errmsg
  97. return
  98. }
  99. }
  100. if req.Body == "" {
  101. br.Msg = "内容不可为空"
  102. return
  103. }
  104. //return
  105. //不限制人数的,强制改为全部客户可见
  106. if req.LimitPeopleNum == 0 {
  107. req.VisibleRange = 2
  108. req.IsMakerShow = 0
  109. req.Scale = ""
  110. req.CustomerTypeIds = ""
  111. }
  112. if req.IsResearchPoints == 0 {
  113. req.SiginupDeadline = ""
  114. }
  115. activityId := req.ActivityId
  116. labelType := req.LabelType
  117. labelList := req.List
  118. activityTypeId := req.ActivityTypeId
  119. scale := req.Scale
  120. voiceList := req.VoiceList
  121. videoDetail := req.VideoDetail
  122. isBClass := req.IsBClass
  123. isResearchPoints := req.IsResearchPoints
  124. isShowHz := req.IsShowHz
  125. isResearch := req.IsResearch //是否是研选类型的活动
  126. if isResearch {
  127. req.PermissionName = utils.CHART_PERMISSION_NAME_MF_YANXUAN
  128. }
  129. var items []*cygx.CygxActivity
  130. //temporaryLabel := req.TemporaryLabel
  131. industrialManagementIdS := req.IndustrialManagementIdS
  132. industrialSubjectIdS := req.IndustrialSubjectIdS
  133. body := req.Body
  134. customerTypeIds := req.CustomerTypeIds
  135. if req.VisibleRange != 1 {
  136. req.VisibleRange = 2
  137. }
  138. //公司调研电话会,增加【外部资源】勾选项,其他的强制过滤
  139. if req.ActivityTypeId != 3 {
  140. req.IsExternalLabel = 0
  141. }
  142. isExternalLabel := req.IsExternalLabel
  143. pointsSet := req.PointsSet
  144. isNeedEmail := req.IsNeedEmail
  145. siginupDeadline := req.SiginupDeadline
  146. if customerTypeIds != "" {
  147. condition := ` AND customer_type_id IN (` + customerTypeIds + `)`
  148. listValue, err := cygx.GetActivityCcustomerTypeList(condition)
  149. if err != nil {
  150. br.Msg = "活动可见套餐类型错误,请核实"
  151. return
  152. }
  153. req.CustomerTypeIds = ""
  154. for _, v := range listValue {
  155. req.CustomerTypeIds += v.PermissionValue + ","
  156. }
  157. req.CustomerTypeIds = strings.TrimRight(req.CustomerTypeIds, ",")
  158. }
  159. if len(voiceList) > 0 && videoDetail != nil {
  160. br.Msg = "音频与视频只能上传一个"
  161. return
  162. }
  163. body = strings.Replace(body, "  ", "", -1)
  164. body = strings.Replace(body, " ", "", -1)
  165. slice := strings.Split(body, "<hr>")
  166. if activityId == 0 {
  167. if activityTypeId == 1 {
  168. if labelType != 1 && labelType != 2 {
  169. br.Msg = "请选择主题标签"
  170. return
  171. }
  172. }
  173. }
  174. var industrialActivityItemsList [][]*cygx.CygxIndustrialActivityGroupManagement
  175. var subjectActivityItemsList [][]*cygx.CygxIndustrialActivityGroupSubject
  176. var industryAndSubjectNameItems []*cygx.IndustryAndSubjectName
  177. var industrialNames string
  178. var industrialSubjectNames string
  179. industryIds := make([]int, 0)
  180. for _, vLabel := range labelList {
  181. var industrialActivityItems []*cygx.CygxIndustrialActivityGroupManagement
  182. var subjectActivityItems []*cygx.CygxIndustrialActivityGroupSubject
  183. if vLabel.IndustrialManagementIdS != "" {
  184. industrialManagementIdS = vLabel.IndustrialManagementIdS
  185. industrialSubjectIdS = vLabel.IndustrialSubjectIdS
  186. if industrialManagementIdS == "" {
  187. br.Msg = "请选择产业"
  188. return
  189. }
  190. industrialManagementIdS = strings.Replace(industrialManagementIdS, " ", "", -1)
  191. industrialManagementList := strings.Split(industrialManagementIdS, ",")
  192. for _, v := range industrialManagementList {
  193. industrialActivityItem := new(cygx.CygxIndustrialActivityGroupManagement)
  194. industrialManagementId, err := strconv.Atoi(v)
  195. if err != nil {
  196. br.Msg = "参数解析异常!"
  197. br.ErrMsg = "产业ID不规范,Err:" + err.Error() + industrialManagementIdS
  198. return
  199. }
  200. industryIds = append(industryIds, industrialManagementId)
  201. industrialActivityItem.CreateTime = time.Now()
  202. industrialActivityItem.IndustrialManagementId = industrialManagementId
  203. industrialActivityItem.ActivityId = activityId
  204. industrialActivityItem.Source = 1
  205. industrialActivityItems = append(industrialActivityItems, industrialActivityItem)
  206. }
  207. if industrialSubjectIdS != "" {
  208. industrialSubjectIdList := strings.Split(industrialSubjectIdS, ",")
  209. for _, v := range industrialSubjectIdList {
  210. subjectActivityItem := new(cygx.CygxIndustrialActivityGroupSubject)
  211. industrialSubjectId, err := strconv.Atoi(v)
  212. if err != nil {
  213. br.Msg = "参数解析异常!"
  214. br.ErrMsg = "标的ID不规范,Err:" + err.Error() + industrialManagementIdS
  215. return
  216. }
  217. subjectActivityItem.CreateTime = time.Now()
  218. subjectActivityItem.IndustrialSubjectId = industrialSubjectId
  219. subjectActivityItem.ActivityId = activityId
  220. subjectActivityItem.Source = 1
  221. subjectActivityItems = append(subjectActivityItems, subjectActivityItem)
  222. }
  223. }
  224. //产业名称
  225. if industrialManagementIdS != "" {
  226. industrialNames, err = cygx.GetindustrialManagementNames(industrialManagementIdS)
  227. if err != nil {
  228. br.Msg = "参数解析异常!"
  229. br.ErrMsg = "产业ID不规范,Err:" + err.Error() + industrialManagementIdS
  230. return
  231. }
  232. }
  233. //标的名称
  234. if industrialSubjectIdS != "" {
  235. industrialSubjectNames, err = cygx.GetindustrialSubjectNames(industrialSubjectIdS)
  236. if err != nil {
  237. br.Msg = "参数解析异常!"
  238. br.ErrMsg = "标的ID不规范,Err:" + err.Error() + industrialSubjectIdS
  239. return
  240. }
  241. } else {
  242. industrialSubjectNames = ""
  243. }
  244. }
  245. if len(industrialActivityItems) == 0 {
  246. industrialActivityItems = make([]*cygx.CygxIndustrialActivityGroupManagement, 0)
  247. }
  248. if len(subjectActivityItems) == 0 {
  249. subjectActivityItems = make([]*cygx.CygxIndustrialActivityGroupSubject, 0)
  250. }
  251. industrialActivityItemsList = append(industrialActivityItemsList, industrialActivityItems)
  252. subjectActivityItemsList = append(subjectActivityItemsList, subjectActivityItems)
  253. //合并产业以及标的的名称
  254. industryAndSubjectNameItem := new(cygx.IndustryAndSubjectName)
  255. industryAndSubjectNameItem.IndustryNames = industrialNames
  256. industryAndSubjectNameItem.SubjectNames = industrialSubjectNames
  257. industryAndSubjectNameItem.TemporaryLabel = vLabel.TemporaryLabel
  258. industrialNames = ""
  259. industrialSubjectNames = ""
  260. industryAndSubjectNameItems = append(industryAndSubjectNameItems, industryAndSubjectNameItem)
  261. }
  262. if labelType == 1 || labelType == 0 {
  263. if len(slice) > len(industrialActivityItemsList) {
  264. for k := range slice {
  265. if k > 0 {
  266. if len(industrialActivityItemsList) > 0 {
  267. industrialActivityItemsList = append(industrialActivityItemsList, industrialActivityItemsList[0])
  268. }
  269. if len(subjectActivityItemsList) > 0 {
  270. subjectActivityItemsList = append(subjectActivityItemsList, subjectActivityItemsList[0])
  271. }
  272. if len(industryAndSubjectNameItems) > 0 {
  273. industryAndSubjectNameItems = append(industryAndSubjectNameItems, industryAndSubjectNameItems[0])
  274. }
  275. }
  276. }
  277. }
  278. }
  279. if labelType == 2 {
  280. if len(slice) != len(labelList) {
  281. br.Msg = "活动和主题个数不符,请核实"
  282. return
  283. }
  284. }
  285. permissionName := req.PermissionName
  286. //List := cygxService.GetActChartPermissionList()
  287. //var haveCheck bool
  288. //for _, v := range List {
  289. // if permissionName == v.PermissionName {
  290. // haveCheck = true
  291. // }
  292. //}
  293. //if !haveCheck {
  294. // br.Msg = "行业名称:" + permissionName + "不存在"
  295. // return
  296. //}
  297. if strings.Contains(permissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
  298. permissionName = utils.CHART_PERMISSION_NAME_MF_YANXUAN
  299. }
  300. //charInfo, errCategory := cygx.GetCategoryInfoById(req.ChartPermissionId)
  301. charInfo, errCategory := cygx.GetCategoryInfoByName(permissionName)
  302. if errCategory != nil {
  303. br.Msg = "请选择所属行业"
  304. br.ErrMsg = "获取所属行业信息失败,Err:" + errCategory.Error()
  305. return
  306. }
  307. if charInfo.PermissionName == "宏观经济" {
  308. charInfo.PermissionName = "宏观"
  309. }
  310. activityTypeInfo, errType := cygx.GetActivityTypeDetailById(activityTypeId)
  311. if errType != nil {
  312. br.Msg = "请选择活动类型"
  313. br.ErrMsg = "获取活动类型信息失败,Err:" + errType.Error()
  314. return
  315. }
  316. var activeState int
  317. var checkYidong bool
  318. if req.ActivityId > 0 {
  319. activityInfo, errInfo := cygx.GetAddActivityInfoById(req.ActivityId)
  320. if errInfo != nil {
  321. br.Msg = "活动不存在"
  322. br.ErrMsg = "活动ID错误,ActivityId:" + strconv.Itoa(req.ActivityId)
  323. return
  324. }
  325. if activityInfo.ActiveState > 1 {
  326. activeState = activityInfo.ActiveState
  327. }
  328. if activityInfo.YidongActivityId != "" {
  329. checkYidong = true
  330. }
  331. //校验活动后台管理员、销售是否有修改权限
  332. havePower, popupMsg, err := cygxService.CheckActivityUpdatePower(AdminUser.AdminId, activityInfo)
  333. if err != nil {
  334. br.Msg = "获取管理员身份信息失败"
  335. br.ErrMsg = "获取管理员身份信息失败,Err:" + err.Error()
  336. return
  337. }
  338. if !havePower {
  339. br.Msg = popupMsg
  340. return
  341. }
  342. }
  343. var itemPointsSet = new(cygx.CygxActivityPointsSet)
  344. var itemPointsSetOld = new(cygx.CygxActivityPointsSetRsq)
  345. if activityId > 0 {
  346. itemPointsSetOld, err = cygx.GetCygxActivityPointsSetDetail(activityId)
  347. if err != nil && err.Error() != utils.ErrNoRow() {
  348. br.Msg = "获取信息失败"
  349. br.ErrMsg = "GetCygxActivityPointsSetDetail,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  350. return
  351. }
  352. }
  353. //校验研选扣点内容,对于已结束的活动不做点数校验
  354. if isResearchPoints == 1 {
  355. errMsg, itemResp, err := cygxService.CheckActivityPointsSet(pointsSet, activityId)
  356. if errMsg != "" {
  357. br.Msg = errMsg
  358. return
  359. }
  360. if err != nil {
  361. br.Msg = "操作失败"
  362. br.ErrMsg = "操作失败,Err:" + err.Error()
  363. return
  364. }
  365. itemPointsSet = itemResp
  366. }
  367. for k, v := range slice {
  368. //如果内容不存在 时间:字段则不予处理
  369. if strings.Contains(v, "时间:") || strings.Contains(v, "时间:") {
  370. slicebr := strings.Split(v, "<br")
  371. //浏览器兼容处理
  372. if len(slicebr) > 5 {
  373. v = strings.Replace(v, "br", "p", -1)
  374. }
  375. v = strings.Replace(v, "<p><br></p>", "", -1) //删除空标签,兼容标题顶部空格、换行
  376. v = strings.Replace(v, "<p><p></p>", "", -1)
  377. v = strings.Replace(v, "<p></p>", "", -1)
  378. v = strings.Replace(v, "<p><p>", "", -1)
  379. v = strings.Replace(v, "<br>", "", -1)
  380. v = strings.Replace(v, "<p id=\"isPasted\"></p>", "", -1)
  381. item, errstr := cygxService.ActivityBodyAnalysis(v, activeState, req)
  382. if len(errstr) > 0 {
  383. br.Msg = errstr
  384. br.IsSendEmail = false
  385. return
  386. }
  387. var temporaryLabel string
  388. if len(labelList) == 1 {
  389. temporaryLabel = labelList[0].TemporaryLabel
  390. } else {
  391. temporaryLabel = labelList[k].TemporaryLabel
  392. }
  393. item.TemporaryLabel = temporaryLabel
  394. item.IsBClass = isBClass
  395. if item.ReportLink != "" {
  396. articleIdLink, err := cygxService.GetReportLinkToArticleid(item.ReportLink)
  397. if err != nil {
  398. br.Msg = "操作失败"
  399. br.ErrMsg = "解析报告链接ID失败,Err:" + err.Error()
  400. return
  401. }
  402. item.ArticleId = articleIdLink
  403. }
  404. //if k == 0 && item.Label == "" {
  405. // br.Msg = "请填写活动标签"
  406. // return
  407. //}
  408. item.AdminId = AdminUser.AdminId
  409. item.AdminName = AdminUser.RealName
  410. item.Body = v
  411. item.ChartPermissionName = charInfo.PermissionName
  412. item.ChartPermissionNames = req.PermissionName
  413. item.ChartPermissionId = charInfo.ChartPermissionId
  414. item.ActivityTypeName = activityTypeInfo.ActivityTypeName
  415. item.ActivityTypeId = activityTypeInfo.ActivityTypeId
  416. item.CustomerTypeIds = req.CustomerTypeIds
  417. item.LimitPeopleNum = req.LimitPeopleNum
  418. item.IsMakerShow = req.IsMakerShow
  419. item.VisibleRange = req.VisibleRange
  420. item.PublishDate = time.Now()
  421. item.IsYidongConduct = req.IsYidongConduct
  422. item.IsCanOutboundCall = req.IsCanOutboundCall
  423. item.IsNeedEmail = isNeedEmail
  424. if len(listImgToText) > 0 {
  425. resultTime := utils.StrTimeToTime(item.ActivityTime) //时间字符串格式转时间格式
  426. item.SiginupDeadline = resultTime.AddDate(0, 0, -1).Format(utils.FormatDate) + " 15:30:00" //批量建会报名截止之前默认:活动前一天15:30:00
  427. } else {
  428. item.SiginupDeadline = siginupDeadline
  429. }
  430. if isResearchPoints == 1 {
  431. item.IsResearchPoints = 1
  432. }
  433. //当不限制人数的时候,强制改为全部客户可见
  434. //if req.LimitPeopleNum == 0 {
  435. // item.VisibleRange = 2
  436. //}
  437. ////除了C类电话会其他类型的会议,强制改为全部客户可见
  438. //if req.ActivityTypeId != 7 {
  439. // item.VisibleRange = 2
  440. //}
  441. item.CreateTime = time.Now()
  442. item.LastUpdatedTime = time.Now()
  443. item.Scale = scale
  444. item.IsExternalLabel = isExternalLabel
  445. item.IsAllCustomerType = req.IsAllCustomerType
  446. item.IsShowHz = isShowHz
  447. item.ChartPermissionIdDeputy = charInfo.ChartPermissionId
  448. item.ChartPermissionNameDeputy = charInfo.PermissionName
  449. if len(labelList) == 1 {
  450. item.IsCanAppointmentMinutes = labelList[0].IsCanAppointmentMinutes
  451. } else {
  452. item.IsCanAppointmentMinutes = labelList[k].IsCanAppointmentMinutes
  453. }
  454. if item.ActivityName == "" {
  455. br.Msg = "请填写活动名称"
  456. return
  457. }
  458. if item.ActivityTime == "" {
  459. br.Msg = "请填写活动时间"
  460. return
  461. }
  462. //过滤标题中的符号,同步进门财经的时候使用
  463. newActivityName := item.ActivityName
  464. newActivityName = strings.Replace(newActivityName, "【", "", -1)
  465. newActivityName = strings.Replace(newActivityName, "】", "", -1)
  466. newActivityName = strings.Replace(newActivityName, "-", "", -1)
  467. newActivityName = strings.Replace(newActivityName, "—", "", -1)
  468. newActivityName = strings.Replace(newActivityName, " ", "", -1)
  469. newActivityName = strings.Replace(newActivityName, ":", "", -1)
  470. item.ActivityNameTask = newActivityName
  471. if !checkYidong {
  472. if activityTypeId == 1 {
  473. if item.Expert == "" {
  474. br.Msg = "请填写专家信息"
  475. return
  476. }
  477. if item.Host == "" {
  478. br.Msg = "请填写主持人信息"
  479. return
  480. }
  481. }
  482. if activityTypeId == 2 {
  483. if item.Speaker == "" {
  484. br.Msg = "请填写主讲人信息"
  485. return
  486. }
  487. }
  488. if activityTypeId == 3 {
  489. if item.DistinguishedGuest == "" {
  490. br.Msg = "请填写嘉宾信息"
  491. return
  492. }
  493. if item.Host == "" {
  494. br.Msg = "请填写主持人信息"
  495. return
  496. }
  497. }
  498. if activityTypeId == 4 {
  499. if item.DistinguishedGuest == "" {
  500. br.Msg = "请填写嘉宾信息"
  501. return
  502. }
  503. if item.Host == "" {
  504. br.Msg = "请填写主持人信息"
  505. return
  506. }
  507. if req.LimitPeopleNum == 0 {
  508. br.Msg = "请填写参会限制人数"
  509. return
  510. }
  511. }
  512. if activityTypeId == 5 {
  513. if item.Expert == "" {
  514. br.Msg = "请填写专家信息"
  515. return
  516. }
  517. if req.LimitPeopleNum == 0 {
  518. br.Msg = "请填写参会限制人数"
  519. return
  520. }
  521. }
  522. if activityTypeId == 6 {
  523. if item.Speaker == "" {
  524. br.Msg = "请填写主讲人信息"
  525. return
  526. }
  527. if req.LimitPeopleNum == 0 {
  528. br.Msg = "请填写参会限制人数"
  529. return
  530. }
  531. }
  532. }
  533. if req.LimitPeopleNum > 0 {
  534. item.IsLimitPeople = 1
  535. }
  536. if req.DoType == 1 {
  537. item.PublishStatus = 1
  538. }
  539. //当临时标的不为空的时候,标签为临时标的,否则为所选产业跟标的的组合
  540. if temporaryLabel != "" {
  541. item.Label = temporaryLabel
  542. } else {
  543. var labelNewStr string
  544. industrialNames = industryAndSubjectNameItems[k].IndustryNames
  545. industrialSubjectNames = industryAndSubjectNameItems[k].SubjectNames
  546. if industrialNames == "" && industrialSubjectNames != "" {
  547. labelNewStr = industrialSubjectNames
  548. } else if industrialNames != "" && industrialSubjectNames != "" {
  549. labelNewStr = industrialNames + "-" + industrialSubjectNames
  550. } else if industrialNames != "" && industrialSubjectNames == "" {
  551. labelNewStr = industrialNames
  552. }
  553. item.Label = labelNewStr
  554. if len(labelList) == 1 {
  555. item.IsShowSubjectName = labelList[0].IsShowSubjectName
  556. } else {
  557. item.IsShowSubjectName = labelList[k].IsShowSubjectName
  558. }
  559. }
  560. if item.ActivityTypeId == 2 {
  561. if item.ReportLink == "" {
  562. if labelList[k].IndustrialSubjectIdS != "" {
  563. item.ReportLink, err = cygxService.ActivityReportLink(item, labelList[k].IndustrialSubjectIdS)
  564. if err != nil {
  565. br.Msg = "发布失败"
  566. br.ErrMsg = "发布失败自动获取报告链接失败,Err:" + err.Error()
  567. return
  568. }
  569. }
  570. } else {
  571. sliceArt := strings.Split(item.ReportLink, "/")
  572. if len(sliceArt) > 0 {
  573. articleId, err := strconv.Atoi(sliceArt[len(sliceArt)-1])
  574. if err != nil {
  575. br.Msg = "报告链接格式错误!"
  576. return
  577. }
  578. detailArt, err := cygx.GetArticleIdInfoByArticleId(articleId)
  579. if err != nil {
  580. br.Msg = "内容不存在"
  581. br.ErrMsg = "操作失败,Err:" + err.Error()
  582. return
  583. }
  584. //类型ID 医药(医享会:28 、药调研:301)、消费【渠道新声:32】、科技【科技前言:79】、智造【匠心智造:84】
  585. if detailArt.CategoryId != 28 && detailArt.CategoryId != 301 && detailArt.CategoryId != 32 && detailArt.CategoryId != 79 && detailArt.CategoryId != 84 {
  586. item.IsHideAppointment = 1
  587. }
  588. }
  589. }
  590. }
  591. items = append(items, item)
  592. var errAct error
  593. if req.ActivityId == 0 {
  594. } else {
  595. if len(slice) > 1 {
  596. br.Msg = "文本格式错误,请删除多余活动"
  597. return
  598. }
  599. item.ActivityId = req.ActivityId
  600. activityInfo, errInfo := cygx.GetAddActivityInfoById(req.ActivityId)
  601. if activityInfo == nil {
  602. br.Msg = "活动不存在"
  603. br.ErrMsg = "活动ID错误,ActivityId:" + strconv.Itoa(req.ActivityId)
  604. return
  605. }
  606. if errInfo != nil {
  607. br.Msg = "操作失败"
  608. br.ErrMsg = "操作失败,Err:" + errInfo.Error()
  609. return
  610. }
  611. if item.PublishStatus == 0 {
  612. item.PublishStatus = activityInfo.PublishStatus
  613. }
  614. if req.DoType == 1 {
  615. item.AdminId = AdminUser.AdminId
  616. item.AdminName = AdminUser.RealName
  617. item.PublishDate = time.Now()
  618. item.IsCancel = 0
  619. } else {
  620. item.AdminId = activityInfo.AdminId
  621. item.AdminName = activityInfo.AdminName
  622. item.PublishDate = utils.StrTimeToTime(activityInfo.PublishDate)
  623. }
  624. //音频
  625. itemVoice := new(cygx.CygxActivityVoice)
  626. //var itemVoiceList []*cygx.CygxActivityVoice
  627. if len(voiceList) > 0 {
  628. for _, vo := range voiceList {
  629. itemVoice.ActivityId = activityId
  630. itemVoice.VoiceName = vo.Name
  631. itemVoice.VoiceUrl = vo.Url
  632. itemVoice.VoicePlaySeconds = vo.PlaySeconds
  633. itemVoice.CreateTime = time.Now()
  634. }
  635. }
  636. //视频
  637. itemVideo := new(cygx.CygxActivityVideo)
  638. if videoDetail != nil {
  639. itemVideo.VideoName = videoDetail.VideoName
  640. itemVideo.ActivityId = activityId
  641. itemVideo.VideoDuration = videoDetail.VideoDuration
  642. itemVideo.VideoUrl = videoDetail.VideoUrl
  643. itemVideo.ModifyDate = time.Now().Format(utils.FormatDateTime)
  644. itemVideo.CreateTime = time.Now().Format(utils.FormatDateTime)
  645. }
  646. //删除原有的视频数据
  647. //if itemVideo.VideoUrl != "" {
  648. videoDetail, err := cygx.GetCygxActivityVideoReqDetail(activityId)
  649. if err != nil && err.Error() != utils.ErrNoRow() {
  650. br.Msg = "获取信息失败"
  651. br.ErrMsg = "GetCygxActivityVideoReqDetail,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  652. return
  653. }
  654. if videoDetail != nil {
  655. go cygxService.UpdateResourceData(videoDetail.VideoId, "activityvideo", "delete", time.Now().Format(utils.FormatDateTime))
  656. }
  657. //}
  658. //if itemVoice.VoiceUrl != "" {
  659. voiceReqList, err := cygx.GetCygxActivityVoiceReqList(activityId)
  660. if err != nil && err.Error() != utils.ErrNoRow() {
  661. br.Msg = "获取信息失败"
  662. br.ErrMsg = "GetCygxActivityVoiceReqList,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  663. return
  664. }
  665. if len(voiceReqList) > 0 {
  666. for _, voice := range voiceReqList {
  667. go cygxService.UpdateResourceData(voice.ActivityVoiceId, "activityvoice", "delete", time.Now().Format(utils.FormatDateTime))
  668. }
  669. }
  670. //}
  671. //如果活动信息有如下变更则做消息推送
  672. voiceIdNew, videoIdNew, err := cygx.EditActivity(item, activityInfo.PublishStatus, industrialActivityItemsList, subjectActivityItemsList, itemVoice, itemVideo, itemPointsSet)
  673. if err != nil {
  674. br.Msg = "操作失败"
  675. br.ErrMsg = "操作失败,Err:" + err.Error()
  676. return
  677. }
  678. //更新活动音频
  679. if int(voiceIdNew) > 0 {
  680. go cygxService.UpdateResourceData(int(voiceIdNew), "activityvoice", "add", activityInfo.ActivityTime)
  681. }
  682. //更新活动视频
  683. if int(videoIdNew) > 0 {
  684. go cygxService.UpdateResourceData(int(videoIdNew), "activityvideo", "add", activityInfo.ActivityTime)
  685. }
  686. errAct = err
  687. if activityInfo.PublishStatus == 1 && activityInfo.ActivityTimeText != item.ActivityTimeText {
  688. go services.SendWxMsgWithCygxActivityUpdateTime(req.ActivityId, activityInfo.ActivityTimeText, item.ActivityTimeText, "timeType")
  689. }
  690. oldExpert, _ := cygx.GetReportContentTextSub(activityInfo.Expert)
  691. newExpert, _ := cygx.GetReportContentTextSub(item.Expert)
  692. if activityInfo.PublishStatus == 1 && oldExpert != newExpert {
  693. go services.SendWxMsgWithCygxActivityUpdateTime(req.ActivityId, oldExpert, newExpert, "expertType")
  694. }
  695. if activityInfo.PublishStatus == 1 && activityInfo.Address != item.Address {
  696. go services.SendWxMsgWithCygxActivityUpdateTime(req.ActivityId, activityInfo.Address, item.Address, "addressType")
  697. }
  698. if activityInfo.PublishStatus == 1 && activityInfo.ParticipationCode != item.ParticipationCode {
  699. go services.SendWxMsgWithCygxActivityUpdateTime(req.ActivityId, activityInfo.ParticipationCode, item.ParticipationCode, "participationCode")
  700. }
  701. if activityInfo.PublishStatus == 1 && activityInfo.Theme != item.Theme {
  702. go services.SendWxMsgWithCygxActivityUpdateTime(req.ActivityId, activityInfo.Theme, item.Theme, "Theme")
  703. }
  704. //对于限制人数的活动,如果修改改了可见范围,对于新增的那一部分做新的推送
  705. if req.DoType == 0 && activityInfo.PublishStatus == 1 && activityInfo.ActiveState == 1 && activityInfo.LimitPeopleNum != "0" {
  706. if activityInfo.CustomerTypeIds != req.CustomerTypeIds || activityInfo.Scale != req.Scale || activityInfo.IsMakerShow != req.IsMakerShow || activityInfo.VisibleRange != req.VisibleRange {
  707. go cygxService.DoActivityOnenIdWxTemplateMsg(activityId)
  708. }
  709. }
  710. //已结束或者进行中的活动修改时间后,修改活动状态以及重新发送邮件附件
  711. if activeState != 0 && activeState != 1 {
  712. resultTime := utils.StrTimeToTime(item.ActivityTime) //时间字符串格式转时间格式
  713. if time.Now().Before(resultTime) {
  714. err := cygx.EditActivityStatus(req.ActivityId)
  715. if err != nil {
  716. br.Msg = "发布失败"
  717. br.ErrMsg = "发布失败,Err:" + err.Error()
  718. return
  719. }
  720. }
  721. }
  722. //修改活动人数限制之后,对于因为人数已满而失败的用户,推送模板消息
  723. if activityInfo.PublishStatus == 1 && activityInfo.IsLimitPeople != 0 && activityInfo.LimitPeopleNum != strconv.Itoa(req.LimitPeopleNum) {
  724. go cygxService.SendWxMsgWithCygxActivityUpdateLimitPeople(req.ActivityId)
  725. }
  726. go cygxService.YiDongSaveRoadshowDetail(activityId)
  727. //如果活动名称有变更就生成新的签到码
  728. if activityInfo.ActivityName != item.ActivityName || activityInfo.SigninImg == "" {
  729. go cygxService.MakeActivitySigninImg(req.ActivityId)
  730. }
  731. //如果活动之前是发布的状态,那么就对公司的扣点进行更新(涉及到新老公司的扣点返点,不放在Redis统一处理了)
  732. if activityInfo.PublishStatus == 1 {
  733. go cygxService.UpdateYanXuanActivityPointsBillOldComapny(activityInfo, AdminUser.AdminId, itemPointsSet, itemPointsSetOld) //活动发布以及取消发布处理研选扣点
  734. }
  735. //如果活动之前是未发布的状态,现在又发布了那么就对公司的扣点进行更新
  736. //if req.DoType == 1 && activityInfo.PublishStatus == 0 {
  737. // go cygxService.YanXuanActivityPointsBillActivityPublishAndCancel(activityId, AdminUser.AdminId, 1) //活动发布以及取消发布处理研选扣点
  738. //}
  739. }
  740. if errAct != nil {
  741. br.Msg = "发布失败"
  742. br.ErrMsg = "发布失败,Err:" + errAct.Error()
  743. return
  744. }
  745. //go cygxService.YanXuanActivityPointsBillActivityEdit(activityId, AdminUser.AdminId) //活动编辑处理研选扣点
  746. }
  747. }
  748. if req.ActivityId == 0 {
  749. _, activityIdArr, err := cygx.AddActivity(items, industrialActivityItemsList, subjectActivityItemsList, itemPointsSet)
  750. if err != nil {
  751. br.Msg = "发布失败"
  752. br.ErrMsg = "发布失败,Err:" + err.Error()
  753. return
  754. }
  755. //如果是添加多条活动那么就推送多次
  756. for _, v := range activityIdArr {
  757. if req.DoType == 1 {
  758. go func() {
  759. //同时添加多个活动的时候,避免协程开的过多
  760. cygxService.DoActivityOnenIdWxTemplateMsg(v)
  761. cygxService.UpdateResourceData(v, "activity", "add", time.Now().Format(utils.FormatDateTime))
  762. cygxService.YiDongSaveRoadshowDetail(v)
  763. cygxService.YanXuanActivityPointsBillActivityPublishAndCancel(v, AdminUser.AdminId, 1) //活动发布以及取消发布处理研选扣
  764. elastic.AddComprehensiveActivity(v)
  765. }()
  766. }
  767. go cygxService.MakeActivitySigninImg(v)
  768. }
  769. } else {
  770. if req.DoType == 1 {
  771. go cygxService.DoActivityOnenIdWxTemplateMsg(req.ActivityId)
  772. go cygxService.UpdateResourceData(req.ActivityId, "activity", "add", time.Now().Format(utils.FormatDateTime))
  773. go cygxService.YanXuanActivityPointsBillActivityPublishAndCancel(activityId, AdminUser.AdminId, 1) //活动发布以及取消发布处理研选扣点
  774. }
  775. //如果二次编辑的时候,取消了易董办会选项,那么就对易董发送取消发布到广场的通知
  776. if req.IsYidongConduct == 0 {
  777. go cygxService.YiDongUpdateActivityStatus(activityId)
  778. }
  779. }
  780. // 查研观向7.4-更新产业布局时间
  781. if len(industryIds) > 0 {
  782. go cygxService.UpdateIndustryLayoutTime(industryIds, false)
  783. }
  784. //添加操作日志记录
  785. br.Ret = 200
  786. br.Success = true
  787. br.Msg = "操作成功"
  788. br.IsAddLog = true
  789. }
  790. // @Title 活动列表
  791. // @Description 获取活动列表接口
  792. // @Param PageSize query int true "每页数据条数"
  793. // @Param CurrentIndex query int true "当前页页码,从1开始"
  794. // @Param PublishStatus query int false "发布状态 ,0未发布,1已发布,3已取消,传2查询所有"
  795. // @Param ChartPermissionId query string false "行业id"
  796. // @Param ActivityTypeId query string false "活动类型id"
  797. // @Param StartDate query string false "开始时间 ,列如2021-03-06 "
  798. // @Param EndDate query string false "结束时间,列如2021-03-06 "
  799. // @Param PublishStartDate query string false "发布开始时间 ,列如2021-03-06 "
  800. // @Param PublishEndDate query string false "发布结束时间,列如2021-03-06 "
  801. // @Param KeyWord query string false "搜索关键词"
  802. // @Param ActiveState query string false "活动进行状态 未开始:NotStarted、进行中HaveInHand、已结束Complete"
  803. // @Param IsResearch query bool true "是否为研选"
  804. // @Success 200 {object} cygx.GetCygxActivityListRep
  805. // @router /activity/list [get]
  806. func (this *ActivityCoAntroller) ActivityList() {
  807. br := new(models.BaseResponse).Init()
  808. defer func() {
  809. this.Data["json"] = br
  810. this.ServeJSON()
  811. }()
  812. sysUser := this.SysUser
  813. if sysUser == nil {
  814. br.Msg = "请登录"
  815. br.ErrMsg = "请登录,SysUser Is Empty"
  816. return
  817. }
  818. pageSize, _ := this.GetInt("PageSize")
  819. currentIndex, _ := this.GetInt("CurrentIndex")
  820. publishStatus, _ := this.GetInt("PublishStatus")
  821. chartPermissionId, _ := this.GetInt("ChartPermissionId")
  822. ActivityTypeId, _ := this.GetInt("ActivityTypeId")
  823. startDate := this.GetString("StartDate")
  824. endDate := this.GetString("EndDate")
  825. publishStartDate := this.GetString("PublishStartDate")
  826. publishEndDate := this.GetString("PublishEndDate")
  827. keyWord := this.GetString("KeyWord")
  828. activeState := this.GetString("ActiveState")
  829. activityLabel := this.GetString("ActivityLabel") // 查研观向7.4-活动标签
  830. isResearch, _ := this.GetBool("IsResearch", false) // 是否为研选 查研观向11.0 (研选活动独立显示)
  831. if activeState != "HaveInHand" && activeState != "Complete" {
  832. activeState = "NotStarted"
  833. }
  834. var startSize int
  835. if pageSize <= 0 {
  836. pageSize = utils.PageSize20
  837. }
  838. if currentIndex <= 0 {
  839. currentIndex = 1
  840. }
  841. startSize = utils.StartIndex(currentIndex, pageSize)
  842. var condition string
  843. var pars []interface{}
  844. //condition += ` FROM cygx_activity as art WHERE 1= 1 `
  845. if keyWord != "" {
  846. condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' ) `
  847. }
  848. if isResearch {
  849. chartPermissionId = utils.CHART_PERMISSION_ID_YANXUAN
  850. } else {
  851. condition += ` AND art.chart_permission_id != '` + strconv.Itoa(utils.CHART_PERMISSION_ID_YANXUAN) + `'`
  852. }
  853. //行业名称
  854. if chartPermissionId > 0 {
  855. condition += ` AND art.chart_permission_id = '` + strconv.Itoa(chartPermissionId) + `'`
  856. }
  857. if startDate != "" {
  858. condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
  859. }
  860. if endDate != "" {
  861. condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
  862. }
  863. //发布时间状态的筛选
  864. if publishStartDate != "" {
  865. condition += ` AND art.publish_date >= ` + "'" + publishStartDate + " 00:00:00'"
  866. publishStatus = 1
  867. }
  868. if publishEndDate != "" {
  869. condition += ` AND art.publish_date <= ` + "'" + publishEndDate + " 23:59:59'"
  870. publishStatus = 1
  871. }
  872. if publishStatus == 0 {
  873. condition += ` AND art.publish_status = 0 AND art.is_cancel = 0 `
  874. } else if publishStatus == 1 {
  875. condition += ` AND art.publish_status = 1 `
  876. } else if publishStatus == 3 {
  877. condition += ` AND art.publish_status = 0 AND art.is_cancel = 1 `
  878. }
  879. if ActivityTypeId > 0 {
  880. condition += ` AND art.activity_type_id = '` + strconv.Itoa(ActivityTypeId) + `'`
  881. }
  882. if activeState == "NotStarted" {
  883. condition += ` AND art.active_state =1 `
  884. } else if activeState == "HaveInHand" {
  885. condition += ` AND art.active_state =2 `
  886. } else {
  887. condition += ` AND art.active_state =3 `
  888. }
  889. // 活动标签
  890. if activityLabel != "" {
  891. condition += ` AND (art.label LIKE '%` + activityLabel + `%' ) `
  892. }
  893. //C类电话会,仅本组销售、部门管理员、admin、权益研究员账号能看到。
  894. if sysUser.Role != "admin" {
  895. conditionPermission, err := cygxService.GetAdminActivityPermission(sysUser, condition)
  896. if err != nil {
  897. br.Msg = "获取失败"
  898. br.ErrMsg = "获取失败,GetAdminActivityPermission Err:" + err.Error()
  899. return
  900. }
  901. condition += ` AND art.visible_range != 1 `
  902. condition += conditionPermission
  903. pars = append(pars, pars)
  904. }
  905. //1专家电话会、2分析师电话会、3公司调研电话会、4公司线下调研、5专家线下沙龙、6分析师线下沙龙
  906. total, err := cygx.GetActivityCount(condition, pars)
  907. if err != nil {
  908. br.Msg = "获取失败"
  909. br.ErrMsg = "获取失败,Err:" + err.Error()
  910. return
  911. }
  912. if activeState == "NotStarted" {
  913. condition += ` ORDER BY art.activity_time ASC `
  914. } else {
  915. condition += ` ORDER BY art.activity_time DESC `
  916. }
  917. list, errList := cygx.GetActivityListAll(condition, pars, startSize, pageSize)
  918. if errList != nil {
  919. br.Msg = "获取失败"
  920. br.ErrMsg = "获取失败,Err:" + errList.Error()
  921. return
  922. }
  923. var activityIds string
  924. for k, v := range list {
  925. if v.ChartPermissionNames != "" {
  926. list[k].ChartPermissionName = v.ChartPermissionNames
  927. }
  928. if v.IsCancel == 1 {
  929. v.PublishStatus = 3
  930. }
  931. activityIds += strconv.Itoa(v.ActivityId) + ","
  932. }
  933. activityIds = strings.TrimRight(activityIds, ",")
  934. mapIndustrial := make(map[int]string)
  935. mapSubject := make(map[string]string)
  936. mapUpload := make(map[int]bool)
  937. if activityIds != "" {
  938. industrialList, err := cygx.GetIndustrialActivityGroupListByactivityIds(activityIds)
  939. if err != nil {
  940. br.Msg = "获取失败"
  941. br.ErrMsg = "获取失败,GetIndustrialActivityGroupListByactivityIds Err:" + err.Error()
  942. return
  943. }
  944. subjectList, err := cygx.GetSubjectActivityGroupListByactivityIds(activityIds)
  945. if err != nil {
  946. br.Msg = "获取失败"
  947. br.ErrMsg = "获取失败,GetSubjectActivityGroupListByactivityIds Err:" + err.Error()
  948. return
  949. }
  950. //合并活动对应的多个标的
  951. for _, v := range subjectList {
  952. mapSubject[fmt.Sprint(v.ActivityId, "_", v.IndustrialManagementId)] += v.SubjectName + "/"
  953. }
  954. //活动对应的产业
  955. for _, v := range industrialList {
  956. var labelSubject string
  957. labelSubject = mapSubject[fmt.Sprint(v.ActivityId, "_", v.IndustrialManagementId)]
  958. if labelSubject != "" {
  959. mapIndustrial[v.ActivityId] += v.IndustryName + "--" + strings.TrimRight(labelSubject, "/") + ","
  960. } else {
  961. mapIndustrial[v.ActivityId] += v.IndustryName + ","
  962. }
  963. }
  964. var conditionupload string
  965. var pars []interface{}
  966. conditionupload = " AND activity_id IN (" + activityIds + ") "
  967. listVideo, err := cygx.GetActivityVideoList(conditionupload, pars)
  968. if err != nil && err.Error() != utils.ErrNoRow() {
  969. br.Msg = "获取失败"
  970. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  971. return
  972. }
  973. if len(listVideo) > 0 {
  974. for _, v := range listVideo {
  975. mapUpload[v.ActivityId] = true
  976. }
  977. }
  978. listVoice, err := cygx.GetActivityVoiceList(conditionupload, pars)
  979. if err != nil && err.Error() != utils.ErrNoRow() {
  980. br.Msg = "获取失败"
  981. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  982. return
  983. }
  984. if len(listVoice) > 0 {
  985. for _, v := range listVoice {
  986. mapUpload[v.ActivityId] = true
  987. }
  988. }
  989. }
  990. for k, v := range list {
  991. if mapIndustrial[v.ActivityId] != "" && v.TemporaryLabel == "" {
  992. list[k].Label = strings.TrimRight(mapIndustrial[v.ActivityId], ",")
  993. }
  994. if v.YidongActivityId != "" {
  995. list[k].ActivityTypeName += utils.YI_DONG_NAME
  996. if v.ChartPermissionNameDeputy != "" && v.ChartPermissionNameDeputy != v.ChartPermissionName {
  997. v.ChartPermissionName = v.ChartPermissionNameDeputy // 易董同步过来的活动展示副权限 v11.0
  998. }
  999. }
  1000. if v.IsYidongConduct == 1 {
  1001. list[k].ActivityTypeName += utils.YI_DONG_NAME_TWO
  1002. }
  1003. list[k].IsUpload = mapUpload[v.ActivityId]
  1004. //是否展示签到码
  1005. if (v.ActivityTypeId == 5 || v.ActivityTypeId == 6 || v.ActivityTypeId == 8) && v.SigninImg != "" && v.ActiveState == 1 && v.PublishStatus == 1 {
  1006. list[k].IsShowSigninButton = true
  1007. }
  1008. }
  1009. if len(list) == 0 {
  1010. list = make([]*cygx.CygxActivityList, 0)
  1011. }
  1012. page := paging.GetPaging(currentIndex, pageSize, total)
  1013. resp := new(cygx.GetCygxActivityListRep)
  1014. resp.List = list
  1015. resp.Paging = page
  1016. br.Ret = 200
  1017. br.Success = true
  1018. br.Msg = "获取成功"
  1019. br.Data = resp
  1020. }
  1021. // @Title 活动详情
  1022. // @Description 获取活动详情接口
  1023. // @Param ActivityId query int true "活动ID"
  1024. // @Success Ret=200 {object} cygx.ActivityDetail
  1025. // @router /activity/detail [get]
  1026. func (this *ActivityCoAntroller) Detail() {
  1027. br := new(models.BaseResponse).Init()
  1028. defer func() {
  1029. this.Data["json"] = br
  1030. this.ServeJSON()
  1031. }()
  1032. AdminUser := this.SysUser
  1033. if AdminUser == nil {
  1034. br.Msg = "请登录"
  1035. br.ErrMsg = "请登录,用户信息为空"
  1036. br.Ret = 408
  1037. return
  1038. }
  1039. activityId, _ := this.GetInt("ActivityId")
  1040. if activityId < 1 {
  1041. br.Msg = "请输入活动ID"
  1042. return
  1043. }
  1044. activityInfo, err := cygx.GetAddActivityInfoById(activityId)
  1045. if err != nil {
  1046. br.Msg = "活动不存在"
  1047. br.ErrMsg = "活动ID错误,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1048. return
  1049. }
  1050. detail, errDetail := cygx.GetActivityTypeDetailById(activityInfo.ActivityTypeId)
  1051. if errDetail != nil {
  1052. br.Msg = "获取信息失败"
  1053. br.ErrMsg = "获取信息失败,Err:" + errDetail.Error()
  1054. return
  1055. }
  1056. industrialList, err := cygx.GetIndustrialActivityGroupManagementList(activityId, 1)
  1057. if err != nil && err.Error() != utils.ErrNoRow() {
  1058. br.Msg = "获取信息失败"
  1059. br.ErrMsg = "获取活动关联的产业列表信息失败,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1060. return
  1061. }
  1062. var subjectList []*cygx.SubjectActivityGroupManagementRep
  1063. if len(industrialList) > 0 {
  1064. subjectList, err = cygx.GetSubjectActivityGroupManagementList(activityId, 1)
  1065. if err != nil && err.Error() != utils.ErrNoRow() {
  1066. br.Msg = "获取信息失败"
  1067. br.ErrMsg = "获取活动关联的标的列表信息失败,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1068. return
  1069. }
  1070. }
  1071. VoiceReqList, err := cygx.GetCygxActivityVoiceReqList(activityId)
  1072. if err != nil && err.Error() != utils.ErrNoRow() {
  1073. br.Msg = "获取信息失败"
  1074. br.ErrMsg = "GetCygxActivityVoiceReqList,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1075. return
  1076. }
  1077. if len(VoiceReqList) == 0 {
  1078. VoiceReqList = make([]*cygx.CygxActivityVoiceReq, 0)
  1079. }
  1080. VideoDetail, err := cygx.GetCygxActivityVideoReqDetail(activityId)
  1081. if err != nil && err.Error() != utils.ErrNoRow() {
  1082. br.Msg = "获取信息失败"
  1083. br.ErrMsg = "GetCygxActivityVideoReqDetail,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1084. return
  1085. }
  1086. if activityInfo.CustomerTypeIds != "" {
  1087. customerTypeIdslist := strings.Split(activityInfo.CustomerTypeIds, ",")
  1088. var permissionValueStr string
  1089. for _, v := range customerTypeIdslist {
  1090. permissionValueStr += "'" + v + "',"
  1091. }
  1092. permissionValueStr = strings.TrimRight(permissionValueStr, ",")
  1093. condition := ` AND permission_value IN (` + permissionValueStr + `)`
  1094. listValue, err := cygx.GetActivityCcustomerTypeList(condition)
  1095. if err != nil {
  1096. br.Msg = "活动可见套餐类型错误,请核实"
  1097. br.ErrMsg = "GetActivityCcustomerTypeList,Err:" + err.Error()
  1098. return
  1099. }
  1100. activityInfo.CustomerTypeIds = ""
  1101. for _, v := range listValue {
  1102. activityInfo.CustomerTypeIds += strconv.Itoa(v.CustomerTypeId) + ","
  1103. }
  1104. activityInfo.CustomerTypeIds = strings.TrimRight(activityInfo.CustomerTypeIds, ",")
  1105. }
  1106. if activityInfo.SiginupDeadline == utils.EmptyDateTimeStr {
  1107. activityInfo.SiginupDeadline = ""
  1108. }
  1109. PointsSetDetail, err := cygx.GetCygxActivityPointsSetDetail(activityId)
  1110. if err != nil && err.Error() != utils.ErrNoRow() {
  1111. br.Msg = "获取信息失败"
  1112. br.ErrMsg = "GetCygxActivityPointsSetDetail,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
  1113. return
  1114. }
  1115. if PointsSetDetail != nil {
  1116. if PointsSetDetail.CancelDeadlineType == "0" {
  1117. PointsSetDetail.CancelDeadlineType = ""
  1118. }
  1119. activityInfo.PointsSet = PointsSetDetail
  1120. } else {
  1121. activityInfo.PointsSet = new(cygx.CygxActivityPointsSetRsq)
  1122. }
  1123. //可见范围 1,仅本组可见 、2,全部客户可见 没设置本组可见的,强制设置为全部客户可见
  1124. if activityInfo.VisibleRange == 0 {
  1125. activityInfo.VisibleRange = 2
  1126. }
  1127. //activityInfo.CancelDeadlineType = cygxService.ActivityCancelDeadlineType(activityInfo) //处理活动取消报名截止时间类型展示
  1128. activityInfo.VoiceList = VoiceReqList
  1129. activityInfo.VideoDetail = VideoDetail
  1130. activityInfo.ShowType = detail.ShowType
  1131. activityInfo.ListIndustrial = industrialList
  1132. activityInfo.ListSubject = subjectList
  1133. br.Ret = 200
  1134. br.Success = true
  1135. br.Msg = "获取成功"
  1136. br.Data = activityInfo
  1137. }
  1138. // @Title 活动的发布与取消发布
  1139. // @Description 活动的发布与取消发布接口
  1140. // @Param request body cygx.ActivityIdRep true "type json string"
  1141. // @Success 200 操作成功
  1142. // @router /activity/PublishAndCancel [post]
  1143. func (this *ActivityCoAntroller) PublishAndCancel() {
  1144. br := new(models.BaseResponse).Init()
  1145. defer func() {
  1146. this.Data["json"] = br
  1147. this.ServeJSON()
  1148. }()
  1149. AdminUser := this.SysUser
  1150. if AdminUser == nil {
  1151. br.Msg = "请登录"
  1152. br.ErrMsg = "请登录,用户信息为空"
  1153. br.Ret = 408
  1154. return
  1155. }
  1156. var req cygx.ActivityIdRep
  1157. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1158. if err != nil {
  1159. br.Msg = "参数解析异常!"
  1160. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1161. return
  1162. }
  1163. activityId := req.ActivityId
  1164. item := new(cygx.CygxActivity)
  1165. activityInfo, errInfo := cygx.GetAddActivityInfoById(activityId)
  1166. if activityInfo == nil {
  1167. br.Msg = "操作失败"
  1168. br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId)
  1169. return
  1170. }
  1171. if errInfo != nil {
  1172. br.Msg = "操作失败"
  1173. br.ErrMsg = "操作失败,Err:" + errInfo.Error()
  1174. return
  1175. }
  1176. //校验活动后台管理员、销售是否有修改权限
  1177. havePower, popupMsg, err := cygxService.CheckActivityUpdatePower(AdminUser.AdminId, activityInfo)
  1178. if err != nil {
  1179. br.Msg = "获取管理员身份信息失败"
  1180. br.ErrMsg = "获取管理员身份信息失败,Err:" + err.Error()
  1181. return
  1182. }
  1183. if !havePower {
  1184. br.Msg = popupMsg
  1185. return
  1186. }
  1187. //if activityInfo.ActiveState != 1 {
  1188. // br.Msg = "活动已经开始,无法修改"
  1189. // return
  1190. //}
  1191. if activityInfo.PublishStatus == 0 {
  1192. item.PublishStatus = 1
  1193. item.IsCancel = 0
  1194. go cygxService.DoActivityOnenIdWxTemplateMsg(activityId)
  1195. go cygxService.UpdateResourceData(activityId, "activity", "add", time.Now().Format(utils.FormatDateTime))
  1196. } else {
  1197. item.PublishStatus = 0
  1198. item.IsCancel = 1
  1199. }
  1200. if activityInfo.PublishStatus == 1 {
  1201. go services.SendWxMsgWithCygxActivity(req.ActivityId)
  1202. //同步活动到最新数据表
  1203. go cygxService.UpdateResourceData(req.ActivityId, "activity", "delete", "")
  1204. }
  1205. item.ActivityId = req.ActivityId
  1206. if item.PublishStatus == 1 {
  1207. item.AdminId = AdminUser.AdminId
  1208. item.AdminName = AdminUser.RealName
  1209. item.PublishDate = time.Now()
  1210. } else {
  1211. item.AdminId = activityInfo.AdminId
  1212. item.AdminName = activityInfo.AdminName
  1213. item.PublishDate = utils.StrTimeToTime(activityInfo.PublishDate)
  1214. }
  1215. err = cygx.ActivityPublishAndCancel(item)
  1216. if err != nil {
  1217. br.Msg = "操作失败"
  1218. br.ErrMsg = "操作失败,Err:" + err.Error()
  1219. return
  1220. }
  1221. if item.PublishStatus == 1 {
  1222. //易董那边重新发布,重新建会
  1223. go cygxService.YiDongSaveRoadshowDetail(activityId)
  1224. } else {
  1225. //易董那边取消发布并删除
  1226. go cygxService.YiDongUpdateActivityPublish(activityId)
  1227. }
  1228. go cygxService.YanXuanActivityPointsBillActivityPublishAndCancel(activityId, AdminUser.AdminId, item.PublishStatus) //活动发布以及取消发布处理研选扣点
  1229. go elastic.AddComprehensiveActivity(activityId) // 同步Es添加活动
  1230. br.Ret = 200
  1231. br.Success = true
  1232. br.Msg = "操作成功"
  1233. br.IsAddLog = true //添加操作日志记录
  1234. }
  1235. // @Title 删除活动
  1236. // @Description 删除活动接口
  1237. // @Param request body cygx.ActivityIdRep true "type json string"
  1238. // @Success Ret=200
  1239. // @router /activity/delete [post]
  1240. func (this *ActivityCoAntroller) Delete() {
  1241. br := new(models.BaseResponse).Init()
  1242. defer func() {
  1243. this.Data["json"] = br
  1244. this.ServeJSON()
  1245. }()
  1246. AdminUser := this.SysUser
  1247. if AdminUser == nil {
  1248. br.Msg = "请登录"
  1249. br.ErrMsg = "请登录,SysUser Is Empty"
  1250. br.Ret = 408
  1251. return
  1252. }
  1253. var req cygx.ActivityIdRep
  1254. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1255. if err != nil {
  1256. br.Msg = "参数解析异常!"
  1257. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1258. return
  1259. }
  1260. activityId := req.ActivityId
  1261. if activityId < 1 {
  1262. br.Msg = "请输入活动ID"
  1263. return
  1264. }
  1265. activityInfo, errInfo := cygx.GetAddActivityInfoById(activityId)
  1266. if activityInfo == nil {
  1267. br.Msg = "操作失败"
  1268. br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(activityId)
  1269. return
  1270. }
  1271. if errInfo != nil {
  1272. br.Msg = "操作失败"
  1273. br.ErrMsg = "操作失败,Err:" + errInfo.Error()
  1274. return
  1275. }
  1276. //校验活动后台管理员、销售是否有修改权限
  1277. havePower, popupMsg, err := cygxService.CheckActivityUpdatePower(AdminUser.AdminId, activityInfo)
  1278. if err != nil {
  1279. br.Msg = "获取管理员身份信息失败"
  1280. br.ErrMsg = "获取管理员身份信息失败,Err:" + err.Error()
  1281. return
  1282. }
  1283. if !havePower {
  1284. br.Msg = popupMsg
  1285. return
  1286. }
  1287. resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式
  1288. res := time.Now().Before(resultTime)
  1289. if res == false {
  1290. br.Msg = "活动已结束禁止删除!"
  1291. br.ErrMsg = "活动已结束禁止删除!"
  1292. return
  1293. }
  1294. err = cygx.DeleteActivity(activityId)
  1295. if err != nil {
  1296. br.Msg = "删除信息失败"
  1297. br.ErrMsg = "删除信息失败,Err:" + err.Error()
  1298. return
  1299. }
  1300. //添加操作日志记录
  1301. br.Ret = 200
  1302. br.Success = true
  1303. br.Msg = "已删除"
  1304. br.IsAddLog = true
  1305. }
  1306. // @Title 获取活动行业分类
  1307. // @Description 获取活动行业分类接口
  1308. // @Param IsHideResearch query bool false "是否隐藏买方研选(默认不隐藏)"
  1309. // @Success 200 {object} cygx.ChartPermissionRepMoreList
  1310. // @router /activity/chartPermission/list [get]
  1311. func (this *ActivityCoAntroller) ChartPermissionListAct() {
  1312. br := new(models.BaseResponse).Init()
  1313. defer func() {
  1314. this.Data["json"] = br
  1315. this.ServeJSON()
  1316. }()
  1317. AdminUser := this.SysUser
  1318. if AdminUser == nil {
  1319. br.Msg = "请登录"
  1320. br.ErrMsg = "请登录,用户信息为空"
  1321. br.Ret = 408
  1322. return
  1323. }
  1324. //数据库新加行业分类,与之前的项目权限部分冲突太多,故采用自定义而不去数据库查找
  1325. resp := new(cygx.ChartPermissionRepMoreList)
  1326. // 查研观向7.4-策略后面新增一个宏观
  1327. resp.List = cygxService.GetActChartPermissionList()
  1328. br.Ret = 200
  1329. br.Success = true
  1330. br.Msg = "获取成功"
  1331. br.Data = resp
  1332. }
  1333. // @Title 扣点设置
  1334. // @Description 扣点设置接口
  1335. // @Success 200 {object} cygx.CygxActivityPointsSetConfigListResp
  1336. // @router /activity/pointsSet [get]
  1337. func (this *ActivityCoAntroller) PointsSet() {
  1338. br := new(models.BaseResponse).Init()
  1339. defer func() {
  1340. this.Data["json"] = br
  1341. this.ServeJSON()
  1342. }()
  1343. AdminUser := this.SysUser
  1344. if AdminUser == nil {
  1345. br.Msg = "请登录"
  1346. br.ErrMsg = "请登录,用户信息为空"
  1347. br.Ret = 408
  1348. return
  1349. }
  1350. conf, err := cygx.GetCygxConfigDetailByCode("activity_points_set")
  1351. if err != nil {
  1352. br.Msg = "获取数据失败"
  1353. br.ErrMsg = "买方研选产品介绍信息失败,Err:" + err.Error()
  1354. return
  1355. }
  1356. if conf.ConfigValue == "" {
  1357. br.Msg = "获取失败"
  1358. br.ErrMsg = "买方研选产品介绍信息失败"
  1359. return
  1360. }
  1361. list := new(*cygx.CygxActivityPointsSetConfigListResp)
  1362. if err = json.Unmarshal([]byte(conf.ConfigValue), &list); err != nil {
  1363. br.Msg = "获取失败"
  1364. br.ErrMsg = "买方研选产品介绍信配置值解析失败, Err: " + err.Error()
  1365. return
  1366. }
  1367. br.Ret = 200
  1368. br.Success = true
  1369. br.Msg = "获取成功"
  1370. br.Data = list
  1371. }
  1372. // @Title 权益办会机构搜索
  1373. // @Description 权益办会机构搜索
  1374. // @Param KeyWord query string false "搜索关键词"
  1375. // @Success 200 {object} cygx.ChartPermissionRepMoreList
  1376. // @router /activity/companySearch [get]
  1377. func (this *ActivityCoAntroller) CompanySearch() {
  1378. br := new(models.BaseResponse).Init()
  1379. defer func() {
  1380. this.Data["json"] = br
  1381. this.ServeJSON()
  1382. }()
  1383. AdminUser := this.SysUser
  1384. if AdminUser == nil {
  1385. br.Msg = "请登录"
  1386. br.ErrMsg = "请登录,用户信息为空"
  1387. br.Ret = 408
  1388. return
  1389. }
  1390. keyWord := this.GetString("KeyWord")
  1391. if keyWord == "" {
  1392. br.ErrMsg = "请输入搜索关键词"
  1393. return
  1394. }
  1395. resp := new(cygx.CygxActivitySearcCompanyListResp)
  1396. list, err := cygx.GetCygxActivitySearcCompanyList(keyWord)
  1397. if err != nil {
  1398. br.Msg = "操作失败"
  1399. br.ErrMsg = "操作失败,Err:" + err.Error()
  1400. return
  1401. }
  1402. if len(list) == 0 {
  1403. list = make([]*cygx.CygxActivitySearcCompanyResp, 0)
  1404. }
  1405. resp.List = list
  1406. br.Ret = 200
  1407. br.Success = true
  1408. br.Msg = "获取成功"
  1409. br.Data = resp
  1410. }
  1411. // @Title 报名截止时间设置
  1412. // @Description 报名截止时间设置接口
  1413. // @Success Ret=200
  1414. // @router /activity/deadlineSet [get]
  1415. func (this *ActivityCoAntroller) DeadlineSet() {
  1416. br := new(models.BaseResponse).Init()
  1417. defer func() {
  1418. this.Data["json"] = br
  1419. this.ServeJSON()
  1420. }()
  1421. AdminUser := this.SysUser
  1422. if AdminUser == nil {
  1423. br.Msg = "请登录"
  1424. br.ErrMsg = "请登录,SysUser Is Empty"
  1425. return
  1426. }
  1427. list := make([]cygx.SendGroupStr, 0)
  1428. list = append(list, cygx.SendGroupStr{
  1429. Id: "1",
  1430. Name: "同报名截止时间",
  1431. })
  1432. list = append(list, cygx.SendGroupStr{
  1433. Id: "2",
  1434. Name: "活动开始前24小时",
  1435. })
  1436. list = append(list, cygx.SendGroupStr{
  1437. Id: "3",
  1438. Name: "活动开始前48小时",
  1439. })
  1440. br.Ret = 200
  1441. br.Success = true
  1442. br.Data = list
  1443. }
  1444. // @Title 根据图片获取建会信息接口
  1445. // @Description 根据图片获取建会信息接口
  1446. // @Param request body cygx.ActivityIdRep true "type json string"
  1447. // @Success Ret=200
  1448. // @router /activity/imgToText [post]
  1449. func (this *ActivityCoAntroller) ImgToText() {
  1450. br := new(models.BaseResponse).Init()
  1451. defer func() {
  1452. this.Data["json"] = br
  1453. this.ServeJSON()
  1454. }()
  1455. AdminUser := this.SysUser
  1456. if AdminUser == nil {
  1457. br.Msg = "请登录"
  1458. br.ErrMsg = "请登录,SysUser Is Empty"
  1459. br.Ret = 408
  1460. return
  1461. }
  1462. var req cygx.AliyunOcrImgUrlReq
  1463. resp := new(cygx.AliyunOcrTextActivityListResp)
  1464. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1465. if err != nil {
  1466. br.Msg = "参数解析异常!"
  1467. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1468. return
  1469. }
  1470. imgUrl := req.ImgUrl
  1471. if imgUrl == "" {
  1472. br.Msg = "请上传图片"
  1473. return
  1474. }
  1475. ocrResp, err := services.AliOcrByImageToText(imgUrl)
  1476. if err != nil {
  1477. br.Msg = "图片解析失败!"
  1478. br.ErrMsg = "图片解析失败,Err:" + err.Error()
  1479. return
  1480. }
  1481. if len(ocrResp.Ret) == 0 {
  1482. br.Msg = "图片解析失败!"
  1483. return
  1484. }
  1485. var titmeYMD string
  1486. var titmeHM string
  1487. var company string
  1488. var list []*cygx.AliyunOcrTextActivityResp
  1489. var mapTitmeYMD = make(map[int]string)
  1490. var mapTitmeHM = make(map[int]string)
  1491. var mapCompany = make(map[int]string)
  1492. var lineNum int
  1493. for k, v := range ocrResp.Ret {
  1494. if k == 0 && !strings.Contains(v.Word, "/") {
  1495. continue
  1496. }
  1497. if strings.Contains(v.Word, "/") {
  1498. mapTitmeYMD[lineNum] = v.Word
  1499. titmeYMD = v.Word
  1500. }
  1501. if strings.Contains(v.Word, "AM") || strings.Contains(v.Word, "PM") {
  1502. mapTitmeHM[lineNum] = v.Word
  1503. titmeHM = v.Word
  1504. }
  1505. if strings.Contains(v.Word, "(") && strings.Contains(v.Word, ")") {
  1506. if mapTitmeYMD[lineNum] == "" {
  1507. mapTitmeYMD[lineNum] = mapTitmeYMD[lineNum-1]
  1508. }
  1509. titmeYMD = mapTitmeYMD[lineNum]
  1510. mapCompany[lineNum] = v.Word
  1511. company = v.Word
  1512. lineNum++
  1513. }
  1514. if titmeYMD != "" && titmeHM != "" && company != "" {
  1515. item := new(cygx.AliyunOcrTextActivityResp)
  1516. item.TitmeYMD = titmeYMD
  1517. item.TitmeHM = titmeHM
  1518. item.Company = company
  1519. list = append(list, item)
  1520. titmeYMD = ""
  1521. titmeHM = ""
  1522. company = ""
  1523. }
  1524. }
  1525. for _, v := range list {
  1526. v.TitmeYMD = cygxService.ConvertActivityTitmeYMD(v.TitmeYMD)
  1527. v.TitmeHM = cygxService.ConvertActivityTitmeHM(v.TitmeHM)
  1528. }
  1529. resp.List = list
  1530. br.Ret = 200
  1531. br.Success = true
  1532. br.Data = resp
  1533. br.IsAddLog = true
  1534. }