Documentation ¶
Index ¶
- Variables
- func IsUrLico(s string) bool
- func MakeIP(ip string) (hip string)
- func MakeMac(mac string) string
- func ParseDateFromString(s string) (time.Time, error)
- func SplitHouseNumber(house string) (build, sect string)
- func WriteToFile(g Generator, cfg config.Config, db *sqlx.DB) error
- type AbonAddr
- type AbonAddrRow
- type AbonIdent
- type AbonIdentRow
- type AbonRow
- type AbonSrv
- type AbonSrvRow
- type AbonUsers
- type AbonUsersRow
- type Abons
- type DocType
- type DocTypeRow
- type GateWay
- type GateWayRow
- type Generator
- type IPGateWay
- type IPGateWayRow
- type IPPlan
- type IPPlanRow
- type PayTypeRow
- type PayTypes
- type PaymentRow
- type Payments
- type Region
- type RegionRow
- type Supplementary
- type SupplementaryRow
Constants ¶
This section is empty.
Variables ¶
View Source
var CorpRegexp = regexp.MustCompile(`(\d+)(\D+)(\d+)`)
View Source
var LaterRegexp = regexp.MustCompile(`(\d+)[ /-]?([а-яА-Я])$`)
Functions ¶
func ParseDateFromString ¶
ParseDateFromString парсит дату из строки
func SplitHouseNumber ¶
Types ¶
type AbonAddrRow ¶
type AbonAddrRow struct { AbonentID string `db:"-" csv:"ABONENT_ID"` RegionID int `db:"-" csv:"REGION_ID"` AddressTypeID int `db:"-" csv:"ADDRESS_TYPE_ID"` AddressType int `db:"-" csv:"ADDRESS_TYPE"` Zip sql.NullString `db:"zip" csv:"ZIP"` Country string `db:"-" csv:"COUNTRY"` Region string `db:"-" csv:"REGION"` Zone string `db:"-" csv:"ZONE"` City sql.NullString `db:"dist" csv:"CITY"` Street sql.NullString `db:"street" csv:"STREET"` Building sql.NullString `db:"build" csv:"BUILDING"` BuildSect string `db:"-" csv:"BUILD_SECT"` Apartment string `db:"flat" csv:"APARTMENT"` UnstructInfo string `db:"-" csv:"UNSTRUCT_INFO"` BeginTime time.Time `db:"-" csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` EndTime time.Time `db:"-" csv:"END_TIME" time:"2006-01-02 15:04:05"` RecordAction string `db:"-" csv:"RECORD_ACTION"` InternalID1 string `db:"uid" csv:"INTERNAL_ID1"` InternalID2 string `db:"-" csv:"INTERNAL_ID2"` Descr sql.NullString `db:"comments" csv:"-"` Company int `db:"company_id" csv:"-"` RegAddr string `db:"_regaddr" csv:"-"` RegAddrSame bool `db:"_regsame" csv:"-"` }
func (*AbonAddrRow) Calc ¶
func (a *AbonAddrRow) Calc(ainf addrInfo, cfg config.Config)
type AbonIdentRow ¶
type AbonIdentRow struct { AbonID string `db:"-" csv:"ABONENT_ID"` RegionID int `db:"-" csv:"REGION_ID"` IdentType int `db:"-" csv:"IDENT_TYPE"` Phone string `db:"-" csv:"PHONE"` InternalNumber string `db:"-" csv:"INTERNAL_NUMBER"` IMSI string `db:"-" csv:"IMSI"` IMEI string `db:"-" csv:"IMEI"` ICC string `db:"-" csv:"ICC"` MIN string `db:"-" csv:"MIN"` ESN string `db:"-" csv:"ESN"` EquipmentType int `db:"-" csv:"EQUIPMENT_TYPE"` MAC sql.NullString `db:"mac" csv:"MAC"` VPI string `db:"-" csv:"VPI"` VCI string `db:"-" csv:"VCI"` Login string `db:"-" csv:"LOGIN"` EMail string `db:"email" csv:"E_MAIL"` PIN string `db:"-" csv:"PIN"` UserDomain string `db:"-" csv:"USER_DOMAIN"` Reserved string `db:"-" csv:"RESERVED"` OriginatorName string `db:"-" csv:"ORIGINATOR_NAME"` IPType int `db:"-" csv:"IP_TYPE"` IPv4 string `db:"ip" csv:"IPV4"` IPv6 string `db:"-" csv:"IPV6"` IPv4Mask string `db:"mask" csv:"IPV4_MASK"` IPv6Mask string `db:"-" csv:"IPV6_MASK"` BeginTime time.Time `db:"attach" csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` EndTime time.Time `db:"-" csv:"END_TIME" time:"2006-01-02 15:04:05"` LineObject string `db:"-" csv:"LINE_OBJECT"` LineCross string `db:"-" csv:"LINE_CROSS"` LineBlock string `db:"-" csv:"LINE_BLOCK"` LinePair string `db:"-" csv:"LINE_PAIR"` LineReserved string `db:"-" csv:"LINE_RESERVED"` LocType string `db:"-" csv:"LOC_TYPE"` LocLac string `db:"-" csv:"LOC_LAC"` LocCell string `db:"-" csv:"LOC_CELL"` LocTa string `db:"-" csv:"LOC_TA"` LocCellWireless string `db:"-" csv:"LOC_CELL_WIRELESS"` LocMac string `db:"-" csv:"LOC_MAC"` LocLatitude string `db:"-" csv:"LOC_LATITUDE"` LocLongitude string `db:"-" csv:"LOC_LONGITUDE"` LocProjectionType string `db:"-" csv:"LOC_PROJECTION_TYPE"` RecordAction string `db:"-" csv:"RECORD_ACTION"` InternalID1 string `db:"uid" csv:"INTERNAL_ID1"` InternalID2 string `db:"-" csv:"INTERNAL_ID2"` Company int `db:"company_id" csv:"-"` }
func (*AbonIdentRow) Calc ¶
func (a *AbonIdentRow) Calc(cfg config.Config)
type AbonRow ¶
type AbonRow struct { AbonID string `db:"-" csv:"ID"` // ID RegionID int `db:"-" csv:"REGION_ID"` // REGION_ID CDate time.Time `db:"contract_date" csv:"CONTRACT_DATE" time:"2006-01-02 15:04:05"` // CONTRACT_DATE Login string `db:"id" csv:"CONTRACT"` // CONTRACT BID int `db:"bill_id" csv:"ACCOUNT"` // ACCOUNT ActualFrom time.Time `db:"-" csv:"ACTUAL_FROM" time:"2006-01-02 15:04:05"` // ACTUAL_FROM ActualTo time.Time `db:"-" csv:"ACTUAL_TO" time:"2006-01-02 15:04:05"` // ACTUAL_TO Company int `db:"company_id" csv:"-"` // AbonType int `db:"-" csv:"ABONENT_TYPE"` // ABONENT_TYPE NameInfoType int `db:"-" csv:"NAME_INFO_TYPE"` // NAME_INFO_TYPE FamilyName string `db:"-" csv:"FAMILY_NAME"` // FAMILY_NAME GivenName string `db:"-" csv:"GIVEN_NAME"` // GIVEN_NAME InitialName string `db:"-" csv:"INITIAL_NAME"` // INITIAL_NAME FIO string `db:"fio" csv:"UNSTRUCT_NAME"` // UNSTRUCT_NAME BirthDate time.Time `db:"-" csv:"BIRTH_DATE" time:"2006-01-02"` // BIRTH_DATE SBirthDate string `db:"_date_birth" csv:"-" time:"2006-01-02 15:04:05"` // BIRTH_DATE IdentCardTypeID sql.NullInt64 `db:"-" csv:"IDENT_CARD_TYPE_ID"` // IDENT_CARD_TYPE_ID IdentCardType sql.NullInt64 `db:"-" csv:"IDENT_CARD_TYPE"` // IDENT_CARD_TYPE IdentCardSerial string `db:"-" csv:"IDENT_CARD_SERIAL"` // IDENT_CARD_SERIAL SPassportDate time.Time `db:"pasport_date" csv:"-"` // SPassportDate для формирования паспорта IdentCardNumber string `db:"pasport_num" csv:"IDENT_CARD_NUMBER"` // IDENT_CARD_NUMBER IdentCardDescription string `db:"pasport_grant" csv:"IDENT_CARD_DESCRIPTION"` // IDENT_CARD_DESCRIPTION IdentCardUnstruct string `db:"pasport" csv:"IDENT_CARD_UNSTRUCT"` // IDENT_CARD_UNSTRUCT Bank sql.NullString `db:"bank_name" csv:"BANK"` // BANK BankAccount sql.NullString `db:"bank_account" csv:"BANK_ACCOUNT"` // BANK_ACCOUNT FullName sql.NullString `db:"c.name" csv:"FULL_NAME"` // FULL_NAME INN sql.NullString `db:"tax_number" csv:"INN"` // INN Contact sql.NullString `db:"representative" csv:"CONTACT"` // CONTACT PhoneFax sql.NullString `db:"phone" csv:"PHONE_FAX"` // PHONE_FAX Status int `db:"disdel" csv:"STATUS"` // STATUS Attach sql.NullTime `db:"attach" csv:"ATTACH" time:"2006-01-02 15:04:05"` // ATTACH Detach sql.NullTime `db:"detach" csv:"DETACH" time:"2006-01-02 15:04:05"` // DETACH NetworkType int `db:"-" csv:"NETWORK_TYPE"` // NETWORK_TYPE RecordAction string `db:"-" csv:"RECORD_ACTION"` // RECORD_ACTION InternalID1 string `db:"uid" csv:"INTERNAL_ID1"` // INTERNAL_ID1 CompanyName sql.NullString `db:"compname" csv:"-"` }
type AbonSrvRow ¶
type AbonSrvRow struct { AbonentID sql.NullInt64 `db:"" csv:"ABONENT_ID"` RegionID int `db:"" csv:"REGION_ID"` ID int `db:"" csv:"ID"` BeginTime time.Time `db:"attach" csv:"BEGIN_TIME"` EndTime time.Time `db:"" csv:"END_TIME"` Parameter string `db:"" csv:"PARAMETER"` SrvContract string `db:"login" csv:"SRV_CONTRACT"` RecordAction int `db:"" csv:"RECORD_ACTION"` InternalID1 string `db:"uid" csv:"INTERNAL_ID1"` InternalID2 string `db:"" csv:"INTERNAL_ID2"` Company int `db:"company_id" csv:"-"` }
func (*AbonSrvRow) Calc ¶
func (a *AbonSrvRow) Calc(cfg config.Config)
type AbonUsersRow ¶
type AbonUsersRow struct { AbonID int `db:"-" csv:"ABONENT_ID"` RegionID int `csv:"REGION_ID"` UserNumber string `db:"phone" csv:"USER_NUMBER"` UserName string `db:"fio" csv:"USER_NAME"` RecordAction int `csv:"RECORD_ACTION"` InternalID1 string `db:"uid" csv:"INTERNAL_ID1"` Company int `db:"company_id" csv:"-"` }
func (*AbonUsersRow) Calc ¶
func (r *AbonUsersRow) Calc(cfg config.Config)
type DocTypeRow ¶
type GateWayRow ¶
type GateWayRow struct { GateID int `db:"id" csv:"GATE_ID"` BeginTime time.Time `csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` EndTime time.Time `csv:"END_TIME" time:"2006-01-02 15:04:05"` Description string `db:"name" csv:"DESCRIPTION"` GateType int `csv:"GATE_TYPE"` AddressTypeID int `csv:"ADDRESS_TYPE_ID"` AddressType int `csv:"ADDRESS_TYPE"` Zip string `csv:"ZIP"` Country string `csv:"COUNTRY"` Region string `csv:"REGION"` Zone string `csv:"ZONE"` City string `csv:"CITY"` Street string `csv:"STREET"` Building string `csv:"BUILDING"` BuildSect string `csv:"BUILD_SECT"` Apartment string `csv:"APARTMENT"` UnstructInfo string `db:"addr" csv:"UNSTRUCT_INFO"` RegionID int `csv:"REGION_ID"` }
func (*GateWayRow) Calc ¶
func (a *GateWayRow) Calc(cfg config.Config)
type IPGateWayRow ¶
type IPGateWayRow struct { GateID int `db:"id" csv:"GATE_ID"` IPType int `csv:"IP_TYPE"` IPv4 string `db:"ip" csv:"IPV4"` IPv6 string `csv:"IPV6"` IPPort string `csv:"IP_PORT"` RegionID int `csv:"REGION_ID"` }
func (*IPGateWayRow) Calc ¶
func (a *IPGateWayRow) Calc(cfg config.Config)
type IPPlanRow ¶
type IPPlanRow struct { Description string `db:"name" csv:"DESCRIPTION"` IPType int `db:"-" csv:"IP_TYPE"` IPv4 string `db:"network" csv:"IPV4"` IPv6 string `db:"-" csv:"IPV6"` IPv4Mask string `db:"mask" csv:"IPV4_MASK"` IPv6Mask string `db:"-" csv:"IPV6_MASK"` BeginTime time.Time `db:"-" csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` EndTime time.Time `db:"-" csv:"END_TIME" time:"2006-01-02 15:04:05"` RegionID int `db:"-" csv:"REGION_ID"` }
type PayTypeRow ¶
type PayTypeRow struct { ID int `csv:"ID"` BeginTime time.Time `csv:"BEGIN_TIME" format:"2006-01-02 15:04:05"` EndTime time.Time `csv:"END_TIME"` Descr string `csv:"DESCRIPTION"` RegionID int `csv:"REGION_ID"` }
func LoadPayMethodsMapFromFile ¶
func LoadPayMethodsMapFromFile(filename string, cfg config.Config) (r map[int]int, pt []PayTypeRow, err error)
LoadMethodsMapFromFile loads map of payment methods from file file struct is: 0:83:Наличные 1:80:Банк 2:82:Внешние платежи 3:80:Credit Card 4:86:Бонус 5:86:Корректировка
type PaymentRow ¶
type PaymentRow struct { RegionID int `db:"-" csv:"REGION_ID"` PaymentType int `db:"-" csv:"PAYMENT_TYPE"` PayTypeID int `db:"method" csv:"PAY_TYPE_ID"` PaymentDate time.Time `db:"date" csv:"PAYMENT_DATE" time:"2006-01-02 15:04:05"` Amount string `db:"sum" csv:"AMOUNT"` AmountCurrency string `db:"-" csv:"AMOUNT_CURRENCY"` PhoneNumber sql.NullString `db:"phone" csv:"PHONE_NUMBER"` Account string `db:"bill_id" csv:"ACCOUNT"` AbonentID string `db:"uid" csv:"ABONENT_ID"` BankAccount string `db:"-" csv:"BANK_ACCOUNT"` BankName string `db:"-" csv:"BANK_NAME"` ExpressCardNumber string `db:"-" csv:"EXPRESS_CARD_NUMBER"` TerminalID string `db:"-" csv:"TERMINAL_ID"` TerminalNumber string `db:"-" csv:"TERMINAL_NUMBER"` LATITUDE string `db:"-" csv:"LATITUDE"` LONGITUDE string `db:"-" csv:"LONGITUDE"` ProjectionType string `db:"-" csv:"PROJECTION_TYPE"` CenterID string `db:"-" csv:"CENTER_ID"` DonatedPhoneNumber string `db:"-" csv:"DONATED_PHONE_NUMBER"` DonatedAccount string `db:"-" csv:"DONATED_ACCOUNT"` DonatedInternalID1 string `db:"-" csv:"DONATED_INTERNAL_ID1"` DonatedInternalID2 string `db:"-" csv:"DONATED_INTERNAL_ID2"` CardNumber string `db:"-" csv:"CARD_NUMBER"` PayParams string `db:"-" csv:"PAY_PARAMS"` PersonReceived string `db:"-" csv:"PERSON_RECIEVED"` BankDivisionName string `db:"-" csv:"BANK_DIVISION_NAME"` BankCardID string `db:"-" csv:"BANK_CARD_ID"` AddressTypeID int `db:"-" csv:"ADDRESS_TYPE_ID"` AddressType string `db:"-" csv:"ADDRESS_TYPE"` Zip string `db:"-" csv:"ZIP"` Country string `db:"-" csv:"COUNTRY"` Region string `db:"-" csv:"REGION"` Zone string `db:"-" csv:"ZONE"` City string `db:"-" csv:"CITY"` Street string `db:"-" csv:"STREET"` Building string `db:"-" csv:"BUILDING"` BuildSect string `db:"-" csv:"BUILD_SECT"` Apartment string `db:"-" csv:"APARTMENT"` UnstructInfo string `db:"-" csv:"UNSTRUCT_INFO"` RecordAction int `db:"-" csv:"RECORD_ACTION"` }
PaymentRow is a row from the PAYMENTS table
type Payments ¶
type Payments struct{}
Payments is a generator for PAYMENTS table
func (*Payments) GetFileName ¶
type RegionRow ¶
type RegionRow struct { ID int `db:"id" csv:"ID"` BeginTime time.Time `db:"-" csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` EndTime time.Time `db:"-" csv:"END_TIME" time:"2006-01-02 15:04:05"` DESCRIPTION string `db:"name" csv:"DESCRIPTION"` MCC string `db:"-" csv:"MCC"` MNC string `db:"-" csv:"MNC"` }
type Supplementary ¶
type Supplementary struct{}
func (*Supplementary) GetFileName ¶
func (a *Supplementary) GetFileName() string
type SupplementaryRow ¶
type SupplementaryRow struct { ID int `csv:"ID"` // Идентификатор услуги Mnemonic string `csv:"MNEMONIC"` // Мнемоническое обозначение BeginTime time.Time `csv:"BEGIN_TIME" time:"2006-01-02 15:04:05"` // Время начала действия EndTime time.Time `csv:"END_TIME" time:"2006-01-02 15:04:05"` // Время конца действия Description string `csv:"DESCRIPTION"` // Описание RegionID int `csv:"REGION_ID"` // Идентификатор оператора связи или структурного подразделения (ссылка на справочник операторов или филиалов) }
Click to show internal directories.
Click to hide internal directories.