db.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. package models
  2. import (
  3. _ "github.com/go-sql-driver/mysql"
  4. "hongze/hz_crm_api/models/advisory"
  5. "hongze/hz_crm_api/models/aimod"
  6. "hongze/hz_crm_api/models/business_trip"
  7. "hongze/hz_crm_api/models/company"
  8. "hongze/hz_crm_api/models/company_report_permission_log"
  9. "hongze/hz_crm_api/models/company_todo"
  10. "hongze/hz_crm_api/models/company_user"
  11. "hongze/hz_crm_api/models/contract"
  12. "hongze/hz_crm_api/models/cygx"
  13. "hongze/hz_crm_api/models/data_manage"
  14. future_good2 "hongze/hz_crm_api/models/data_manage/future_good"
  15. "hongze/hz_crm_api/models/data_manage/supply_analysis"
  16. "hongze/hz_crm_api/models/day_new"
  17. "hongze/hz_crm_api/models/eta_business"
  18. "hongze/hz_crm_api/models/eta_training_video"
  19. "hongze/hz_crm_api/models/eta_trial"
  20. "hongze/hz_crm_api/models/help_doc"
  21. "hongze/hz_crm_api/models/overseas_custom"
  22. "hongze/hz_crm_api/models/roadshow"
  23. "hongze/hz_crm_api/models/seal"
  24. "hongze/hz_crm_api/models/system"
  25. "hongze/hz_crm_api/models/video"
  26. "hongze/hz_crm_api/models/yb"
  27. "hongze/hz_crm_api/utils"
  28. "time"
  29. "github.com/beego/beego/v2/client/orm"
  30. )
  31. func init() {
  32. _ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL)
  33. orm.SetMaxIdleConns("default", 50)
  34. orm.SetMaxOpenConns("default", 100)
  35. db, _ := orm.GetDB("default")
  36. db.SetConnMaxLifetime(10 * time.Minute)
  37. _ = orm.RegisterDataBase("rddp", "mysql", utils.MYSQL_URL_RDDP)
  38. orm.SetMaxIdleConns("rddp", 50)
  39. orm.SetMaxOpenConns("rddp", 100)
  40. report_db, _ := orm.GetDB("rddp")
  41. report_db.SetConnMaxLifetime(10 * time.Minute)
  42. _ = orm.RegisterDataBase("edb", "mysql", utils.MYSQL_URL_EDB)
  43. orm.SetMaxIdleConns("edb", 50)
  44. orm.SetMaxOpenConns("edb", 100)
  45. edb_db, _ := orm.GetDB("edb")
  46. edb_db.SetConnMaxLifetime(10 * time.Minute)
  47. _ = orm.RegisterDataBase("data", "mysql", utils.MYSQL_URL_DATA)
  48. orm.SetMaxIdleConns("data", 50)
  49. orm.SetMaxOpenConns("data", 100)
  50. data_db, _ := orm.GetDB("data")
  51. data_db.SetConnMaxLifetime(10 * time.Minute)
  52. _ = orm.RegisterDataBase("gl", "mysql", utils.MYSQL_URL_GL)
  53. orm.SetMaxIdleConns("gl", 50)
  54. orm.SetMaxOpenConns("gl", 100)
  55. gl, _ := orm.GetDB("gl")
  56. gl.SetConnMaxLifetime(10 * time.Minute)
  57. _ = orm.RegisterDataBase("comein_data", "mysql", utils.MYSQL_URL_COMEIN_DATA)
  58. orm.SetMaxIdleConns("comein_data", 50)
  59. orm.SetMaxOpenConns("comein_data", 100)
  60. comein_datadb, _ := orm.GetDB("comein_data")
  61. comein_datadb.SetConnMaxLifetime(10 * time.Minute)
  62. _ = orm.RegisterDataBase("weekly_trial", "mysql", utils.MYSQL_URL_WEEKLY_TRIAL)
  63. orm.SetMaxIdleConns("weekly_trial", 50)
  64. orm.SetMaxOpenConns("weekly_trial", 100)
  65. trial_datadb, _ := orm.GetDB("weekly_trial")
  66. trial_datadb.SetConnMaxLifetime(10 * time.Minute)
  67. _ = orm.RegisterDataBase("fms", "mysql", utils.MYSQL_URL_FMS)
  68. orm.SetMaxIdleConns("fms", 50)
  69. orm.SetMaxOpenConns("fms", 100)
  70. fms_datadb, _ := orm.GetDB("fms")
  71. fms_datadb.SetConnMaxLifetime(10 * time.Minute)
  72. _ = orm.RegisterDataBase("hz_cygx", "mysql", utils.MYSQL_URL_CYGX)
  73. orm.SetMaxIdleConns("hz_cygx", 50)
  74. orm.SetMaxOpenConns("hz_cygx", 100)
  75. cygx_db, _ := orm.GetDB("hz_cygx")
  76. cygx_db.SetConnMaxLifetime(10 * time.Minute)
  77. orm.Debug = true
  78. orm.DebugLog = orm.NewLog(utils.Binlog)
  79. //注册对象
  80. orm.RegisterModel(
  81. new(Classify),
  82. new(Banner),
  83. new(Resource),
  84. //new(Ppt),
  85. //new(PptPages),
  86. //new(PptPublishRecord),
  87. new(video.Video),
  88. new(video.VideoTags),
  89. new(OssSTSToken),
  90. //new(PptV2),
  91. //new(PptV2PublishRecord),
  92. //new(PptV2SaveLog),
  93. //new(PptV2Group),
  94. //new(PptV2GroupMapping),
  95. //new(PptV2Grant), //ppt授权操作表
  96. new(VarietyClassify), // 标签分类表
  97. new(VarietyTag), // 标签表
  98. new(ResearchVarietyTagRelation), // 研究员标签关系表
  99. //new(ReportPptImg), //Ppt转报告的图片记录表
  100. )
  101. // 系统表 数据表
  102. initSystem()
  103. // 客户相关
  104. initCompany()
  105. // 联系人相关
  106. initWxUser()
  107. // 报告相关 数据表
  108. initReport()
  109. // 合同 数据表
  110. initContract()
  111. // 用印 数据表
  112. initSeal()
  113. // 研报 数据表
  114. initYb()
  115. // 路演记录 数据表
  116. initRoadShow()
  117. // 注册Edb沙盘 数据表
  118. //initSandbox()
  119. // 上海指标服务 数据表
  120. initShEdbData()
  121. // 指标服务 数据表
  122. initEdbData()
  123. // 图表 数据表
  124. initChart()
  125. // 查研观项 数据表
  126. initCygx()
  127. // 英文报告
  128. initEnglishReport()
  129. // 英文ppt
  130. //initPptEnglish()
  131. // 期货数据库
  132. initFutureGood()
  133. // 共享网盘
  134. //initCloudDisk()
  135. //ETA试用
  136. initETATrial()
  137. //出差审批
  138. initBusinessTrip()
  139. // 每刻报销
  140. initMaycur()
  141. // 语义分析
  142. //initSemanticAnalysis()
  143. // 供应分析
  144. initSupplyAnalysis()
  145. //多图配置
  146. initMultipleGraphConfig()
  147. //AI 聊天记录
  148. initAiChat()
  149. // ETA商家
  150. initEtaBusiness()
  151. // ETA版本更新日志
  152. initEtaVersionUpdateLog()
  153. // 帮助文档
  154. initHelpDoc()
  155. // ETA培训视频
  156. initEtaTrainingVideo()
  157. //海外客户
  158. initOverseasCustom()
  159. }
  160. // initSystem 系统表 数据表
  161. func initSystem() {
  162. orm.RegisterModel(
  163. new(system.SysUserLoginRecord),
  164. new(system.SysSession),
  165. new(system.SysDepartment),
  166. new(system.SysGroup),
  167. //new(system.SysRoleMenu),
  168. new(system.SysRoleMenuCrm),
  169. new(system.Admin),
  170. new(system.SysRole),
  171. new(system.SysMenuButton),
  172. new(system.SysRoleButton),
  173. new(system.ApprovalFlow), //审批配置表
  174. new(system.ApprovalFlowNode), //审批节点配置表
  175. new(system.ResearchGroup), // 研究员研究方向分组表
  176. new(system.ResearchGroupRelation), // 研究员研究方向分组关系表
  177. new(system.SysRoleAdmin), //管理员账号和角色映射表
  178. new(system.AdminConfig), //系统用户配置表
  179. new(system.AdminOperateRecord),
  180. new(system.AdminVerifyCodeRecord), // 用户短信邮箱验证码记录表
  181. )
  182. }
  183. // initCompany 客户相关 数据表
  184. func initCompany() {
  185. orm.RegisterModel(
  186. new(company.CompanyApprovalMessage),
  187. new(company.CompanyOperationRecord),
  188. new(company.Company),
  189. new(company.CompanyPermissionLog),
  190. new(company.CompanyReportPermission),
  191. new(company.CompanyContract),
  192. new(company.CompanyContractPermission),
  193. new(company.CompanyContractPermissionLog),
  194. new(company.CompanyProduct),
  195. new(company.CompanyLog),
  196. new(company.CompanyProductLog),
  197. new(company.CompanyRenewalReason),
  198. new(company.CompanyApproval),
  199. new(company.CompanyProductRemark),
  200. new(company.CompanyDelayPermission),
  201. new(company.CompanyProductUpdateLog), //客户产品变更状态表
  202. new(company.CompanyProductTryOutUpdateLog), //客户产品试用变更状态表
  203. new(company.CompanyProductTryOutUpdatePermissionLog), //客户产品试用变更品种详情表
  204. new(company.CompanyDeleteBak), //客户删除时的信息备注表
  205. new(company.WxUserOpLog), //联系人日志记录表
  206. new(company_todo.CompanyTodo), //客户任务列表
  207. new(company.SellerCompanyPermission), //销售客户权限("添加客户"权限)
  208. new(company.CompanyServiceRecord), // 客户服务记录表
  209. new(company.CompanyAscribe), // 客户归因
  210. new(company.CompanyNoRenewedNote), // 客户未续约记录
  211. new(company.CompanyNoRenewedAscribe), // 确认不续约记录
  212. new(company.CompanyNoRenewedAscribeLog), // 确认不续约记录日志
  213. new(company.CompanyContractNoRenewedAscribe), // 合同确认不续约记录
  214. new(company.CompanyContractNoRenewedAscribeLog), // 合同确认不续约记录日志
  215. new(company.CrmConfig), // 管理后台基本配置表
  216. new(company.CompanyRenewalRecord), // 客户续约状态记录表
  217. new(company.CompanyHistoryRemark), // 客户记录历史记录表
  218. new(company.WxUserMoveLog), // 客户联系人移动记录日志表
  219. )
  220. }
  221. // initWxUser 联系人相关 数据表
  222. func initWxUser() {
  223. orm.RegisterModel(
  224. new(WxUser),
  225. new(UserSellerRelation),
  226. new(UserRecord),
  227. new(UserTrialApply),
  228. new(company_user.ChartClassifyPermission), // 联系人图表权限表
  229. new(company_user.CompanyUserChartPermissionOperationRecord), // 联系人图表权限操作记录表
  230. )
  231. }
  232. // initReport 报告相关 数据表
  233. func initReport() {
  234. orm.RegisterModel(
  235. new(Report),
  236. new(ReportViewRecord),
  237. new(advisory.AdvisoryArticle),
  238. new(advisory.AdvisoryArticleLog),
  239. //new(ResearchReport), //日报、周报信息
  240. new(ChartPermissionSearchKeyWordMapping), //报告分类权限表
  241. new(ReportChapter), // 报告章节表
  242. //new(ReportChapterTicker), // 晨报章节ticker
  243. //new(ReportChapterTypePermission), // 晨周报章节类型权限表
  244. new(company_report_permission_log.CompanyReportPermissionLog),
  245. new(ReportSendThsDetail), //报告发送至同花顺记录
  246. new(GroupSendMsg), //群发消息
  247. new(UserTemplateRecord), //模板消息记录
  248. new(ChartPermission), // 权限表
  249. new(YbPcSuncode),
  250. new(YbSuncodePars),
  251. //new(ReportAuthor), //报告作者
  252. new(ClassifyMenu), // 报告分类-子目录表
  253. new(ClassifyMenuRelation), // 报告分类-子目录关联表
  254. new(ReportSendThsConfig), //产品推送给同花顺的配置表
  255. //new(ChartPermissionChapterMapping), // 权限mapping表
  256. new(ReportChapterType), // 报告章节类型表
  257. new(UserReportViewRecord), // 用户报告阅读记录表(汇总表)
  258. )
  259. }
  260. // initContract 合同 数据表
  261. func initContract() {
  262. orm.RegisterModel(
  263. new(contract.ContractServiceTemplate), //合同服务模板表
  264. new(contract.ContractTemplate), //合同模板表
  265. new(contract.Contract), //合同主表
  266. new(contract.ContractService), //合同服务
  267. new(contract.ContractServiceDetail), //合同服务详情
  268. new(contract.ContractApproval), //合同审批单
  269. new(contract.ContractApprovalRecord), //合同审批流程单(具体审批节点)
  270. new(contract.ContractOperationRecord), //合同操作记录表
  271. new(contract.PayChannel), //支付渠道表
  272. )
  273. }
  274. // initSeal 用印 数据表
  275. func initSeal() {
  276. orm.RegisterModel(
  277. new(seal.Seal), //用印表
  278. new(seal.SealOperationRecord), // 用印操作记录表
  279. new(seal.Attachment), //用印附件表
  280. )
  281. }
  282. // initYb 研报 数据表
  283. func initYb() {
  284. orm.RegisterModel(
  285. new(yb.Activity), // 研报活动表
  286. new(yb.ActivityType), // 研报活动分类表
  287. new(yb.ActivityVoice), // 研报活动语音表
  288. new(yb.ActivityRegister), // 研报活动报名表
  289. new(yb.Speaker), // 研报主持人表
  290. new(yb.ActivityPoster), // 研报活动海报表
  291. new(yb.ApplyRecord), // 研报权限申请记录表
  292. new(yb.ActivityPermission), // 研报活动权限表
  293. new(yb.Comment), //研报留言表
  294. new(yb.Message), //研报消息表
  295. new(yb.QsEvent), // 全时会议表
  296. new(yb.QsEventUser), // 全时会议用户表
  297. new(yb.CommunityQuestion), // 研报问答社区表
  298. new(yb.CommunityQuestionAudio), // 研报问答音频表
  299. new(yb.CommunityVideo), // 研报视频社区表
  300. new(yb.CommunityVideoCover), // 研报视频社区封面库表
  301. new(yb.PriceDriven), // 价格驱动表
  302. new(yb.PriceDrivenSaveLog), // 价格驱动保存记录表
  303. new(yb.ComeinEvent), // 进门会议表
  304. new(yb.ComeinEventUser), // 进门会议用户表
  305. new(yb.PriceDrivenTag), // 价格驱动标签表
  306. new(yb.VoiceSection), // 语音播报板块表
  307. new(yb.YbCommunityQuestionLikeTease), // 问答点赞/吐槽表
  308. new(yb.YbCommunityQuestionComment), // 问答评论表
  309. new(yb.RoadVideo), // 路演视频表
  310. new(day_new.WeworkMsg), // 企业微信会话存档表
  311. new(day_new.WeworkMsgLog), // 企业微信群消息拉取日志表
  312. new(day_new.WeworkUser), // 企业微信用户信息表
  313. new(day_new.DayNewDefault), // 每日资讯默认项
  314. new(yb.BulletChat), // 研报弹幕表
  315. new(yb.CommunityQuestionProcess), // 研报问答社区流程表
  316. new(yb.Pdf), // 研报PDF表
  317. )
  318. }
  319. // 路演记录 数据表
  320. func initRoadShow() {
  321. //注册对象
  322. orm.RegisterModel(
  323. new(roadshow.RsCalendar), //路演主表
  324. new(roadshow.RsCalendarResearcher), //路演研究员信息表
  325. new(roadshow.RsMatters), //公开会议表
  326. new(roadshow.RsCalendarRelation), //路演关系表(与上海的路演日历关系)
  327. new(roadshow.RsReportRecord), //路演统计表
  328. new(roadshow.RsCalendarMeetingUser), //路演参会名单表
  329. new(roadshow.RsCalendarMeetingLabelGroup), //路演参会名单关联的标签表
  330. new(roadshow.RsCalendarApiLog), //上海路演三方接口请求记录日志表
  331. )
  332. }
  333. // initCygx 查研观项 数据表
  334. func initCygx() {
  335. orm.RegisterModel(
  336. new(cygx.CygxIndustryMap),
  337. new(cygx.CygxIndustrialManagement),
  338. new(cygx.CygxIndustrialAnalyst),
  339. new(cygx.CygxIndustrialSubject),
  340. new(cygx.CygxArticle),
  341. new(cygx.CygxActivity),
  342. new(cygx.CygxActivityVivoPointsSet),
  343. new(cygx.CygxActivitySignup),
  344. new(cygx.CygxActivityRestrictSignup),
  345. new(cygx.CygxActivityAttendanceDetail),
  346. new(cygx.CygxActivityOfflineMeetingDetail),
  347. new(cygx.CygxActivityUserTemplateRecord),
  348. new(cygx.CygxSummaryFastsearchKeywords),
  349. new(cygx.CygxMySchedule),
  350. new(cygx.CygxIndustrialArticleGroupManagement),
  351. new(cygx.CygxIndustrialArticleGroupSubject),
  352. new(cygx.CygxArticleDepartment),
  353. new(cygx.CygxInterfaceLog),
  354. new(cygx.CygxResearchSummary),
  355. new(cygx.CygxResearchSummaryLog),
  356. new(cygx.CygxMinutesSummary),
  357. new(cygx.CygxMinutesSummaryLog),
  358. new(cygx.CygxReportSelection),
  359. new(cygx.CygxReportSelectionLog),
  360. new(cygx.CygxActivityMeetDetailLog),
  361. new(cygx.CygxIndustrialActivityGroupManagement),
  362. new(cygx.CygxIndustrialActivityGroupSubject),
  363. new(cygx.CygxActivitySpecial),
  364. new(cygx.UserRemarks),
  365. new(cygx.CygxActivityUserRemarks),
  366. new(cygx.CygxActivityMeetingHistory),
  367. new(cygx.CygxActivityAppointment),
  368. new(cygx.CygxActivityMeetingReminder),
  369. new(cygx.CygxUserRemind),
  370. new(cygx.CygxArticleType),
  371. new(cygx.CygxIndustryFllow),
  372. new(cygx.CygxActivityVoice),
  373. new(cygx.CygxThreeApiLog),
  374. new(cygx.CygxMicroRoadshowVideo),
  375. new(cygx.CygxMicroRoadshowVideoHistory),
  376. new(cygx.CygxActivityVideo),
  377. new(cygx.CygxActivitySpecialDay),
  378. new(cygx.CygxActivitySpecialTrip),
  379. new(cygx.CygxActivitySpecialMeetingDetail),
  380. new(cygx.CygxMorningMeetingReviewChapter),
  381. new(cygx.CygxMorningMeetingReviews),
  382. new(cygx.CygxResourceData),
  383. new(cygx.CygxReportSelectionChartLog),
  384. new(cygx.CygxActivitySpecialTripBill),
  385. new(cygx.CygxCompanyUserType),
  386. new(cygx.CygxTacticsTimeLine),
  387. new(cygx.CygxProductInterior),
  388. new(cygx.CygxReportMappingCygx),
  389. new(cygx.CygxReportMappingCelue),
  390. new(cygx.CygxReportMappingGroup),
  391. new(cygx.CygxProductInteriorIndustrialGroupManagement),
  392. new(cygx.CygxProductInteriorIndustrialGroupSubject),
  393. new(cygx.CygxActivityPoster),
  394. new(cygx.CygxActivitySignupBreak),
  395. new(cygx.CygxBanner),
  396. new(cygx.CygxUserLabel),
  397. new(cygx.CygxUserLabelActivity),
  398. new(cygx.CygxUserLabelActivitySpecial),
  399. new(cygx.CygxActivitySignupDetail),
  400. new(cygx.CygxActivityPointsSet),
  401. new(cygx.CygxActivityPointsBill),
  402. new(cygx.CygxActivityPointsCompany),
  403. new(cygx.CygxTag),
  404. new(cygx.AliyunOcrLog),
  405. new(cygx.CygxReportMappingCategoryGroup),
  406. new(cygx.CygxResourceDataIndustrialGroupManagement),
  407. new(cygx.CygxResourceDataIndustrialGroupSubject),
  408. new(cygx.CygxYanxuanSpecialAuthor),
  409. new(cygx.CygxYanxuanSpecialApprovalLog),
  410. new(cygx.CygxAllocationCompanyContract),
  411. new(cygx.CygxAllocationCompanyContractLog),
  412. new(cygx.CygxAllocationCompanyContractPermission),
  413. new(cygx.CygxAllocationCompanyContractPermissionLog),
  414. new(cygx.CygxQuestionnaire),
  415. new(cygx.CygxQuestionnaireTheme),
  416. new(cygx.CygxAskserieVideo),
  417. new(cygx.CygxIndustrialAskserieVideoGroupManagement),
  418. new(cygx.CygxActivitySpecialPermissionPoints),
  419. new(cygx.CygxUserYanxuanPermission),
  420. new(cygx.CygxUserYanxuanPermissionLog),
  421. new(cygx.CygxEnterScore),
  422. new(cygx.CygxEnterScoreGroup),
  423. new(cygx.CygxEnterScorePermission),
  424. new(cygx.CygxEnterScoreResearcher),
  425. new(cygx.CygxOrderRefund),
  426. new(cygx.CygxOrder),
  427. new(cygx.CygxOrderAction),
  428. new(cygx.CygxUserFeedback),
  429. new(cygx.CygxReportSelectionThirdName),
  430. )
  431. }
  432. // initShEdbData 上海服务器指标 数据表
  433. func initShEdbData() {
  434. orm.RegisterModel(
  435. //new(Edbdata),
  436. //new(EdbdataDeleteRecord),
  437. //new(EdbdataImportFail),
  438. //new(EdbImportFail), //指标导入失败数据表
  439. //new(Edbinfo), //edb库的edbinfo表
  440. new(data_manage.ExcelStyle), //在线excel样式表
  441. new(data_manage.ExcelEdbdataMapping), //excel样式和指标映射表
  442. )
  443. }
  444. // initEdbData 指标服务 数据表
  445. func initEdbData() {
  446. orm.RegisterModel(
  447. new(data_manage.EdbClassify),
  448. new(data_manage.EdbInfo), //hz_data库的edb_info表
  449. new(data_manage.EdbDataThs),
  450. new(data_manage.EdbDataWind),
  451. new(data_manage.EdbDataPb),
  452. //new(data_manage.ManualUserClassify),
  453. new(data_manage.EdbdataClassify),
  454. //new(data_manage.ManualUser),
  455. new(data_manage.EdbInfoCalculate),
  456. new(data_manage.EdbDataCalculate),
  457. new(data_manage.EdbInfoCalculateLjzzy),
  458. new(data_manage.EdbInfoCalculateTbz),
  459. new(data_manage.EdbInfoCalculateTcz),
  460. new(data_manage.EdbInfoCalculateNszydpjjs),
  461. new(data_manage.SearchKeyword),
  462. new(data_manage.EdbInfoCalculateHbz),
  463. new(data_manage.EdbInfoCalculateHcz),
  464. new(data_manage.EdbInfoCalculateBp),
  465. new(data_manage.BaseFromSmm),
  466. new(data_manage.BaseFromSmmIndex),
  467. new(data_manage.BaseFromSmmData),
  468. new(data_manage.BaseFromSmmClassify),
  469. new(data_manage.EdbInfoLog),
  470. new(data_manage.EdbInfoCalculateMapping),
  471. new(data_manage.EdbDataCalculateZjpj), //直接拼接
  472. new(data_manage.EdbDataCalculateLjztbpj), //累计同比值拼接
  473. new(data_manage.ExcelClassify), //ETA excel表格分类
  474. new(data_manage.ExcelInfo), //ETA excel表格
  475. new(data_manage.ExcelDraft), //ETA excel表格草稿
  476. new(data_manage.PredictEdbConf), //预测指标配置
  477. new(data_manage.BaseFromMysteelChemicalClassify), //预测指标配置
  478. new(data_manage.BaseFromMysteelChemicalIndex), //钢联化工
  479. new(data_manage.BaseFromEiaSteoClassify), // Eia steo 报告指标
  480. new(data_manage.BaseFromEiaSteoIndex), // Eia steo 报告指标分类
  481. new(data_manage.PredictEdbRuleData), //预测指标,动态规则的计算数据
  482. new(data_manage.ComTradeCountry), //联合国商品贸易数据库的国家编码表
  483. new(data_manage.ComTradeData), //联合国商品贸易数据表
  484. new(data_manage.BaseFromSci),
  485. new(data_manage.BaseFromSciIndex),
  486. new(data_manage.BaseFromSciData),
  487. new(data_manage.BaseFromSciClassify),
  488. new(data_manage.TradePositionDalianTop),
  489. new(data_manage.TradePositionZhengzhouTop),
  490. new(data_manage.TradePositionCffexTop),
  491. new(data_manage.TradePositionShanghaiTop),
  492. new(data_manage.TradePositionIneTop),
  493. new(data_manage.BaseFromBaiinfo),
  494. new(data_manage.BaseFromBaiinfoIndex),
  495. new(data_manage.BaseFromBaiinfoData),
  496. new(data_manage.BaseFromBaiinfoClassify),
  497. new(data_manage.EdbDataInsertConfig), // 指标数据插入配置表
  498. new(data_manage.EdbInfoNoPermissionAdmin), //指标不可见用户配置表
  499. )
  500. }
  501. // initChart 图表 数据表
  502. func initChart() {
  503. orm.RegisterModel(
  504. new(data_manage.ChartClassify),
  505. new(data_manage.ChartInfo),
  506. new(data_manage.ChartEdbMapping),
  507. new(data_manage.MyChartClassify),
  508. new(data_manage.MyChart),
  509. new(data_manage.MyChartLog),
  510. new(data_manage.MyChartClassifyMapping),
  511. new(data_manage.ChartInfoLog),
  512. new(data_manage.ChartInfoCorrelation),
  513. )
  514. }
  515. // initEnglishReport 英文报告
  516. func initEnglishReport() {
  517. orm.RegisterModel(
  518. new(EnglishReport),
  519. //new(EnglishPolicyReport),
  520. new(EnglishReportEmail),
  521. new(EnglishReportEmailPV),
  522. new(EnglishReportEmailLog),
  523. new(EnglishClassify),
  524. new(EnglishCompany), // 英文客户
  525. new(EnglishCompanyLog), // 英文客户操作日志
  526. new(EnglishReportEmailOpLog), // 英文联系人操作日志
  527. new(EnglishCompanyTodo), // 英文客户TODO任务
  528. new(EnglishCompanyTodoPublic), // 英文客户公共TODO任务
  529. new(EnglishVideoCover), // 英文研报线上路演视频封面
  530. new(EnglishVideo), // 英文研报线上路演
  531. new(EnPermission), // 英文品种权限表
  532. new(EnCompanyPermission), // 英文客户品种权限关联表
  533. new(EnClassifyPermission), // 英文分类品种权限关联表
  534. )
  535. }
  536. // initPptEnglish ppt英文
  537. //func initPptEnglish() {
  538. // orm.RegisterModel(
  539. // new(ppt_english.PptEnglish),
  540. // new(ppt_english.PptEnglishPublishRecord),
  541. // new(ppt_english.PptEnglishSaveLog),
  542. // new(ppt_english.PptEnglishGroup),
  543. // new(ppt_english.PptEnglishGroupMapping),
  544. // new(ppt_english.PptEnglishGrant), //ppt授权操作表
  545. // new(ppt_english.ReportPptEnglishImg), //Ppt转报告的图片记录表
  546. // )
  547. //}
  548. // initFutureGood 注册期货数据 数据表
  549. func initFutureGood() {
  550. //注册对象
  551. orm.RegisterModel(
  552. new(future_good2.FutureGoodEdbInfo), //期货指标表
  553. new(future_good2.FutureGoodEdbData), //期货指标数据表
  554. //new(future_good2.FutureGoodChartClassify), //期货指标分类表
  555. new(future_good2.ChartInfoFutureGoodProfit), //期货利润图的扩展表
  556. )
  557. }
  558. // initETATrial ETA试用
  559. func initETATrial() {
  560. orm.RegisterModel(
  561. new(eta_trial.EtaTrial),
  562. new(eta_trial.EtaTrialApproval),
  563. new(eta_trial.EtaTrialQuestionnaire),
  564. )
  565. }
  566. // initCloudDisk 共享云盘
  567. //func initCloudDisk() {
  568. // //注册对象
  569. // orm.RegisterModel(
  570. // new(CloudDiskMenu), // 云盘目录表
  571. // new(CloudDiskResource), // 云盘资源表
  572. // )
  573. //}
  574. // 出差
  575. func initBusinessTrip() {
  576. orm.RegisterModel(
  577. new(business_trip.BusinessApply),
  578. new(business_trip.BusinessApplyPeer),
  579. )
  580. }
  581. // 每刻报销
  582. func initMaycur() {
  583. orm.RegisterModel(
  584. new(MaycurCompanyProfile), // 每刻报销-客户档案表
  585. new(MaycurPublicOfferingCompany), // 每刻报销-公募客户表
  586. new(MaycurPublicOfferingSale), // 每刻报销-公募销售表
  587. )
  588. }
  589. // initSemanticAnalysis 语义分析
  590. //func initSemanticAnalysis() {
  591. // orm.RegisterModel(
  592. // new(semantic_analysis.SaLabel), // 语义分析-标签表
  593. // new(semantic_analysis.SaDocClassify), // 语义分析-文档分类表
  594. // new(semantic_analysis.SaDoc), // 语义分析-文档表
  595. // new(semantic_analysis.SaDocSection), // 语义分析-文档段落表
  596. // new(semantic_analysis.SaCompareClassify), // 语义分析-比对分类表
  597. // new(semantic_analysis.SaCompare), // 语义分析-比对表
  598. // new(semantic_analysis.SaCompareDoc), // 语义分析-比对关联文档表
  599. // new(semantic_analysis.SaCompareLabel), // 语义分析-比对段落表
  600. // new(semantic_analysis.SaCompareSearchKeyword), // 语义分析-比对搜索关键词
  601. // )
  602. //}
  603. // initSupplyAnalysis 供应分析
  604. func initSupplyAnalysis() {
  605. orm.RegisterModel(
  606. new(supply_analysis.Variety),
  607. new(supply_analysis.VarietyAdminPermission),
  608. new(supply_analysis.VarietyEdbInfo),
  609. new(supply_analysis.VarietyPlant),
  610. )
  611. }
  612. // initMultipleGraphConfig 多图配置 数据表
  613. func initMultipleGraphConfig() {
  614. //注册对象
  615. orm.RegisterModel(
  616. new(data_manage.MultipleGraphConfig), //多图配置表
  617. new(data_manage.MultipleGraphConfigChartMapping), //图表与多图配置的关系表
  618. new(data_manage.MultipleGraphConfigEdbMapping), //指标与多图配置的关系表
  619. )
  620. }
  621. func initAiChat() {
  622. //注册对象
  623. orm.RegisterModel(
  624. new(aimod.AiChatTopic), //主题
  625. new(aimod.AiChat), //聊天
  626. )
  627. }
  628. // initEtaBusiness ETA商家相关表
  629. func initEtaBusiness() {
  630. orm.RegisterModel(
  631. new(eta_business.EtaBusiness), // ETA商家表
  632. new(eta_business.EtaBusinessContract), // ETA合同表
  633. new(eta_business.EtaBusinessOperationRecord), // ETA操作记录表
  634. new(eta_business.EtaBusinessMenu), // ETA商家菜单表
  635. new(eta_business.EtaBusinessMenuRelate), // ETA商家菜单关联表
  636. new(eta_business.EtaBusinessConfigRelate), // ETA商家配置关联表
  637. new(eta_business.EtaBusinessMenuIcon), // ETA商家菜单icon表
  638. )
  639. }
  640. // initEtaVersionUpdateLog ETA版本更新日志
  641. func initEtaVersionUpdateLog() {
  642. orm.RegisterModel(
  643. new(EtaVersionUpdateLog), // 更新日志表
  644. )
  645. }
  646. func initHelpDoc() {
  647. //注册对象
  648. orm.RegisterModel(
  649. new(help_doc.HelpDocClassify), //分类
  650. new(help_doc.HelpDoc), //文章
  651. )
  652. }
  653. // initEtaTrainingVideo ETA培训视频相关表
  654. func initEtaTrainingVideo() {
  655. orm.RegisterModel(
  656. new(eta_training_video.EtaTrainingVideo), // 视频表
  657. new(eta_training_video.EtaTrainingVideoOpLog), // 视频操作记录表
  658. //new(eta_training_video.EtaTrainingVideoViewLog), // 视频访问记录表
  659. new(eta_training_video.EtaTrainingVideoTag), // 标签表
  660. new(eta_training_video.EtaTrainingVideoTagRelate), // 标签关联表
  661. new(eta_training_video.EtaTrainingVideoClassify), // 分类表
  662. new(eta_training_video.EtaTrainingVideoClassifyRelate), // 分类关联表
  663. )
  664. }
  665. func initOverseasCustom() {
  666. orm.RegisterModel(
  667. new(overseas_custom.OverseasCustomerSale),
  668. )
  669. }