diff --git a/platformapi/jxprintapi/jxprintapi_test.go b/platformapi/jxprintapi/jxprintapi_test.go index 508dd140..15157110 100644 --- a/platformapi/jxprintapi/jxprintapi_test.go +++ b/platformapi/jxprintapi/jxprintapi_test.go @@ -33,7 +33,7 @@ func TestAddPrinter(t *testing.T) { } func TestDelPrinter(t *testing.T) { - err := api.DelPrinter([]string{"20210615000012"}) + err := api.DelPrinter([]string{"20210615000012"}, "") if err != nil { t.Fatalf("PrintMsg return error:%v", err) } @@ -67,7 +67,7 @@ func TestGetPrintMsg(t *testing.T) { } func TestGetPrinterStatus(t *testing.T) { - result, err := api.GetPrinterStatus("20210615000010") + result, err := api.GetPrinterStatus("120220915001012") if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 3b0fee2d..75a6a131 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,13 +20,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; ` diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index bc1ccd02..807d2264 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -361,6 +361,29 @@ func (a *API) RetailSellStatus(trackInfo, poiCode string, foodData []*BareStoreF return failedFoodList, err } +// 此接口部分失败也返回成功,但错误消息格式(errorMsg, appFoodCode)与其它两个不一样 +func (a *API) RetailSellStatus2(trackInfo, poiCode string, foodData []map[string]string, sellStatus int) (failedFoodList []*AppFoodResult, err error) { + result, err := a.AccessAPI2("retail/sellStatus", false, map[string]interface{}{ + KeyAppPoiCode: poiCode, + "food_data": foodData, + "sell_status": sellStatus, + }, resultKeyMsg, trackInfo) + if err == nil { + var tmpFailedFoodList []*AppFoodResult4SellStatus + if msg, ok := result.(string); ok && msg != "" { + if err = utils.UnmarshalUseNumber([]byte(msg), &tmpFailedFoodList); err == nil { + for _, v := range tmpFailedFoodList { + failedFoodList = append(failedFoodList, &AppFoodResult{ + AppFoodCode: v.AppFoodCode, + ErrorMsg: v.Msg, + }) + } + } + } + } + return failedFoodList, err +} + func (a *API) RetailGet(poiCode, foodCode string) (food *AppFood, err error) { result, err := a.AccessAPI("retail/get", true, map[string]interface{}{ KeyAppPoiCode: poiCode, diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index a7dd5440..35365ac6 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -25,11 +25,7 @@ func TestRetailCatUpdate(t *testing.T) { // 测试获取门店分类列表 func TestRetailCatList(t *testing.T) { -<<<<<<< HEAD - result, err := api.RetailCatList("15478260") -======= result, err := api.RetailCatList("12663480") ->>>>>>> 274a127c31b27012875473bbf10ff3d6f8857771 if err != nil { t.Fatal(err) } @@ -45,31 +41,47 @@ func TestDeleteCat(t *testing.T) { } func TestRetailCatDelete(t *testing.T) { - //var err error - //errList := errlist.New() - //errList1 := errlist.New() - //info := []string{"11309161", "7379027", "14422863", "12405467", "12398353", "12422620", "12422751", "11437415", "2391979", "11037873", "11646173", "12286931", "11086818", "9000444", "13413407", "10874383", "11674367", "11824223", "11939392", "11810047", "12071134", "11799045", "12848707", "11596643", "14038247", "9676866", "15382980", "8967897", "11566485", "11774697", "11730687", "11798089", "11488932", "11651698", "11637939", "11831005", "11883106", "11011885", "11342761", "12131910", "12833849", "11209533", "12211457", "15874713", "11440630", "12665305", "11437682", "11440628", "9578183", "11796739", "11213162", "12665208", "13887316"} - //str := []string{"token_gFkmTBCfctlpehYTENBNpw", "token_tnrjZftD5q4lU42KI3RPsQ", "token_ih9ZUCueA_dnrHBC6eBDew", "token_uJenwb2m6hWDe36e7hhAuw", "token_o2bWH171jXW8dIikHjFFog", "token_kfsqhhQ3kPXAwxUueglF_g", "token_h86ZqAP89I-Pe6vMACVLZQ", "token_uzWsBdnSIbv1KBQPoNRKRQ", "token_ucnSaUtKiUbonBnax5dDMQ", "token_o2-KGSi8lbh1ON4seUlEiQ", "token_v0gPiP4rH1vrS51GXgZJBg", "token_k0GWFzpjDtodAW5yFhVBgA", "token_oV2lXBnc1d8kc_JgWvtFxQ", "token_gl5GkKf9XKOO5ZNK-0JPRg", "token_suOF8ngaSTOcFcjNxvdHVA", "token_nf9QokI2udnECY2s1zBIeA", "token_nZjY3PlhFWlkHxdUDr9EsA", "token_kwq5HiBJI4vnavnmDyZBuA", "token_jhE-_ku5e7g6Ys4jWt5J0g", "token_lqAjjKmpEws1pKcspd1ETw", "token_mj31nyxnSIKFfxjViWpN4w", "token_kxjANA3lKNqfJrXApsZEEg", "token_kMttVFAYWLAcPAmZi3FNjg", "token_gd5aruWWQX2Iz8CXEg1Gaw", "token_j1HkNiZHh76aEGLqJT9Pfw", "token_muEkyBPPm6quxE2P2dlNQA", "token_uoHU5jcIZNx_QV0rZI1Now", "token_jj9M4B67tEr0DKgRiidDBQ", "token_gXpPtzRin_m9SEzohBJOFA", "token_rBIwyLoU2O6qfq2_VCdBQg", "token_qY6wArUbm8ypW1IoUc5Frw", "token_m5XZKS8TiL1ILCqy1flFjg", "token_n5xs7bSk96MekhNxWuJGPw", "token_oqbTOzEAZYvr4QgRIypA9w", "token_jmBHMy8LQi-TPa1fOsJJKQ", "token_nNzvPUZFeQ009kWinAhDiw", "token_q4EqYUsEXy726qXH1fdJeA", "token_o0aHQxC55_XjOLvWuYFFCQ", "token_k9vJhV8aAX2fN-39KZRGEA", "token_vdGAQ50zMvm_Ofqz1yJJwg", "token_r-XGhX8HFahkkDMelHxFbQ", "token_nHupX9FsP6nj6HWQm0RN2w", "token_hpNdSt3m1Hs-CKAiWZlMKw", "token_mQ16KE4knE2sdPP2r8ROSw", "token_uUrPsYavDU1ExUwEbuFG8Q", "token_oSSLl9h6zIt9hKz16e1N_g", "token_ifyMH0B_2YipwaBoBmdAdQ", "token_uryS4endUdFgySqEWo9Dwg", "token_kAFq-IIr_5KYQwo5wlhPcg", "token_shBMfRfZtOS1xaNn5MdI0Q", "token_sS0KoWshUu-WlGchoxBNcA"} - //for _, v := range info { - // for _, i := range str { - err := api.RetailCatDelete("15478260", "185", "") //其他水果 柑桔柚类 - //15478260 16946099 - if err != nil { - fmt.Println(err) - } - // } + ////var err error + ////errList := errlist.New() + ////errList1 := errlist.New() + ////info := []string{"11309161", "7379027", "14422863", "12405467", "12398353", "12422620", "12422751", "11437415", "2391979", "11037873", "11646173", "12286931", "11086818", "9000444", "13413407", "10874383", "11674367", "11824223", "11939392", "11810047", "12071134", "11799045", "12848707", "11596643", "14038247", "9676866", "15382980", "8967897", "11566485", "11774697", "11730687", "11798089", "11488932", "11651698", "11637939", "11831005", "11883106", "11011885", "11342761", "12131910", "12833849", "11209533", "12211457", "15874713", "11440630", "12665305", "11437682", "11440628", "9578183", "11796739", "11213162", "12665208", "13887316"} + ////str := []string{"token_gFkmTBCfctlpehYTENBNpw", "token_tnrjZftD5q4lU42KI3RPsQ", "token_ih9ZUCueA_dnrHBC6eBDew", "token_uJenwb2m6hWDe36e7hhAuw", "token_o2bWH171jXW8dIikHjFFog", "token_kfsqhhQ3kPXAwxUueglF_g", "token_h86ZqAP89I-Pe6vMACVLZQ", "token_uzWsBdnSIbv1KBQPoNRKRQ", "token_ucnSaUtKiUbonBnax5dDMQ", "token_o2-KGSi8lbh1ON4seUlEiQ", "token_v0gPiP4rH1vrS51GXgZJBg", "token_k0GWFzpjDtodAW5yFhVBgA", "token_oV2lXBnc1d8kc_JgWvtFxQ", "token_gl5GkKf9XKOO5ZNK-0JPRg", "token_suOF8ngaSTOcFcjNxvdHVA", "token_nf9QokI2udnECY2s1zBIeA", "token_nZjY3PlhFWlkHxdUDr9EsA", "token_kwq5HiBJI4vnavnmDyZBuA", "token_jhE-_ku5e7g6Ys4jWt5J0g", "token_lqAjjKmpEws1pKcspd1ETw", "token_mj31nyxnSIKFfxjViWpN4w", "token_kxjANA3lKNqfJrXApsZEEg", "token_kMttVFAYWLAcPAmZi3FNjg", "token_gd5aruWWQX2Iz8CXEg1Gaw", "token_j1HkNiZHh76aEGLqJT9Pfw", "token_muEkyBPPm6quxE2P2dlNQA", "token_uoHU5jcIZNx_QV0rZI1Now", "token_jj9M4B67tEr0DKgRiidDBQ", "token_gXpPtzRin_m9SEzohBJOFA", "token_rBIwyLoU2O6qfq2_VCdBQg", "token_qY6wArUbm8ypW1IoUc5Frw", "token_m5XZKS8TiL1ILCqy1flFjg", "token_n5xs7bSk96MekhNxWuJGPw", "token_oqbTOzEAZYvr4QgRIypA9w", "token_jmBHMy8LQi-TPa1fOsJJKQ", "token_nNzvPUZFeQ009kWinAhDiw", "token_q4EqYUsEXy726qXH1fdJeA", "token_o0aHQxC55_XjOLvWuYFFCQ", "token_k9vJhV8aAX2fN-39KZRGEA", "token_vdGAQ50zMvm_Ofqz1yJJwg", "token_r-XGhX8HFahkkDMelHxFbQ", "token_nHupX9FsP6nj6HWQm0RN2w", "token_hpNdSt3m1Hs-CKAiWZlMKw", "token_mQ16KE4knE2sdPP2r8ROSw", "token_uUrPsYavDU1ExUwEbuFG8Q", "token_oSSLl9h6zIt9hKz16e1N_g", "token_ifyMH0B_2YipwaBoBmdAdQ", "token_uryS4endUdFgySqEWo9Dwg", "token_kAFq-IIr_5KYQwo5wlhPcg", "token_shBMfRfZtOS1xaNn5MdI0Q", "token_sS0KoWshUu-WlGchoxBNcA"} + ////for _, v := range info { + //// for _, i := range str { + ////err := api.RetailCatDelete("15478260", "185", "") //其他水果 柑桔柚类 + ////15478260 16946099 + //if err != nil { + // fmt.Println(err) //} - //t.Fatal(errList) -<<<<<<< HEAD + //// } + ////} + ////t.Fatal(errList) + ////str := []string{"15989234", "8469854", "9516023", "7685622", "13556506", "6881602", "8434218", "8055319", "9631487", "10304189", "12750127", "7763622", "10487156", "7111786", "7511838", "8694015", "8100274", "7890912", "8100271", "16031461", "12663480", "3439955", "9590548", "14518241", "9212291", "12949643", "11655829", "8803440", "8050205", "13757398", "7772819", "9298493", "14095978", "8066561", "7821246", "7870435", "9325918", "9489313", "15804487", "7653889", "10102158", "13832612", "13743831", "13653630", "15979646", "9566644", "11465562", "7804232", "12875244", "11396295", "11182878", "7890904", "7996691", "13757046", "8040308", "13894384", "8763090", "8474922", "12008311", "12772984", "7563325", "13673909", "13162342", "9833367", "9771682", "9252885", "13734300", "9397807", "7943872", "10179676", "8061767", "9151041", "7948392", "7837683", "7935102", "12973182", "9129147", "7111559", "9654444", "16148524", "9297448", "16454737", "16585188", "9567799", "9590547", "8763431", "11396293", "12971487", "13921940", "12958628", "9715274", "7653898", "7113851", "15076639", "14644525", "14672706", "9487906", "13272804", "13213430", "12818354", "8050208", "6994255", "7763623", "9252879", "7763618", "9004652", "16450657", "15526789", "7714376", "16148616", "9151008", "9590307", "12524795", "7837684", "7511835", "8363515", "11562292", "7530884", "7557374", "11333598", "7685548", "7379563", "9853707", "12566851", "13330828", "12977266", "9437489", "7887935", "13660949", "8025715", "9633587", "7877455", "13809322", "13353206", "14468256", "12725201", "8803326", "9431036", "9710572", "7188488", "8363514", "9487905", "9516024", "8988371", "15214524", "7653888", "13770681", "13424255", "11738499", "7870443", "15979510", "8694012", "16044491", "7379569", "9612115", "9853705", "9542449", "7332291", "11766973", "13668986", "11562892", "11712781", "8050204", "7852741", "14171520", "8470035", "7664598", "7593577", "8025712", "7648349", "8990050", "6868992", "6983421", "7026375", "9654442", "7332292", "7185767", "8474908", "8987050", "13007792", "9654445", "9397243", "7607959", "12648301", "7890906", "8953695", "9647891", "13210057", "8055320", "13823372", "6699483", "9202387", "13324613", "13780950", "8763089", "16445016", "7821250", "16278451", "7852744", "14785116", "7030977", "2461794", "9375123", "9542447", "7772806", "9503274", "7989322", "8171018", "9397258", "8164522", "11396290", "13716256", "9019253", "13601255", "13858191", "6868972", "8694017", "9521557", "16604873", "12814626", "9853708", "13945239", "11333594", "13512024", "8066220", "14789574", "13353428", "7875212", "16254463", "14802321", "8929645", "8803442", "7530882", "8070474", "16483095", "9718411", "7354669", "11895033", "12997752", "12796944", "6741258", "9075939", "8066562", "12822608", "7174094", "9375119", "12703509", "13456669", "12769341", "8872485", "16333742", "7844668", "8990052", "9612116", "7701893", "8070484", "7996688", "6793969", "8065767", "7169084", "7972984", "11562286", "9842860", "7763619", "7890902", "2461720", "11333597", "11478220", "9384986", "7489955", "11396297", "14204334", "9100089", "8469851", "16054304", "11735671", "9525711", "7388603", "12952781", "14018705", "7712772", "8475286", "8694207", "7891337", "9437485", "12988539", "13825019", "13630927", "15504368", "7989318", "9566643", "8570799", "9019257", "9737861", "8675995", "7877458", "12852060", "15917190", "7550514", "9460313", "11398621", "8024652", "7877453", "6783595", "15835521", "9656178", "15682431", "9298491", "9431247", "16492464", "9253031", "13810759", "9375163", "9431033", "12956339", "9431037", "8025713", "13860782", "9853710", "8429062", "9252877", "8025717", "11459135", "13470500", "8034434", "12917046", "9252889", "7648326", "13197160", "7821249", "9567798", "7802805", "15929504", "16367375", "11436066", "13251656", "8068105", "7870451", "10555090", "9238635", "6783201", "7844669", "12877927", "13874475", "7875174", "8171015", "8050201", "8450516", "7772812", "8040302", "8985811", "12836722", "9431032", "7258626", "12453501", "6699700", "7596245", "9764018", "8072067", "8607309", "16295002", "12901767", "9631485", "16374352", "11095322", "10591298", "14837468", "11092185", "7870437", "8050207", "13429030", "2461723", "16082287", "9375118", "7747521", "13745138", "4627675", "15952037", "9252886", "8988370", "10305892", "9921154", "7615274", "8232658", "7500734", "8475269", "11712677", "8929652", "11508265", "7963093", "7357682", "7963098", "9174914", "7963090", "8987052", "13867411", "9151007", "10559124", "16313795", "8664927", "6737142", "11396613", "11532316", "13700662", "14525543", "8579297", "7026319", "8476072", "13877003", "7601728", "13878902", "7290541", "7794610", "12583746", "9789218", "13325479", "7550515", "13657154", "8694421", "7838449", "8061771", "8363516", "9151006", "8025714", "9487903", "13693544", "7804237", "8566853", "11396291", "9126516", "7838448", "9851999", "8286596", "9566641", "14443179", "16082282", "15916538", "13167828", "2464037", "4385509", "9853704", "8763092", "9855224", "10217790", "7972981", "11459129", "9850817", "8040298", "2461713", "15369458", "16108585", "9681273", "16206350", "14446003", "9202390", "9589466", "3345154", "8100279", "13280673", "13625083", "7875166", "12833761", "13262364", "12822452", "13872125", "7954969", "8985813", "13787479", "15804661", "9566642", "9001942", "13845682", "7890907", "14893266", "9431038", "8383987", "14864158", "7544156", "13805203", "8429464", "8868139", "13734815", "7665673", "9589010", "8024650", "8929644", "9019256", "13781414", "11458974", "9631488", "9274733", "13924565", "12723888", "13365704", "8286597", "7756297", "7996690", "7665672", "6783841", "16012279", "9001940", "9375124", "12767290", "7763627", "7829629", "12944552", "9633391", "7500735", "16019319", "12923719", "7640862", "11334719", "9521556", "9431042", "7890908", "9151044", "7870453", "13086341", "9625435", "15827581", "7837687", "7887937", "13625349", "9202393", "7511829", "7653890", "7989315", "6794526", "9098128", "11139396", "7954976", "7996682", "7863777", "9431040", "7076576", "7111696", "13519111", "13156468", "9375121", "7870448", "7935100", "12704348", "7829623", "13248863", "8664921", "11539395", "7587064", "8803332", "12663071", "7681459", "9526555", "13348409", "7989317", "8068889", "11535796", "7821247", "7887892", "9465148", "13701057", "7685624", "8868140", "7681460", "9375164", "15114632", "7020772", "8987235", "13409561", "12874689", "9325917", "9098133", "13693149", "8434219", "7980754", "7169838", "13890060", "9614733", "7852740", "7821245", "7111680", "7955041", "6828292", "12266625", "6878158", "8694203", "6871562", "9202386", "8171011", "9541081", "9460315", "7996685", "13860778", "8803445", "8581969", "13927501", "9626729", "11526196", "13866566", "8450542", "16574388", "7870442", "7379574", "7821254", "15874706", "9812000", "8566855", "7634034", "14221271", "13929673", "12705611", "12822507", "13885386", "13352005", "9255373", "16492497", "8990051", "12782967", "12567599", "8953749", "2461716", "15927708", "14944126", "12952578", "16590875", "16193110", "7772818", "8677147", "15853822", "13440405", "8763430", "13453097", "16049008", "12836404", "11562288", "8024656", "9593462", "8231036", "16126640", "7470644", "12663103", "9489615", "7712774", "8868124", "7532178", "8579296", "13742303", "13949391", "12701972", "7273959", "9631486", "7963094", "9460317", "9263026", "8694366", "9832140", "9589008", "9465172", "8570801", "13834857", "12978850", "16030020", "9589009", "9833777", "8579295", "7513210", "8664924", "12863393", "7963096", "8286599", "7486365", "16445082", "16543494", "16071804", "11611416", "14813696", "9173503", "6994221", "7111597", "8061770", "9253633", "7890911", "7436124", "8110893", "9375120", "16344221", "12755558", "14676334", "8061769", "13961789", "8868132", "16578436", "9566645", "6698202", "7470639", "7809575", "13856237", "9252883", "9019258", "7890905", "11140731", "8929762", "7518261", "15144140", "8929648", "12755555", "12903714", "9019255", "8763401", "7169088", "2461795", "7786317", "16611720", "8070479", "8171012", "13777632", "13693675", "7935098", "7772809", "8245117", "8055322", "7379565", "7332289", "2464145", "12809013", "8040305", "16322381", "11139681", "7875172", "11458978", "13949371", "7809572", "12375547", "12782317", "9718640", "8245116", "7883776", "7870440", "8040306", "13451826", "11396288", "13424273", "9273031", "13207596", "13481543", "7925048", "8665212", "14281445", "9815326", "7844673", "9100088", "7134740", "9001943", "9431034", "9842380", "7954977", "11764356", "7653895", "8953697", "12949744", "9567797", "16563956", "8072051", "13721626", "13734286", "8956096", "8066219", "7026352", "16575557", "7837686", "9487904", "11738830", "13735157", "8070916", "13365041", "7870447", "7875175", "7943873", "7691225", "8040297", "13770708", "9474803", "9721793", "8171013", "11337965", "10531823", "9465149", "10305682", "8470034", "7870446", "8763093", "15827578", "13480436", "8171024", "16031473", "12838886", "12852059", "16581034", "13767666", "13699239", "7111603", "7756299", "7706725", "9437474", "9732183", "13960020", "11918887", "7719667", "7877452", "8232659", "8100272", "9855199", "12364252", "7557366", "8607304", "12852062", "11895037", "7963091", "7634043", "6929996", "8579294", "8286600", "13809270", "8034439", "6976084", "11465560", "11562341", "7615276", "7607952", "15951700", "8872677", "13872273", "7963095", "12840066", "12949636", "9923051", "11552428", "8024654", "9263745", "7794611", "13986537", "16454849", "6975987", "7443262", "7653899", "8050193", "14799080", "7935105", "6699461", "16579957", "7550513", "11459134", "16071685", "12975661", "13352655", "8474909", "6741392", "13359961", "7877456", "9663329", "8763088", "12670042", "4366765", "7954973", "8040309", "7756296", "13141893", "9624199", "7870444", "8985814", "13262158", "4462977", "8050194", "7685568", "12954902", "9612113", "14881541", "9266332", "8469853", "11918886", "13445608", "8665210", "7559890", "7685534", "9437478", "14860083", "7500737", "13440385", "11713570", "16081447", "16022200", "6976606", "13157978", "7174130", "13403669", "15988255", "9252881", "16027287", "10071426", "8664919", "9541080", "13685406", "9855198", "7511834", "6741144", "13734298", "8664923", "9736869", "7105609", "9577658", "9612112", "7535672", "7070710", "7943868", "9876552", "9842876", "12941218", "11918888"} + ////var errStr1 string + ////var errStr2 string + ////for _, v := range str { + //// if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销"); err != nil { + //// errList.AddErr(err) + //// errStr1 += v + "," + //// } + //// if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料"); err1 != nil { + //// errList1.AddErr(err1) + //// errStr2 += v + "," + //// } + ////} + ////fmt.Sprintf("热销:%s", errStr1) + ////fmt.Sprintf("底料:%s", errStr2) + ////t.Fatal(errList.GetErrListAsOne()) + ////t.Fatal(errList1.GetErrListAsOne()) //str := []string{"15989234", "8469854", "9516023", "7685622", "13556506", "6881602", "8434218", "8055319", "9631487", "10304189", "12750127", "7763622", "10487156", "7111786", "7511838", "8694015", "8100274", "7890912", "8100271", "16031461", "12663480", "3439955", "9590548", "14518241", "9212291", "12949643", "11655829", "8803440", "8050205", "13757398", "7772819", "9298493", "14095978", "8066561", "7821246", "7870435", "9325918", "9489313", "15804487", "7653889", "10102158", "13832612", "13743831", "13653630", "15979646", "9566644", "11465562", "7804232", "12875244", "11396295", "11182878", "7890904", "7996691", "13757046", "8040308", "13894384", "8763090", "8474922", "12008311", "12772984", "7563325", "13673909", "13162342", "9833367", "9771682", "9252885", "13734300", "9397807", "7943872", "10179676", "8061767", "9151041", "7948392", "7837683", "7935102", "12973182", "9129147", "7111559", "9654444", "16148524", "9297448", "16454737", "16585188", "9567799", "9590547", "8763431", "11396293", "12971487", "13921940", "12958628", "9715274", "7653898", "7113851", "15076639", "14644525", "14672706", "9487906", "13272804", "13213430", "12818354", "8050208", "6994255", "7763623", "9252879", "7763618", "9004652", "16450657", "15526789", "7714376", "16148616", "9151008", "9590307", "12524795", "7837684", "7511835", "8363515", "11562292", "7530884", "7557374", "11333598", "7685548", "7379563", "9853707", "12566851", "13330828", "12977266", "9437489", "7887935", "13660949", "8025715", "9633587", "7877455", "13809322", "13353206", "14468256", "12725201", "8803326", "9431036", "9710572", "7188488", "8363514", "9487905", "9516024", "8988371", "15214524", "7653888", "13770681", "13424255", "11738499", "7870443", "15979510", "8694012", "16044491", "7379569", "9612115", "9853705", "9542449", "7332291", "11766973", "13668986", "11562892", "11712781", "8050204", "7852741", "14171520", "8470035", "7664598", "7593577", "8025712", "7648349", "8990050", "6868992", "6983421", "7026375", "9654442", "7332292", "7185767", "8474908", "8987050", "13007792", "9654445", "9397243", "7607959", "12648301", "7890906", "8953695", "9647891", "13210057", "8055320", "13823372", "6699483", "9202387", "13324613", "13780950", "8763089", "16445016", "7821250", "16278451", "7852744", "14785116", "7030977", "2461794", "9375123", "9542447", "7772806", "9503274", "7989322", "8171018", "9397258", "8164522", "11396290", "13716256", "9019253", "13601255", "13858191", "6868972", "8694017", "9521557", "16604873", "12814626", "9853708", "13945239", "11333594", "13512024", "8066220", "14789574", "13353428", "7875212", "16254463", "14802321", "8929645", "8803442", "7530882", "8070474", "16483095", "9718411", "7354669", "11895033", "12997752", "12796944", "6741258", "9075939", "8066562", "12822608", "7174094", "9375119", "12703509", "13456669", "12769341", "8872485", "16333742", "7844668", "8990052", "9612116", "7701893", "8070484", "7996688", "6793969", "8065767", "7169084", "7972984", "11562286", "9842860", "7763619", "7890902", "2461720", "11333597", "11478220", "9384986", "7489955", "11396297", "14204334", "9100089", "8469851", "16054304", "11735671", "9525711", "7388603", "12952781", "14018705", "7712772", "8475286", "8694207", "7891337", "9437485", "12988539", "13825019", "13630927", "15504368", "7989318", "9566643", "8570799", "9019257", "9737861", "8675995", "7877458", "12852060", "15917190", "7550514", "9460313", "11398621", "8024652", "7877453", "6783595", "15835521", "9656178", "15682431", "9298491", "9431247", "16492464", "9253031", "13810759", "9375163", "9431033", "12956339", "9431037", "8025713", "13860782", "9853710", "8429062", "9252877", "8025717", "11459135", "13470500", "8034434", "12917046", "9252889", "7648326", "13197160", "7821249", "9567798", "7802805", "15929504", "16367375", "11436066", "13251656", "8068105", "7870451", "10555090", "9238635", "6783201", "7844669", "12877927", "13874475", "7875174", "8171015", "8050201", "8450516", "7772812", "8040302", "8985811", "12836722", "9431032", "7258626", "12453501", "6699700", "7596245", "9764018", "8072067", "8607309", "16295002", "12901767", "9631485", "16374352", "11095322", "10591298", "14837468", "11092185", "7870437", "8050207", "13429030", "2461723", "16082287", "9375118", "7747521", "13745138", "4627675", "15952037", "9252886", "8988370", "10305892", "9921154", "7615274", "8232658", "7500734", "8475269", "11712677", "8929652", "11508265", "7963093", "7357682", "7963098", "9174914", "7963090", "8987052", "13867411", "9151007", "10559124", "16313795", "8664927", "6737142", "11396613", "11532316", "13700662", "14525543", "8579297", "7026319", "8476072", "13877003", "7601728", "13878902", "7290541", "7794610", "12583746", "9789218", "13325479", "7550515", "13657154", "8694421", "7838449", "8061771", "8363516", "9151006", "8025714", "9487903", "13693544", "7804237", "8566853", "11396291", "9126516", "7838448", "9851999", "8286596", "9566641", "14443179", "16082282", "15916538", "13167828", "2464037", "4385509", "9853704", "8763092", "9855224", "10217790", "7972981", "11459129", "9850817", "8040298", "2461713", "15369458", "16108585", "9681273", "16206350", "14446003", "9202390", "9589466", "3345154", "8100279", "13280673", "13625083", "7875166", "12833761", "13262364", "12822452", "13872125", "7954969", "8985813", "13787479", "15804661", "9566642", "9001942", "13845682", "7890907", "14893266", "9431038", "8383987", "14864158", "7544156", "13805203", "8429464", "8868139", "13734815", "7665673", "9589010", "8024650", "8929644", "9019256", "13781414", "11458974", "9631488", "9274733", "13924565", "12723888", "13365704", "8286597", "7756297", "7996690", "7665672", "6783841", "16012279", "9001940", "9375124", "12767290", "7763627", "7829629", "12944552", "9633391", "7500735", "16019319", "12923719", "7640862", "11334719", "9521556", "9431042", "7890908", "9151044", "7870453", "13086341", "9625435", "15827581", "7837687", "7887937", "13625349", "9202393", "7511829", "7653890", "7989315", "6794526", "9098128", "11139396", "7954976", "7996682", "7863777", "9431040", "7076576", "7111696", "13519111", "13156468", "9375121", "7870448", "7935100", "12704348", "7829623", "13248863", "8664921", "11539395", "7587064", "8803332", "12663071", "7681459", "9526555", "13348409", "7989317", "8068889", "11535796", "7821247", "7887892", "9465148", "13701057", "7685624", "8868140", "7681460", "9375164", "15114632", "7020772", "8987235", "13409561", "12874689", "9325917", "9098133", "13693149", "8434219", "7980754", "7169838", "13890060", "9614733", "7852740", "7821245", "7111680", "7955041", "6828292", "12266625", "6878158", "8694203", "6871562", "9202386", "8171011", "9541081", "9460315", "7996685", "13860778", "8803445", "8581969", "13927501", "9626729", "11526196", "13866566", "8450542", "16574388", "7870442", "7379574", "7821254", "15874706", "9812000", "8566855", "7634034", "14221271", "13929673", "12705611", "12822507", "13885386", "13352005", "9255373", "16492497", "8990051", "12782967", "12567599", "8953749", "2461716", "15927708", "14944126", "12952578", "16590875", "16193110", "7772818", "8677147", "15853822", "13440405", "8763430", "13453097", "16049008", "12836404", "11562288", "8024656", "9593462", "8231036", "16126640", "7470644", "12663103", "9489615", "7712774", "8868124", "7532178", "8579296", "13742303", "13949391", "12701972", "7273959", "9631486", "7963094", "9460317", "9263026", "8694366", "9832140", "9589008", "9465172", "8570801", "13834857", "12978850", "16030020", "9589009", "9833777", "8579295", "7513210", "8664924", "12863393", "7963096", "8286599", "7486365", "16445082", "16543494", "16071804", "11611416", "14813696", "9173503", "6994221", "7111597", "8061770", "9253633", "7890911", "7436124", "8110893", "9375120", "16344221", "12755558", "14676334", "8061769", "13961789", "8868132", "16578436", "9566645", "6698202", "7470639", "7809575", "13856237", "9252883", "9019258", "7890905", "11140731", "8929762", "7518261", "15144140", "8929648", "12755555", "12903714", "9019255", "8763401", "7169088", "2461795", "7786317", "16611720", "8070479", "8171012", "13777632", "13693675", "7935098", "7772809", "8245117", "8055322", "7379565", "7332289", "2464145", "12809013", "8040305", "16322381", "11139681", "7875172", "11458978", "13949371", "7809572", "12375547", "12782317", "9718640", "8245116", "7883776", "7870440", "8040306", "13451826", "11396288", "13424273", "9273031", "13207596", "13481543", "7925048", "8665212", "14281445", "9815326", "7844673", "9100088", "7134740", "9001943", "9431034", "9842380", "7954977", "11764356", "7653895", "8953697", "12949744", "9567797", "16563956", "8072051", "13721626", "13734286", "8956096", "8066219", "7026352", "16575557", "7837686", "9487904", "11738830", "13735157", "8070916", "13365041", "7870447", "7875175", "7943873", "7691225", "8040297", "13770708", "9474803", "9721793", "8171013", "11337965", "10531823", "9465149", "10305682", "8470034", "7870446", "8763093", "15827578", "13480436", "8171024", "16031473", "12838886", "12852059", "16581034", "13767666", "13699239", "7111603", "7756299", "7706725", "9437474", "9732183", "13960020", "11918887", "7719667", "7877452", "8232659", "8100272", "9855199", "12364252", "7557366", "8607304", "12852062", "11895037", "7963091", "7634043", "6929996", "8579294", "8286600", "13809270", "8034439", "6976084", "11465560", "11562341", "7615276", "7607952", "15951700", "8872677", "13872273", "7963095", "12840066", "12949636", "9923051", "11552428", "8024654", "9263745", "7794611", "13986537", "16454849", "6975987", "7443262", "7653899", "8050193", "14799080", "7935105", "6699461", "16579957", "7550513", "11459134", "16071685", "12975661", "13352655", "8474909", "6741392", "13359961", "7877456", "9663329", "8763088", "12670042", "4366765", "7954973", "8040309", "7756296", "13141893", "9624199", "7870444", "8985814", "13262158", "4462977", "8050194", "7685568", "12954902", "9612113", "14881541", "9266332", "8469853", "11918886", "13445608", "8665210", "7559890", "7685534", "9437478", "14860083", "7500737", "13440385", "11713570", "16081447", "16022200", "6976606", "13157978", "7174130", "13403669", "15988255", "9252881", "16027287", "10071426", "8664919", "9541080", "13685406", "9855198", "7511834", "6741144", "13734298", "8664923", "9736869", "7105609", "9577658", "9612112", "7535672", "7070710", "7943868", "9876552", "9842876", "12941218", "11918888"} //var errStr1 string //var errStr2 string //for _, v := range str { - // if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销"); err != nil { + // if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销", 1); err != nil { // errList.AddErr(err) // errStr1 += v + "," // } - // if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料"); err1 != nil { + // if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料", 1); err1 != nil { // errList1.AddErr(err1) // errStr2 += v + "," // } @@ -78,25 +90,6 @@ func TestRetailCatDelete(t *testing.T) { //fmt.Sprintf("底料:%s", errStr2) //t.Fatal(errList.GetErrListAsOne()) //t.Fatal(errList1.GetErrListAsOne()) -======= - str := []string{"15989234", "8469854", "9516023", "7685622", "13556506", "6881602", "8434218", "8055319", "9631487", "10304189", "12750127", "7763622", "10487156", "7111786", "7511838", "8694015", "8100274", "7890912", "8100271", "16031461", "12663480", "3439955", "9590548", "14518241", "9212291", "12949643", "11655829", "8803440", "8050205", "13757398", "7772819", "9298493", "14095978", "8066561", "7821246", "7870435", "9325918", "9489313", "15804487", "7653889", "10102158", "13832612", "13743831", "13653630", "15979646", "9566644", "11465562", "7804232", "12875244", "11396295", "11182878", "7890904", "7996691", "13757046", "8040308", "13894384", "8763090", "8474922", "12008311", "12772984", "7563325", "13673909", "13162342", "9833367", "9771682", "9252885", "13734300", "9397807", "7943872", "10179676", "8061767", "9151041", "7948392", "7837683", "7935102", "12973182", "9129147", "7111559", "9654444", "16148524", "9297448", "16454737", "16585188", "9567799", "9590547", "8763431", "11396293", "12971487", "13921940", "12958628", "9715274", "7653898", "7113851", "15076639", "14644525", "14672706", "9487906", "13272804", "13213430", "12818354", "8050208", "6994255", "7763623", "9252879", "7763618", "9004652", "16450657", "15526789", "7714376", "16148616", "9151008", "9590307", "12524795", "7837684", "7511835", "8363515", "11562292", "7530884", "7557374", "11333598", "7685548", "7379563", "9853707", "12566851", "13330828", "12977266", "9437489", "7887935", "13660949", "8025715", "9633587", "7877455", "13809322", "13353206", "14468256", "12725201", "8803326", "9431036", "9710572", "7188488", "8363514", "9487905", "9516024", "8988371", "15214524", "7653888", "13770681", "13424255", "11738499", "7870443", "15979510", "8694012", "16044491", "7379569", "9612115", "9853705", "9542449", "7332291", "11766973", "13668986", "11562892", "11712781", "8050204", "7852741", "14171520", "8470035", "7664598", "7593577", "8025712", "7648349", "8990050", "6868992", "6983421", "7026375", "9654442", "7332292", "7185767", "8474908", "8987050", "13007792", "9654445", "9397243", "7607959", "12648301", "7890906", "8953695", "9647891", "13210057", "8055320", "13823372", "6699483", "9202387", "13324613", "13780950", "8763089", "16445016", "7821250", "16278451", "7852744", "14785116", "7030977", "2461794", "9375123", "9542447", "7772806", "9503274", "7989322", "8171018", "9397258", "8164522", "11396290", "13716256", "9019253", "13601255", "13858191", "6868972", "8694017", "9521557", "16604873", "12814626", "9853708", "13945239", "11333594", "13512024", "8066220", "14789574", "13353428", "7875212", "16254463", "14802321", "8929645", "8803442", "7530882", "8070474", "16483095", "9718411", "7354669", "11895033", "12997752", "12796944", "6741258", "9075939", "8066562", "12822608", "7174094", "9375119", "12703509", "13456669", "12769341", "8872485", "16333742", "7844668", "8990052", "9612116", "7701893", "8070484", "7996688", "6793969", "8065767", "7169084", "7972984", "11562286", "9842860", "7763619", "7890902", "2461720", "11333597", "11478220", "9384986", "7489955", "11396297", "14204334", "9100089", "8469851", "16054304", "11735671", "9525711", "7388603", "12952781", "14018705", "7712772", "8475286", "8694207", "7891337", "9437485", "12988539", "13825019", "13630927", "15504368", "7989318", "9566643", "8570799", "9019257", "9737861", "8675995", "7877458", "12852060", "15917190", "7550514", "9460313", "11398621", "8024652", "7877453", "6783595", "15835521", "9656178", "15682431", "9298491", "9431247", "16492464", "9253031", "13810759", "9375163", "9431033", "12956339", "9431037", "8025713", "13860782", "9853710", "8429062", "9252877", "8025717", "11459135", "13470500", "8034434", "12917046", "9252889", "7648326", "13197160", "7821249", "9567798", "7802805", "15929504", "16367375", "11436066", "13251656", "8068105", "7870451", "10555090", "9238635", "6783201", "7844669", "12877927", "13874475", "7875174", "8171015", "8050201", "8450516", "7772812", "8040302", "8985811", "12836722", "9431032", "7258626", "12453501", "6699700", "7596245", "9764018", "8072067", "8607309", "16295002", "12901767", "9631485", "16374352", "11095322", "10591298", "14837468", "11092185", "7870437", "8050207", "13429030", "2461723", "16082287", "9375118", "7747521", "13745138", "4627675", "15952037", "9252886", "8988370", "10305892", "9921154", "7615274", "8232658", "7500734", "8475269", "11712677", "8929652", "11508265", "7963093", "7357682", "7963098", "9174914", "7963090", "8987052", "13867411", "9151007", "10559124", "16313795", "8664927", "6737142", "11396613", "11532316", "13700662", "14525543", "8579297", "7026319", "8476072", "13877003", "7601728", "13878902", "7290541", "7794610", "12583746", "9789218", "13325479", "7550515", "13657154", "8694421", "7838449", "8061771", "8363516", "9151006", "8025714", "9487903", "13693544", "7804237", "8566853", "11396291", "9126516", "7838448", "9851999", "8286596", "9566641", "14443179", "16082282", "15916538", "13167828", "2464037", "4385509", "9853704", "8763092", "9855224", "10217790", "7972981", "11459129", "9850817", "8040298", "2461713", "15369458", "16108585", "9681273", "16206350", "14446003", "9202390", "9589466", "3345154", "8100279", "13280673", "13625083", "7875166", "12833761", "13262364", "12822452", "13872125", "7954969", "8985813", "13787479", "15804661", "9566642", "9001942", "13845682", "7890907", "14893266", "9431038", "8383987", "14864158", "7544156", "13805203", "8429464", "8868139", "13734815", "7665673", "9589010", "8024650", "8929644", "9019256", "13781414", "11458974", "9631488", "9274733", "13924565", "12723888", "13365704", "8286597", "7756297", "7996690", "7665672", "6783841", "16012279", "9001940", "9375124", "12767290", "7763627", "7829629", "12944552", "9633391", "7500735", "16019319", "12923719", "7640862", "11334719", "9521556", "9431042", "7890908", "9151044", "7870453", "13086341", "9625435", "15827581", "7837687", "7887937", "13625349", "9202393", "7511829", "7653890", "7989315", "6794526", "9098128", "11139396", "7954976", "7996682", "7863777", "9431040", "7076576", "7111696", "13519111", "13156468", "9375121", "7870448", "7935100", "12704348", "7829623", "13248863", "8664921", "11539395", "7587064", "8803332", "12663071", "7681459", "9526555", "13348409", "7989317", "8068889", "11535796", "7821247", "7887892", "9465148", "13701057", "7685624", "8868140", "7681460", "9375164", "15114632", "7020772", "8987235", "13409561", "12874689", "9325917", "9098133", "13693149", "8434219", "7980754", "7169838", "13890060", "9614733", "7852740", "7821245", "7111680", "7955041", "6828292", "12266625", "6878158", "8694203", "6871562", "9202386", "8171011", "9541081", "9460315", "7996685", "13860778", "8803445", "8581969", "13927501", "9626729", "11526196", "13866566", "8450542", "16574388", "7870442", "7379574", "7821254", "15874706", "9812000", "8566855", "7634034", "14221271", "13929673", "12705611", "12822507", "13885386", "13352005", "9255373", "16492497", "8990051", "12782967", "12567599", "8953749", "2461716", "15927708", "14944126", "12952578", "16590875", "16193110", "7772818", "8677147", "15853822", "13440405", "8763430", "13453097", "16049008", "12836404", "11562288", "8024656", "9593462", "8231036", "16126640", "7470644", "12663103", "9489615", "7712774", "8868124", "7532178", "8579296", "13742303", "13949391", "12701972", "7273959", "9631486", "7963094", "9460317", "9263026", "8694366", "9832140", "9589008", "9465172", "8570801", "13834857", "12978850", "16030020", "9589009", "9833777", "8579295", "7513210", "8664924", "12863393", "7963096", "8286599", "7486365", "16445082", "16543494", "16071804", "11611416", "14813696", "9173503", "6994221", "7111597", "8061770", "9253633", "7890911", "7436124", "8110893", "9375120", "16344221", "12755558", "14676334", "8061769", "13961789", "8868132", "16578436", "9566645", "6698202", "7470639", "7809575", "13856237", "9252883", "9019258", "7890905", "11140731", "8929762", "7518261", "15144140", "8929648", "12755555", "12903714", "9019255", "8763401", "7169088", "2461795", "7786317", "16611720", "8070479", "8171012", "13777632", "13693675", "7935098", "7772809", "8245117", "8055322", "7379565", "7332289", "2464145", "12809013", "8040305", "16322381", "11139681", "7875172", "11458978", "13949371", "7809572", "12375547", "12782317", "9718640", "8245116", "7883776", "7870440", "8040306", "13451826", "11396288", "13424273", "9273031", "13207596", "13481543", "7925048", "8665212", "14281445", "9815326", "7844673", "9100088", "7134740", "9001943", "9431034", "9842380", "7954977", "11764356", "7653895", "8953697", "12949744", "9567797", "16563956", "8072051", "13721626", "13734286", "8956096", "8066219", "7026352", "16575557", "7837686", "9487904", "11738830", "13735157", "8070916", "13365041", "7870447", "7875175", "7943873", "7691225", "8040297", "13770708", "9474803", "9721793", "8171013", "11337965", "10531823", "9465149", "10305682", "8470034", "7870446", "8763093", "15827578", "13480436", "8171024", "16031473", "12838886", "12852059", "16581034", "13767666", "13699239", "7111603", "7756299", "7706725", "9437474", "9732183", "13960020", "11918887", "7719667", "7877452", "8232659", "8100272", "9855199", "12364252", "7557366", "8607304", "12852062", "11895037", "7963091", "7634043", "6929996", "8579294", "8286600", "13809270", "8034439", "6976084", "11465560", "11562341", "7615276", "7607952", "15951700", "8872677", "13872273", "7963095", "12840066", "12949636", "9923051", "11552428", "8024654", "9263745", "7794611", "13986537", "16454849", "6975987", "7443262", "7653899", "8050193", "14799080", "7935105", "6699461", "16579957", "7550513", "11459134", "16071685", "12975661", "13352655", "8474909", "6741392", "13359961", "7877456", "9663329", "8763088", "12670042", "4366765", "7954973", "8040309", "7756296", "13141893", "9624199", "7870444", "8985814", "13262158", "4462977", "8050194", "7685568", "12954902", "9612113", "14881541", "9266332", "8469853", "11918886", "13445608", "8665210", "7559890", "7685534", "9437478", "14860083", "7500737", "13440385", "11713570", "16081447", "16022200", "6976606", "13157978", "7174130", "13403669", "15988255", "9252881", "16027287", "10071426", "8664919", "9541080", "13685406", "9855198", "7511834", "6741144", "13734298", "8664923", "9736869", "7105609", "9577658", "9612112", "7535672", "7070710", "7943868", "9876552", "9842876", "12941218", "11918888"} - var errStr1 string - var errStr2 string - for _, v := range str { - if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销", 1); err != nil { - errList.AddErr(err) - errStr1 += v + "," - } - if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料", 1); err1 != nil { - errList1.AddErr(err1) - errStr2 += v + "," - } - } - fmt.Sprintf("热销:%s", errStr1) - fmt.Sprintf("底料:%s", errStr2) - t.Fatal(errList.GetErrListAsOne()) - t.Fatal(errList1.GetErrListAsOne()) ->>>>>>> 274a127c31b27012875473bbf10ff3d6f8857771 } func TestRetailList(t *testing.T) { @@ -342,35 +335,17 @@ func TestRetailSkuSellStatus(t *testing.T) { } func TestRetailSellStatus(t *testing.T) { - result, err := api.RetailSellStatus(utils.GetUUID(), "13780950", []*BareStoreFoodInfo{ + result, err := api.RetailSellStatus(utils.GetUUID(), "10071426", []*BareStoreFoodInfo{ &BareStoreFoodInfo{ - AppFoodCode: "22781", + AppFoodCode: "6092651", Skus: []*BareStoreSkuInfo{ &BareStoreSkuInfo{ - SkuID: "22781", - Price: "18.7", - Stock: "0", + //SkuID: "22781", + //Price: "18.7", + //Stock: "0", }, }, }, - //&BareStoreFoodInfo{ - // AppFoodCode: "23840", - // Skus: []*BareStoreSkuInfo{ - // &BareStoreSkuInfo{ - // SkuID: "23840", - // Stock: "123", - // }, - // }, - //}, - //&BareStoreFoodInfo{ - // AppFoodCode: "2384999", - // Skus: []*BareStoreSkuInfo{ - // &BareStoreSkuInfo{ - // SkuID: "2384999", - // Stock: "123", - // }, - // }, - //}, }, SellStatusOffline) if err != nil { t.Fatal(err) @@ -378,6 +353,14 @@ func TestRetailSellStatus(t *testing.T) { t.Log(utils.Format4Output(result, false)) } +func TestRetailSellStatus2(t *testing.T) { + result, err := api.RetailSellStatus2(utils.GetUUID(), "10071426", []map[string]string{{"app_spu_code": "6092651"}}, SellStatusOffline) + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(result, false)) +} + func TestCategoryAttrList(t *testing.T) { result, err := api.CategoryAttrList(200002680) if err != nil { diff --git a/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_detail/response/freightTemplate_detail_response.go b/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_detail/response/freightTemplate_detail_response.go index dd3eb8cb..25b9c5e3 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_detail/response/freightTemplate_detail_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_detail/response/freightTemplate_detail_response.go @@ -6,38 +6,54 @@ type FreightTemplateDetailResponse struct { doudian_sdk.BaseDoudianOpApiResponse Data *FreightTemplateDetailData `json:"data"` } + type ColumnsItem struct { - // 首重(单位:kg) 按重量计价必填 0.1-999.9之间的小数,小数点后一位 - FirstWeight float64 `json:"first_weight"` - // 首重价格(单位:元) 按重量计价必填 0.00-30.00之间的小数,小数点后两位 - FirstWeightPrice float64 `json:"first_weight_price"` - // 首件数量(单位:个) 按数量计价必填 1-999的整数 - FirstNum int64 `json:"first_num"` - // 首件价格(单位:元)按数量计价必填 0.00-30.00之间的小数,小数点后两位 - FirstNumPrice float64 `json:"first_num_price"` - // 续重(单位:kg) 按重量计价必填 0.1-999.9之间的小数,小数点后一位 - AddWeight float64 `json:"add_weight"` - // 续重价格(单位:元) 按重量计价必填 0.00-30.00之间的小数,小数点后两位 - AddWeightPrice float64 `json:"add_weight_price"` - // 续件(单位:个) 按数量计价必填 1-999的整数 - AddNum int64 `json:"add_num"` - // 续件价格(单位:元) 按数量计价必填 0.00-30.00之间的小数,小数点后两位 - AddNumPrice float64 `json:"add_num_price"` - // 是否默认计价方式(1:是;0:不是) - IsDefault int64 `json:"is_default"` - // 是否限运规则 - IsLimited bool `json:"is_limited"` - // 是否包邮规则 - IsOverFree bool `json:"is_over_free"` - // 满xx重量包邮(单位:kg)0.1-10.0之间的小数,小数点后一位 - OverWeight float64 `json:"over_weight"` - // 满xx金额包邮(单位:分)10-99900的整数 - OverAmount int64 `json:"over_amount"` - // 满xx件包邮 1-10之间的整数 - OverNum int64 `json:"over_num"` + AddNum int `json:"add_num"` + AddNumPrice int `json:"add_num_price"` + AddWeight int `json:"add_weight"` + AddWeightPrice int `json:"add_weight_price"` + FirstNum int `json:"first_num"` + FirstNumPrice int `json:"first_num_price"` + FirstWeight int `json:"first_weight"` + FirstWeightPrice int `json:"first_weight_price"` + IsDefault int `json:"is_default"` + IsLimited bool `json:"is_limited"` + IsOverFree bool `json:"is_over_free"` + OverAmount int `json:"over_amount"` + OverNum int `json:"over_num"` + OverWeight int `json:"over_weight"` + //// 首重(单位:kg) 按重量计价必填 0.1-999.9之间的小数,小数点后一位 + //FirstWeight float64 `json:"first_weight"` + //// 首重价格(单位:元) 按重量计价必填 0.00-30.00之间的小数,小数点后两位 + //FirstWeightPrice float64 `json:"first_weight_price"` + //// 首件数量(单位:个) 按数量计价必填 1-999的整数 + //FirstNum int64 `json:"first_num"` + //// 首件价格(单位:元)按数量计价必填 0.00-30.00之间的小数,小数点后两位 + //FirstNumPrice float64 `json:"first_num_price"` + //// 续重(单位:kg) 按重量计价必填 0.1-999.9之间的小数,小数点后一位 + //AddWeight float64 `json:"add_weight"` + //// 续重价格(单位:元) 按重量计价必填 0.00-30.00之间的小数,小数点后两位 + //AddWeightPrice float64 `json:"add_weight_price"` + //// 续件(单位:个) 按数量计价必填 1-999的整数 + //AddNum int64 `json:"add_num"` + //// 续件价格(单位:元) 按数量计价必填 0.00-30.00之间的小数,小数点后两位 + //AddNumPrice float64 `json:"add_num_price"` + //// 是否默认计价方式(1:是;0:不是) + //IsDefault int64 `json:"is_default"` + //// 是否限运规则 + //IsLimited bool `json:"is_limited"` + //// 是否包邮规则 + //IsOverFree bool `json:"is_over_free"` + //// 满xx重量包邮(单位:kg)0.1-10.0之间的小数,小数点后一位 + //OverWeight float64 `json:"over_weight"` + //// 满xx金额包邮(单位:分)10-99900的整数 + //OverAmount int64 `json:"over_amount"` + //// 满xx件包邮 1-10之间的整数 + //OverNum int64 `json:"over_num"` // 当前规则生效的地址,统一以List结构返回,该结构为嵌套结构。对应的json格式为[{"id":"32","children":[{"id":"320500","children":[{"id":"320508","children":[{"id":"320508014"},{"id":"320508004"}]}]}]}] 注意:返回的为最新的四级地址版本(地址存储升级变更的可能,以最新的返回) ProvinceInfos []ProvinceInfosItem `json:"province_infos"` } + type Data struct { // 模板信息 Template *Template `json:"template"` @@ -50,21 +66,29 @@ type FreightTemplateDetailData struct { } type Template struct { // 模板id - Id int64 `json:"id"` - // 模板名称 - TemplateName string `json:"template_name"` - // 发货省份id + //Id int64 `json:"id"` + //// 模板名称 + //TemplateName string `json:"template_name"` + //// 发货省份id + //ProductProvince string `json:"product_province"` + //// 发货城市id + //ProductCity string `json:"product_city"` + //// 计价方式-1.按重量计价 2.按数量计价 + //CalculateType int64 `json:"calculate_type"` + //// 快递方式-1.快递 目前仅支持1 + //TransferType int64 `json:"transfer_type"` + //// 模板类型-0:阶梯计价 1:固定运费 2:卖家包邮 3:货到付款 + //RuleType int64 `json:"rule_type"` + //// 固定运费金额(单位:分) 固定运费模板必填 1-9900之间的整数 + //FixedAmount int64 `json:"fixed_amount"` + CalculateType int `json:"calculate_type"` + FixedAmount int `json:"fixed_amount"` + Id int `json:"id"` + ProductCity string `json:"product_city"` ProductProvince string `json:"product_province"` - // 发货城市id - ProductCity string `json:"product_city"` - // 计价方式-1.按重量计价 2.按数量计价 - CalculateType int64 `json:"calculate_type"` - // 快递方式-1.快递 目前仅支持1 - TransferType int64 `json:"transfer_type"` - // 模板类型-0:阶梯计价 1:固定运费 2:卖家包邮 3:货到付款 - RuleType int64 `json:"rule_type"` - // 固定运费金额(单位:分) 固定运费模板必填 1-9900之间的整数 - FixedAmount int64 `json:"fixed_amount"` + RuleType int `json:"rule_type"` + TemplateName string `json:"template_name"` + TransferType int `json:"transfer_type"` } type ChildrenItem struct { // 地址id,第一级是省份、第二级是城市、第三级是区、第四级是街道 diff --git a/platformapi/tiktok_shop/tiktok_api/sku_test.go b/platformapi/tiktok_shop/tiktok_api/sku_test.go index 4b71ade2..9ed6fc8a 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_test.go @@ -169,15 +169,16 @@ var c = []int64{ //668708, //668713, //668707, -//668712, -//668710, -//668714, -//668723, -//668790, -//668789, -//668785, -//668512, -//667481, +//668712,running +//668710,running +//668714,running + +//668723, ok +//668790, no +//668789, no +//668785, no +//668512, running +//667481, running // 删除已经创建商品,重新同步 func TestDeleteSkuAndUploadSku(t *testing.T) { @@ -217,10 +218,11 @@ func TestDeleteSkuAndUploadSkuFengJinBiXu222(t *testing.T) { var errList = make([]error, 0, 0) for i := 1; i < 100; i++ { result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{ - //Status: 2, - //CheckStatus: 3, // 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架 - Page: int64(i), - Size: 100, + Status: 0, + CheckStatus: 3, // 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架 + Page: int64(i), + Size: 100, + StoreId: 69395217, }) if err != nil { globals.SugarLogger.Debugf("=index := %d ,err := %s", i, utils.Format4Output(err, false)) diff --git a/platformapi/tiktok_shop/tiktok_api/store.go b/platformapi/tiktok_shop/tiktok_api/store.go index c9b5eda7..344cb5be 100644 --- a/platformapi/tiktok_shop/tiktok_api/store.go +++ b/platformapi/tiktok_shop/tiktok_api/store.go @@ -328,6 +328,7 @@ func (a *API) GetStoreFreight(storeId int64) ([]int64, error) { //获取运费模板详情 func (a *API) GetStoreFreightDetail(freightId int64) (*freightTemplate_detail_response.Data, error) { request := freightTemplate_detail_request.New() + request.Param.FreightId = freightId result, err := request.Execute(a.accessTokenObj) if err != nil { return nil, err diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index e4edac99..dc62a819 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -31,7 +31,8 @@ import ( "time" ) -//var token = `{"access_token":"f1ee4188-d49a-4eaf-9cb8-7d754a23d19e","expires_in":1678053416,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"08ce6c28-37b4-4c3e-9942-7d078c551bc2","authority_id":""}` +var token2 = `{"access_token":"26a0ee33-fca9-4b80-980a-3d6cf48ca159","expires_in":1678656378,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"ef12dcb4-766d-4e6b-905d-448a25279431","authority_id":""}` +var api2 = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token2) //创建店铺 func TestCreateStore(t *testing.T) { @@ -558,3 +559,9 @@ func TryUnmarshalUseNumber(data []byte, result interface{}) error { d.UseNumber() return d.Decode(result) } + +func TestGetStoreFreightDetail(t *testing.T) { + detail, err := api2.GetStoreFreightDetail(25370494) + fmt.Println(utils.Format4Output(detail, false)) + fmt.Println(err) +} diff --git a/platformapi/tiktok_shop/tiktok_api/transport_test.go b/platformapi/tiktok_shop/tiktok_api/transport_test.go index 323d7401..a6a4765e 100644 --- a/platformapi/tiktok_shop/tiktok_api/transport_test.go +++ b/platformapi/tiktok_shop/tiktok_api/transport_test.go @@ -1,6 +1,7 @@ package tiktok_api import ( + "encoding/json" "fmt" "testing" ) @@ -42,3 +43,23 @@ func TestGetShipmentInfo(t *testing.T) { func TestGetStoreAutoCallRiderInfo(t *testing.T) { a.GetStoreAutoCallRiderInfo(64212030) } + +func TestMap2(t *testing.T) { + aa := `{ + "四川":[ + {"张淋":"18981810340"},{"李伟达":"18988808752"}, + {"张淋":"18981810340"},{"李伟达":"18988808752"} + ], + "广州":[ + {"张淋":"18981810340"},{"李伟达":"18988808752"}, + {"张淋":"18981810340"},{"李伟达":"18988808752"} + ], + "西安":[ + {"张淋":"18981810340"},{"李伟达":"18988808752"}, + {"张淋":"18981810340"},{"李伟达":"18988808752"} + ] +}` + list := make(map[string][]map[string]string, 0) + json.Unmarshal([]byte(aa), &list) + t.Log(list) +}