123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- package utils
- import "io/fs"
- const (
- Md5Key = "Ks@h64WJ#tcVgG8$&WlNfqvLAtMgpxWN"
- )
- const (
- FormatTime = "15:04:05"
- FormatTimeHm = "15:04"
- FormatDate = "2006-01-02"
- FormatDateUnSpace = "20060102"
- FormatDateTime = "2006-01-02 15:04:05"
- HlbFormatDateTime = "2006-01-02_15:04:05.999"
- FormatDateTimeUnSpace = "20060102150405"
- FormatShortDateTimeUnSpace = "060102150405"
- EmptyDateTimeStr = "0000-00-00 00:00:00"
- EmptyDateStr = "0000-00-00"
- FormatMonthDay = "01-02"
- FormatMonthDayUnSpace = "0102"
- FormatYearMonthDate = "2006-01"
- FormatYearDate = "2006"
- PageSize15 = 15
- PageSize5 = 5
- PageSize10 = 10
- PageSize20 = 20
- PageSize30 = 30
- PageSize50 = 50
- )
- const DateTypeNYears = 20
- const (
- RegularMobile = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0-9])|(17[0-9])|(16[0-9])|(19[0-9]))\\d{8}$"
- RegularEmail = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`
- )
- const (
- ROLE_TYPE_ADMIN = "管理员"
- ROLE_TYPE_FICC_ADMIN = "ficc管理员"
- ROLE_TYPE_FICC_SELLER = "ficc销售"
- ROLE_TYPE_RAI_ADMIN = "权益管理员"
- ROLE_TYPE_RAI_SELLER = "权益销售"
- ROLE_TYPE_FICC_GROUP = "ficc组长"
- ROLE_TYPE_RAI_GROUP = "权益组长"
- ROLE_TYPE_FICC_DEPARTMENT = "ficc部门经理"
- ROLE_TYPE_RAI_DEPARTMENT = "权益部门经理"
- ROLE_TYPE_FICC_RESEARCHR = "ficc研究员"
- ROLE_TYPE_RAI_RESEARCHR = "权益研究员"
- ROLE_NAME_FICC_DIRECTOR = "ficc销售经理"
- ROLE_TYPE_CODE_ADMIN = "admin"
- ROLE_TYPE_CODE_FICC_ADMIN = "ficc_admin"
- ROLE_TYPE_CODE_FICC_SELLER = "ficc_seller"
- ROLE_TYPE_CODE_RAI_ADMIN = "rai_admin"
- ROLE_TYPE_CODE_RAI_SELLER = "rai_seller"
- ROLE_TYPE_CODE_FICC_GROUP = "ficc_group"
- ROLE_TYPE_CODE_RAI_GROUP = "rai_group"
- ROLE_TYPE_CODE_FICC_DEPARTMENT = "ficc_department"
- ROLE_TYPE_CODE_RAI_DEPARTMENT = "rai_department"
- ROLE_TYPE_CODE_FICC_RESEARCHR = "ficc_researcher"
- ROLE_TYPE_CODE_RESEARCHR = "researcher"
- ROLE_TYPE_CODE_RAI_RESEARCHR = "rai_researcher"
- ROLE_TYPE_CODE_COMPLIANCE = "compliance"
- ROLE_TYPE_CODE_FINANCE = "finance"
- ROLE_TYPE_CODE_FICC_TEAM = "ficc_team"
- ROLE_TYPE_SELLERS = "'ficc_admin','ficc_seller','ficc_team','rai_admin','rai_seller','ficc_group','rai_group','ficc_department','rai_department','compliance','finance'"
- )
- const (
- COMPANY_PRODUCT_FICC_ID = 1
- COMPANY_PRODUCT_FICC_NAME = "ficc"
- COMPANY_PRODUCT_RAI_ID = 2
- COMPANY_PRODUCT_RAI_NAME = "权益"
- )
- var PermissionFiccClassifyArr = [...]string{"宏观经济", "化工产业", "建材产业", "有色产业", "市场策略"}
- var PermissionAllClassifyArr = [...]string{"宏观经济", "化工产业", "建材产业", "有色产业", "市场策略", "权益"}
- const (
- DATA_SOURCE_THS = iota + 1
- DATA_SOURCE_WIND
- DATA_SOURCE_PB
- DATA_SOURCE_CALCULATE
- DATA_SOURCE_CALCULATE_LJZZY
- DATA_SOURCE_CALCULATE_TBZ
- DATA_SOURCE_CALCULATE_TCZ
- DATA_SOURCE_CALCULATE_NSZYDPJJS
- DATA_SOURCE_MANUAL
- DATA_SOURCE_LZ
- DATA_SOURCE_YS
- DATA_SOURCE_CALCULATE_HBZ
- DATA_SOURCE_CALCULATE_HCZ
- DATA_SOURCE_CALCULATE_BP
- DATA_SOURCE_GL
- DATA_SOURCE_ZZ
- DATA_SOURCE_DL
- DATA_SOURCE_SH
- DATA_SOURCE_CFFEX
- DATA_SOURCE_SHFE
- DATA_SOURCE_GIE
- DATA_SOURCE_CALCULATE_TIME_SHIFT
- DATA_SOURCE_CALCULATE_ZJPJ
- DATA_SOURCE_CALCULATE_LJZTBPJ
- DATA_SOURCE_LT
- DATA_SOURCE_COAL
- DATA_SOURCE_PYTHON
- DATA_SOURCE_PB_FINANCE
- DATA_SOURCE_GOOGLE_TRAVEL
- DATA_SOURCE_PREDICT
- DATA_SOURCE_PREDICT_CALCULATE
- DATA_SOURCE_PREDICT_CALCULATE_TBZ
- DATA_SOURCE_PREDICT_CALCULATE_TCZ
- DATA_SOURCE_MYSTEEL_CHEMICAL
- DATA_SOURCE_CALCULATE_CJJX
- DATA_SOURCE_EIA_STEO
- DATA_SOURCE_CALCULATE_NHCC
- DATA_SOURCE_COM_TRADE
- DATA_SOURCE_PREDICT_CALCULATE_NSZYDPJJS
- DATA_SOURCE_CALCULATE_ADJUST
- DATA_SOURCE_SCI
- DATA_SOURCE_PREDICT_CALCULATE_LJZZY
- DATA_SOURCE_PREDICT_CALCULATE_HBZ
- DATA_SOURCE_PREDICT_CALCULATE_HCZ
- DATA_SOURCE_PREDICT_CALCULATE_BP
- DATA_SOURCE_PREDICT_CALCULATE_TIME_SHIFT
- DATA_SOURCE_PREDICT_CALCULATE_ZJPJ
- DATA_SOURCE_PREDICT_CALCULATE_LJZTBPJ
- DATA_SOURCE_PREDICT_CALCULATE_CJJX
- DATA_SOURCE_PREDICT_CALCULATE_NHCC
- DATA_SOURCE_CALCULATE_JP
- DATA_SOURCE_CALCULATE_NH
- DATA_SOURCE_CALCULATE_KSZS
- DATA_SOURCE_PREDICT_CALCULATE_JP
- DATA_SOURCE_PREDICT_CALCULATE_NH
- DATA_SOURCE_PREDICT_CALCULATE_KSZS
- DATA_SOURCE_BAIINFO
- DATA_SOURCE_STOCK_PLANT
- DATA_SOURCE_CALCULATE_CORRELATION
- DATA_SOURCE_NATIONAL_STATISTICS
- DATA_SOURCE_CALCULATE_LJZZJ
- DATA_SOURCE_CALCULATE_LJZ
- DATA_SOURCE_CALCULATE_LJZNCZJ
- DATA_SOURCE_PREDICT_CALCULATE_LJZZJ
- DATA_SOURCE_PREDICT_CALCULATE_LJZ
- DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ
- DATA_SOURCE_CALCULATE_STANDARD_DEVIATION
- DATA_SOURCE_CALCULATE_PERCENTILE
- DATA_SOURCE_PREDICT_CALCULATE_STANDARD_DEVIATION
- DATA_SOURCE_PREDICT_CALCULATE_PERCENTILE
- DATA_SOURCE_FUBAO
- DATA_SOURCE_CALCULATE_ZSXY
- DATA_SOURCE_PREDICT_CALCULATE_ZSXY
- DATA_SOURCE_CALCULATE_ZDYFX
- DATA_SOURCE_CALCULATE_RJZ
- DATA_SOURCE_GFEX = 78
- DATA_SOURCE_ICPI = 79
- DATA_SOURCE_BUSINESS = 84
- DATA_SOURCE_SCI_HQ = 88
- )
- const (
- DATA_START_REFRESH_LIMIT = 7
- DATA_END_DATE_LIMIT = 4
- )
- const (
- DATA_PREFIX = "hz_data"
- CHART_PREFIX = "hz_chart"
- EXCEL_DATA_PREFIX = "hz_excel_data"
- )
- const (
- EDB_DATA_LIMIT = 10
- )
- var Hz_Data_WIND_Url_List = []string{"http://datawind.hzinsights.com:8040/", "http://datawind2.hzinsights.com:8040/"}
- const (
- HZ_CHART_LIB_DETAIL = "HZ_CHART_LIB_DETAIL_"
- HZ_CHART_LIB_EXCEL_TABLE_DETAIL = "HZ_CHART_LIB_EXCEL_TABLE_DETAIL"
- CACHE_SYNC_DEPARTMENT = "hz_crm_eta:sync_department"
- )
- const (
- CACHE_KEY_LOGS = "HZ_ADMIN_CACHE_KEY_LOGS"
- CACHE_KEY_ADMIN = "calendar:admin:list"
- CACHE_KEY_ADMIN_ID = "calendar:admin:id:list"
- CACHE_KEY_OLD_REPORT_PUBLISH = "HZ_CACHE_KEY_OLD_REPORT_PUBLISH"
- CACHE_ADMIN_YB_CONFIG = "admin:yb_config:"
- CACHE_WIND_URL = "CACHE_WIND_URL"
- CACHE_CHART_INFO_DATA = "chart:info:data:"
- CACHE_CHART_CLASSIFY = "chart:classify"
- CACHE_IMPORT_MANUAL_DATA = "import:manual:data"
- CACHE_ACCESS_TOKEN_LOGIN = "mobile_eta_admin:login:"
- CACHE_ACCESS_TOKEN_LOGIN_NO_TRUST = "mobile_eta_admin:login:no_trust:"
- CACHE_ABNORMAL_LOGIN = "mobile_eta_admin:login:abnormal:"
- CACHE_LOGIN_ERR_PASS = "mobile_eta_admin:login:errPass:"
- CACHE_FIND_PASS_VERIFY = "mobile_eta_admin:findPass:verify:"
- CACHE_KEY_COMPANY_MATCH_PRE = "admin:company:match:"
- CACHE_KEY_MYSTEEL_REFRESH = "mysteel_chemical:refresh"
- CACHE_KEY_DAYNEW_REFRESH = "admin:day_new:refresh"
- CACHE_KEY_DAYNEW_TRANSLATE = "admin:day_new:translate"
- CACHE_CREATE_REPORT_IMGPDF_QUEUE = "eta_report:report_img_pdf_queue"
- CACHE_EDB_TERMINAL_CODE_URL = "edb:terminal_code:edb_code:"
- CACHE_PPT_EDITING = "eta:ppt:editing:"
- CACHE_EN_PPT_EDITING = "eta:en_ppt:editing:"
- CACHE_SMART_REPORT_EDITING = "eta:smart_report:editing:"
- CACHE_SMART_REPORT_SEND_MSG = "eta:smart_report:sending:"
- CACHE_KEY_REPLACE_EDB = "eta:replace_edb"
- CACHE_REPORT_SHARE_SHORT_Url = "eta:report_share_url:report_id:"
- CACHE_REPORT_SHARE_ORIGIN_Url = "eta:report_share_url:token:"
- )
- const (
- TEMPLATE_MSG_REPORT = iota + 1
- TEMPLATE_MSG_INDEX
- TEMPLATE_MSG_APPLY
- TEMPLATE_MSG_RECEIVE
- TEMPLATE_MSG_CYGX_ACTIVITY_CACLE
- TEMPLATE_MSG_CYGX_ACTIVITY_UPDATE
- TEMPLATE_MSG_CYGX_ARTICLE
- TEMPLATE_MSG_CYGX_DAY_REPORT
- TEMPLATE_MSG_ACTIVITY_APPOINTMENT
- TEMPLATE_MSG_RECEIVE_PERMISSION
- TEMPLATE_MSG_YB_COMMUNITY_QUESTION
- TEMPLATE_MSG_CYGX_ACTIVITY_ADD
- TEMPLATE_MSG_CYGX_ARTICLE_ADD
- TEMPLATE_MSG_YB_PRICE_DRIVEN
- TEMPLATE_MSG_SEAL_FINISHED
- TEMPLATE_MSG_YB_COMMUNITY_VIDEO
- TEMPLATE_MSG_YB_ROAD_VIDEO
- TEMPLATE_MSG_CYGX_ROADSHOW_VIDEO
- TEMPLATE_MSG_CYGX_MORNING_MEETING
- TEMPLATE_MSG_YB_VOICE_BROADCAST
- TEMPLATE_MSG_CYGX_ACTIVITY_CUSTOMIZE
- )
- var (
- REPORT_TYPE_DAY = "day"
- REPORT_TYPE_WEEK = "week"
- REPORT_TYPE_TWO_WEEK = "two_week"
- REPORT_TYPE_MONTH = "month"
- REPORT_TYPE_OTHER = "other"
- )
- const (
- USER_RECORD_PLATFORM_RDDP = iota + 1
- USER_RECORD_PLATFORM_BACKSTAGE
- USER_RECORD_PLATFORM_PC
- USER_RECORD_PLATFORM_CYGX
- _
- USER_RECORD_PLATFORM_YB
- )
- const DEFAULT_HONGZE_SYS_LOGO = "https://hzstatic.hzinsights.com/static/yb_wx/hongze_sys_default_head.png"
- const DEFAULT_HONGZE_USER_LOGO = "https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar.png"
- func GetFiccAdminDepartmentIds() (idStr string) {
- if RunMode == "release" {
- idStr = `1,2,4,6`
- } else {
- idStr = `1,2,6`
- }
- return
- }
- const (
- CHART_PERMISSION_NAME_MF_YANXUAN = "买方研选"
- LU_YAN_FU_WU = "路演服务"
- CHART_PERMISSION_NAME_YANXUAN = "研选"
- CHART_PERMISSION_ID_YANXUAN = 31
- CE_LUE_NAME string = "策略"
- CE_LUE_ID int = 23
- YI_YAO_NAME string = "医药"
- YI_YAO_ID int = 22
- XIAO_FEI_NAME string = "消费"
- XIAO_FEI_ID int = 21
- KE_JI_NAME string = "科技"
- KE_JI_ID int = 20
- ZHI_ZAO_NAME string = "智造"
- ZHI_ZAO_ID int = 19
- GU_SHOU_NAME string = "固收"
- GU_SHOU_ID int = 100000
- YI_DONG_NAME string = "(易董)"
- YI_DONG_NAME_TWO string = "--易董"
- CYGX_ACTIVITY_TYPE_NAME_HZ = "弘则活动"
- CYGX_ACTIVITY_TYPE_NAME_YX = "研选活动"
- CYGX_LYJH = "路演精华"
- PERMISSION_ID_UPGRADE = 100000
- )
- const (
- ReportFrequencyDay = "日度"
- ReportFrequencyWeek = "周度"
- ReportFrequencyTwoWeek = "双周度"
- ReportFrequencyMonth = "月度"
- ReportFrequencyDefault = "不定时"
- )
- const (
- CHART_SOURCE_DEFAULT = 1
- CHART_SOURCE_FUTURE_GOOD = 2
- CHART_SOURCE_CORRELATION = 3
- CHART_SOURCE_ROLLING_CORRELATION = 4
- CHART_SOURCE_FUTURE_GOOD_PROFIT = 5
- CHART_SOURCE_LINE_EQUATION = 6
- CHART_SOURCE_LINE_FEATURE_STANDARD_DEVIATION = 7
- CHART_SOURCE_LINE_FEATURE_PERCENTILE = 8
- CHART_SOURCE_LINE_FEATURE_FREQUENCY = 9
- CHART_SOURCE_CROSS_HEDGING = 10
- CHART_SOURCE_BALANCE_EXCEL = 11
- CHART_SOURCE_RANGE_ANALYSIS = 12
- )
- const (
- CHART_MULTIPLE_GRAPH_CURVE = 1
- CHART_MULTIPLE_GRAPH_CORRELATION = 2
- CHART_MULTIPLE_GRAPH_ROLLING_CORRELATION_ONE = 3
- CHART_MULTIPLE_GRAPH_ROLLING_CORRELATION_TWO = 4
- CHART_MULTIPLE_GRAPH_LINE_EQUATION_ONE = 5
- CHART_MULTIPLE_GRAPH_LINE_EQUATION_TWO = 6
- CHART_MULTIPLE_GRAPH_LINE_EQUATION_THREE = 7
- CHART_MULTIPLE_GRAPH_LINE_FEATURE_STANDARD_DEVIATION = 8
- CHART_MULTIPLE_GRAPH_LINE_FEATURE_PERCENTILE = 9
- CHART_MULTIPLE_GRAPH_LINE_FEATURE_FREQUENCY = 10
- )
- const (
- EXCEL_DEFAULT = 1
- TIME_TABLE = 2
- MIXED_TABLE = 3
- CUSTOM_ANALYSIS_TABLE = 4
- BALANCE_TABLE = 5
- )
- const (
- CHART_TYPE_CURVE = 1
- CHART_TYPE_AREA = 3
- CHART_TYPE_BAR = 7
- CHART_TYPE_SECTION_SCATTER = 10
- CHART_TYPE_RADAR = 11
- CHART_TYPE_SECTION_COMBINE = 14
- )
- const (
- EDB_INFO_TYPE = 0
- PREDICT_EDB_INFO_TYPE = 1
- )
- var FrequencyDaysMap = map[string]int{
- "天": 1, "周": 7, "月": 30, "季": 90, "年": 365,
- }
- const MultiAddNum = 500
- const (
- CaptchaCachePrefix = "captcha:lock:crm_"
- VerifyCodeExpireMinute = 15
- SmsLoginTplId = "65692"
- SmsNewLoginTplId = "254663"
- )
- const LoginCacheTime = 60
- const DIR_MOD fs.FileMode = 0766
- const (
- BusinessCodeSandbox = "E2023080700"
- BusinessCodeRelease = "E2023080900"
- BusinessCodeDebug = "E2023080901"
- )
- const (
- SOURCE_ETA_FLAG = 2
- )
- const BusinessCodeSalt = "dr7WY0OZgGR7upw1"
- const CrmEtaAuthorization = "NIi1RbEmH0C2rksXtPGDPBBgRgTZY87Q"
- const (
- STORAGESOURCE_OSS = 1
- STORAGESOURCE_MINIO = 2
- )
- const (
- STORAGESOURCE_OSS_NAME = "oss"
- STORAGESOURCE_MINIO_NAME = "minio"
- STORAGESOURCE_S3_NAME = "s3"
- )
- const (
- DATA_SUB_SOURCE_EDB = iota
- DATA_SUB_SOURCE_DATE
- DATA_SUB_SOURCE_HIGH_FREQUENCY
- )
- const (
- UserLoginSalt = "MiQM9yusNA9T2uIH"
- DesKeySalt = "JMCqSoUrTAmyNNIRb0TtlrPk"
- )
- var DataSourceEnMap = map[int]string{
- DATA_SOURCE_WIND: "Wind",
- DATA_SOURCE_THS: "iFind",
- DATA_SOURCE_PB: "Bloomberg",
- DATA_SOURCE_PB_FINANCE: "Bloomberg Finance",
- DATA_SOURCE_LT: "Reuters",
- DATA_SOURCE_MANUAL: "Horizon Insights",
- DATA_SOURCE_LZ: "OilChem",
- DATA_SOURCE_YS: "SMM",
- DATA_SOURCE_GL: "MySteel",
- DATA_SOURCE_ZZ: "Zhengzhou Commodity Exchange",
- DATA_SOURCE_DL: "Dalian Commodity Exchange",
- DATA_SOURCE_SH: "Shanghai Futures Exchange",
- DATA_SOURCE_CFFEX: "China Financial Futures Exchange",
- DATA_SOURCE_SHFE: "Shanghai International Energy Exchange",
- DATA_SOURCE_GIE: "Eurostat",
- DATA_SOURCE_COAL: "China Coal Transport & Distribution Association",
- DATA_SOURCE_GOOGLE_TRAVEL: "Our World in Data",
- DATA_SOURCE_EIA_STEO: "Energy Information Administration",
- DATA_SOURCE_COM_TRADE: "United Nations",
- DATA_SOURCE_SCI: "Sublime China Information",
- DATA_SOURCE_BAIINFO: "BAIINFO",
- DATA_SOURCE_MYSTEEL_CHEMICAL: "Horizon Insights",
- DATA_SOURCE_FUBAO: "FuBao",
- DATA_SOURCE_SCI_HQ: "SCI(hongqi)",
- }
- const (
- WindDbWsd = "wsd"
- ThsDs = "thsds"
- )
- const (
- TelAreaCodeHome = "86"
- )
- const (
- PercentCalculateTypeRange = 0
- PercentCalculateTypeNum = 1
- )
- const (
- ZhLangVersion = "zh"
- EnLangVersion = "en"
- )
|