123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- package main
- import (
- "log"
- "app.yhyue.com/moapp/jybase/common"
- )
- type (
- Config struct {
- LastOrderId int `json:"lastOrderId"`
- LastOrderClueId string `json:"lastOrderClueId"`
- LastUserId string `json:"lastUserId"`
- LastXcxUserId string `json:"lastXcxUserId"`
- LastId string `json:"lastId"`
- LastOrderTime string `json:"lastOrderTime"`
- LastUserTime string `json:"lastUserTime"`
- LastSubscribeId string `json:"lastSubscribeId"`
- LastMessageTime string `json:"lastMessageTime"`
- LastkcTime string `json:"lastkcTime"`
- LastEverythingTime string `json:"lastEverythingTime"`
- LastEventRegTime string `json:"lastEventRegTime"`
- LastReadClueTime string `json:"lastReadClueTime"`
- BigSaleTime int64 `json:"bigSaleTime"`
- BigOrderTime string `json:"bigOrderTime"`
- MarketSaleTime int64 `json:"marketSaleTime"`
- AdvisoryCommitteeTime int64 `json:"advisoryCommitteeTime"`
- AllocationTime string `json:"allocationTime"`
- AllocationRatio float64 `json:"allocationRatio"`
- ActiveTime string `json:"activeTime"`
- RebindTime string `json:"rebindTime"`
- }
- DB struct {
- CornExp1 int64 `json:"cornexp1"`
- CornExp2 int64 `json:"cornexp2"`
- CornExp2Start string `json:"cornexp2Strat"`
- CornExp2End string `json:"cornexp2End"`
- CornExp3 string `json:"cornexp3"`
- CornExp4 string `json:"cornexp4"`
- CornExp5 int64 `json:"cornexp5"`
- CornExp6 int64 `json:"cornexp6"`
- CornExp7 string `json:"cornexp7"`
- CornExp8 int64 `json:"cornexp8"`
- TiDb struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"tiDb"`
- TiDbData struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"tiDbData"`
- TiDbPower struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"tiDbPower"`
- WorderOrder struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"workOrder"`
- BaseService struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"baseService"`
- BiService struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"biService"`
- ThirdParty struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"thirdParty"`
- Jyactivities struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"jyactivities"`
- DebrisProduct struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- } `json:"debrisProduct"`
- Mysql struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"mysql"`
- DataAnalysis struct {
- Host string `json:"host"`
- Port int `json:"port"`
- Database string `json:"database"`
- User string `json:"user"`
- Password string `json:"password"`
- PollSize int `json:"poolsize"`
- MaxIdle int `json:"maxidle"`
- MaxLeftTime int `json:"maxleft"`
- } `json:"dataAnalysis"`
- Mgo struct {
- Address string `json:"address"`
- DbName string `json:"dbName"`
- DbSize int `json:"dbSize"`
- } `json:"mgo"`
- MgoLog struct {
- Address string `json:"address"`
- DbName string `json:"dbName"`
- DbSize int `json:"dbSize"`
- User string `json:"user"`
- Password string `json:"password"`
- } `json:"mgoLog"`
- MgoQyxy struct {
- Address string `json:"address"`
- DbName string `json:"dbName"`
- DbSize int `json:"dbSize"`
- User string `json:"user"`
- Password string `json:"password"`
- } `json:"mgoQyxy"`
- Es struct {
- Address string `json:"address"`
- DbSize int `json:"dbSize"`
- Version string `json:"version"`
- UserName string `json:"user Name"`
- Password string `json:"password"`
- } `json:"es"`
- ProductArr []string `json:"productArr"`
- RedisServer string `json:"redisServer"`
- MarketSaleMail string `json:"marketSaleMail"`
- AdvisoryCommitteeMail []string `json:"advisoryCommitteeMail"`
- AllocationCap int64 `json:"allocationCap"`
- WarningValue int64 `json:"warningValue"`
- CornMail string `json:"corn_mail"`
- RegTimes int `json:"regTimes"`
- NameToMail map[string]string `json:"nameToMail"`
- ThawDay int64 `json:"thawDay"`
- LoopType int64 `json:"loopType"`
- Sourceid string `json:"sourceid"`
- AbhEmail string `json:"abhEmail"`
- AfEmail string `json:"afEmail"`
- NewRegistration int64 `json:"newRegistration"`
- }
- )
- var AreaCode = map[string]string{}
- var CodeArea = map[string]string{}
- var CodeTrail = map[string]string{}
- var DateMap = map[string]int{}
- var ProductMap = map[string]string{}
- func InitArea() {
- info := TiDb.Find("d_area_code", nil, "", "", -1, -1)
- if info != nil && len(*info) > 0 {
- for _, m := range *info {
- AreaCode[common.ObjToString(m["name"])] = common.ObjToString(m["code"])
- CodeArea[common.ObjToString(m["code"])] = common.ObjToString(m["name"])
- }
- }
- log.Println("AreaCodeLen ", len(AreaCode))
- log.Println("CodeAreaLen ", len(CodeArea))
- trailData := TiDb.Find("dwd_d_crm_trailstatus_code", nil, "", "", -1, -1)
- if trailData != nil && len(*trailData) > 0 {
- for _, m := range *trailData {
- CodeTrail[common.ObjToString(m["code"])] = common.ObjToString(m["name"])
- }
- }
- holidayRecords := TiDb.Find("holiday_records", nil, "", "", -1, -1)
- if holidayRecords != nil && len(*holidayRecords) > 0 {
- for _, m := range *holidayRecords {
- DateMap[common.ObjToString(m["date"])] = common.IntAll(m["change"])
- }
- }
- }
- func InitProduct(product []string) {
- for _, v := range product {
- ProductMap[v] = "dk"
- }
- }
|