123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- // Package fenwei
- // @Author gmy 2024/8/20 14:47:00
- package fenwei
- import (
- "encoding/json"
- "eta/eta_data_analysis/models"
- )
- // ThermalCoalSupplyProcessor 动力煤供应量
- type ThermalCoalSupplyProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalSupplyProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "18", "3", "10", "5", "2", "37"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW4002D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "province",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingCleanCoalSupplyProcessor 炼焦精煤供应量
- type CokingCleanCoalSupplyProcessor struct {
- BaseProcessor
- }
- func (p *CokingCleanCoalSupplyProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "18", "3", "10", "5", "2", "37"},
- "coal_type": {"13", "10", "9", "8", "7", "5", "3"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW4001D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "coal_type",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // RawCoalProvinceProductionProcessor 原煤分省分煤种产量
- type RawCoalProvinceProductionProcessor struct {
- BaseProcessor
- }
- func (p *RawCoalProvinceProductionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "18", "3", "10", "5", "2", "37"},
- "coal_type": {"14", "6", "40", "21"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW3050D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "coal_type",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // StateOwnedKeyCoalMineRawCoalProductionProcessor 国有重点煤矿原煤产量
- type StateOwnedKeyCoalMineRawCoalProductionProcessor struct {
- BaseProcessor
- }
- func (p *StateOwnedKeyCoalMineRawCoalProductionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "2", "27", "28"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW3007D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "province",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingBituminousCoalProductionProcessor 炼焦烟煤分煤种产量
- type CokingBituminousCoalProductionProcessor struct {
- BaseProcessor
- }
- func (p *CokingBituminousCoalProductionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "18", "3", "10", "5", "2", "37"},
- "coal_type": {"13", "10", "9", "8", "7", "5", "3"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW3001D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "coal_type",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // ThermalCoalInventorySocietyProcessor 动力煤库存-全社会
- type ThermalCoalInventorySocietyProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalInventorySocietyProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "79",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8004D-1"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8004D",
- QuotaName: "stock,avaliable_days,daily_consumption,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // ThermalCoalInventoryProductionProcessor 动力煤库存-生产企业
- type ThermalCoalInventoryProductionProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalInventoryProductionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "116",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8004D-2"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8004D",
- QuotaName: "stock,avaliable_days,daily_consumption,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // ThermalCoalInventorySixPowerPlantProcessor 动力煤库存-六大电厂
- type ThermalCoalInventorySixPowerPlantProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalInventorySixPowerPlantProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "118",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8004D-125500", "FW8004D-112534", "FW8004D-112548", "FW8004D-112549", "FW8004D-1129", "FW8004D-125", "FW8004D-125382", "FW8004D-125383"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8004D",
- QuotaName: "stock,avaliable_days,daily_consumption,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingCoalInventorySocietyProcessor 炼焦煤库存-全社会
- type CokingCoalInventorySocietyProcessor struct {
- BaseProcessor
- }
- func (p *CokingCoalInventorySocietyProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "79",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8005D-1"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8005D",
- QuotaName: "stock,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingCoalInventoryProductionProcessor 炼焦煤库存-生产企业
- type CokingCoalInventoryProductionProcessor struct {
- BaseProcessor
- }
- func (p *CokingCoalInventoryProductionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "116",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8005D-2"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8005D",
- QuotaName: "stock,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingCoalInventoryDownstreamProcessor 炼焦煤库存-下游企业
- type CokingCoalInventoryDownstreamProcessor struct {
- BaseProcessor
- }
- func (p *CokingCoalInventoryDownstreamProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "117",
- CheckedDims: map[string][]string{
- "product_item_code": {"FW8005D-3", "FW8005D-5"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8005D",
- QuotaName: "stock,monthly_value,inventory_index,week_value",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // NationalCoalMineInventoryProcessor 全国煤矿库存
- type NationalCoalMineInventoryProcessor struct {
- BaseProcessor
- }
- func (p *NationalCoalMineInventoryProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{},
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8001D",
- QuotaName: "monthly_value",
- SplitTypeKey: "",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // StateOwnedKeyCoalMineInventoryProcessor 国有重点煤矿库存
- type StateOwnedKeyCoalMineInventoryProcessor struct {
- BaseProcessor
- }
- func (p *StateOwnedKeyCoalMineInventoryProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "province": {"20", "16", "21", "6", "19", "23", "8", "1", "7", "17", "9", "15", "11", "22", "24", "4", "25", "12", "14", "13", "2", "27", "28"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW8003D",
- QuotaName: "monthly_value",
- SplitTypeKey: "province",
- IsTotal: 0,
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokeInventoryProcessor 焦炭库存
- type CokeInventoryProcessor struct {
- BaseProcessor
- }
- func (p *CokeInventoryProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "product_item_code": {"FW1405D-1", "FW1405D-2", "FW1405D-3", "FW1405D-4", "FW1405D-5", "FW1405D-6", "FW1405D-7"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1405D",
- QuotaName: "stock,inventory_index",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // PortDataInventoryNorthernPortProcessor 港口数据-库存-北方港口
- type PortDataInventoryNorthernPortProcessor struct {
- BaseProcessor
- }
- func (p *PortDataInventoryNorthernPortProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "79",
- CheckedDims: map[string][]string{
- "code": {"2332", "2333", "2335", "2334", "2337", "2339", "2340", "2341", "2342"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1203D",
- QuotaName: "stock",
- SplitTypeKey: "",
- IsTotal: 0,
- DataType: nil,
- Type: 2,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // PortDataInventoryInlandPortProcessor 港口数据-库存-江内港口
- type PortDataInventoryInlandPortProcessor struct {
- BaseProcessor
- }
- func (p *PortDataInventoryInlandPortProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "79",
- CheckedDims: map[string][]string{
- "code": {"2321", "2320", "2324", "2323", "2322", "2325"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1203D",
- QuotaName: "stock",
- SplitTypeKey: "product_item_code",
- IsTotal: 0,
- DataType: nil,
- Type: 2,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // PortDataDispatchNorthernPortProcessor 港口数据-调度-北方港口
- type PortDataDispatchNorthernPortProcessor struct {
- BaseProcessor
- }
- func (p *PortDataDispatchNorthernPortProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "120",
- CheckedDims: map[string][]string{
- "code": {"2364", "2365", "2366", "2363", "2367", "2368"},
- "port": {"2", "4", "7", "9", "11", "326", "327", "329", "330"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1203D",
- QuotaName: "vehicle,ship,tons",
- SplitTypeKey: "product_item_code,port",
- IsTotal: 1,
- DataType: nil,
- Type: 2,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // PortDataThroughputProcessor 港口数据-运量
- type PortDataThroughputProcessor struct {
- BaseProcessor
- }
- func (p *PortDataThroughputProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: "30",
- CheckedDims: map[string][]string{
- "code": {"2362"},
- "port_son": {"44", "43", "42", "41", "40", "39"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1203D",
- QuotaName: "transport_volume",
- SplitTypeKey: "port_son",
- IsTotal: 0,
- DataType: nil,
- Type: 2,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // DaqinLineDailyThroughputProcessor 大秦线日运量
- type DaqinLineDailyThroughputProcessor struct {
- BaseProcessor
- }
- func (p *DaqinLineDailyThroughputProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{},
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW1107D",
- QuotaName: "stock",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // ThermalCoalPortPriceProcessor 动力煤港口价格
- type ThermalCoalPortPriceProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalPortPriceProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "product_item_code": {"FW2001P-1001", "FW2001P-1002", "FW2001P-1004", "FW2001P-1005", "FW2001P-1003", "FW2001P-1171"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW2310R",
- QuotaName: "price_rmb,price_index_mom",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // ThermalCoalConsumptionProcessor 动力煤消费量
- type ThermalCoalConsumptionProcessor struct {
- BaseProcessor
- }
- func (p *ThermalCoalConsumptionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{
- "product_item_code": {"FW5002D-1", "FW5002D-2", "FW5002D-3", "FW5002D-4", "FW5002D-5", "FW5002D-6", "FW5002D-7"},
- },
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW5002D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
- // CokingCleanCoalConsumptionProcessor 炼焦精煤消费量
- type CokingCleanCoalConsumptionProcessor struct {
- BaseProcessor
- }
- func (p *CokingCleanCoalConsumptionProcessor) GenerateRequestParams(currentTime string) map[string]string {
- params := models.RequestParams{
- Category: nil,
- CheckedDims: map[string][]string{},
- DateRange: "20190820-" + currentTime,
- ProductCode: "FW5001D",
- QuotaName: "monthly_value,monthly_accumulation",
- SplitTypeKey: "",
- DataType: nil,
- IsSeason: 1,
- }
- // 将结构体转换为 JSON 字符串
- paramsJSON, _ := json.Marshal(params)
- // 返回为 map[string]string 类型
- return map[string]string{
- "params": string(paramsJSON),
- }
- }
|