diff --git a/platformapi/jdapi/jdapi_test.go b/platformapi/jdapi/jdapi_test.go index be10b185..558db238 100644 --- a/platformapi/jdapi/jdapi_test.go +++ b/platformapi/jdapi/jdapi_test.go @@ -33,8 +33,8 @@ func init() { // 果切 //api = New("3ef42248-1247-4efa-8624-43cd3a3b97ae", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26") - // 京东超市 381564 - api = New("f99d25b8-33a6-4251-a97c-5e24b80b0005", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da") + // 京东超市 359459 + api = New("21ff22c5-0716-4c05-9468-8e4dde2b1cd6", "21b627c23ea04c69b64b48d0b361213e", "51cd27a748e64c829b4b7f83f4844610") //prod zs // api = New("6f8d3290-0120-4ad7-8b53-943c67c84f3f", "789279b9ae814ba091ac52815566b54d", "5d668cd227644637bb0fd73ed8118ec8") // const cookieValue = "YYJV3NHVBPHLD36FWP6F3EM5PTXJ2XZQS7U4HWRIDPP4IWGUKUIB4XG5N26CZRDLDF7PKOXBPD6BNTUAJLETLZOIWMCVFI3K6MYZIY4QBIXIMXYDJNUKFGJVQTN5356SAD6WPCIHWNQAG7DDMF7L7S3SHCT3RM3CQG7IJIPUQ3THS5UIUYWMKINM7ETUOQB7OBPOPZVCT3ZJY55243TDVXLO25PP4UYSPTTPMNQ7HPMWOJKJ3BJWGVHD243MXH7NZWW264TKN5UOCJBSSSOKD2QQII" diff --git a/platformapi/jdapi/store_page.go b/platformapi/jdapi/store_page.go index 54037c43..b9b4e3c1 100644 --- a/platformapi/jdapi/store_page.go +++ b/platformapi/jdapi/store_page.go @@ -1033,12 +1033,14 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr for _, vv := range ImgStr { ImgList = append(ImgList, "http://img20.360buyimg.com/vc/"+vv.(string)) } + category, _ := utils.TryInterface2Int64(v.(map[string]interface{})["thirdCategoryId"]) productInfo := &ProductInfo{ OriginalName: v.(map[string]interface{})["name"].(string), UpcCode: v.(map[string]interface{})["upcCode"].(string), Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000), ImgList: ImgList, BrandName: v.(map[string]interface{})["brandName"].(string), + Categories: []string{utils.Int64ToStr(category)}, } productInfos = append(productInfos, productInfo) } diff --git a/platformapi/jdapi/store_page_test.go b/platformapi/jdapi/store_page_test.go index ca04ad11..b5ebf987 100644 --- a/platformapi/jdapi/store_page_test.go +++ b/platformapi/jdapi/store_page_test.go @@ -211,7 +211,7 @@ func TestC(t *testing.T) { //} // func TestGetJdUpcCodeByName(t *testing.T) { - result, err := api.GetJdUpcCodeByName("", "6924343516087", 1, 5) + result, err := api.GetJdUpcCodeByName("", "6934660528526", 1, 5) if err != nil { t.Fatal(err) } @@ -219,6 +219,27 @@ func TestGetJdUpcCodeByName(t *testing.T) { t.Log(utils.Format4Output(result, false)) } +var upcList = []int64{4250594207842, 4891248060835, 4891913367245, 4891913367245, 4895251001007, 4897043320150, 4897050052402, 4897075520504, 4897081072646, 4897082059998, 4897098800133, 4897098800164, 4897107140083, 4897114060244, 4902750375628, 5060548402051, 6900050101372, 6900050101372, 6900596685053, 6900596686074, 6901009904747, 6901009906413, 6901009906413, 6901009914319, 6901009920181, 6901009920181, 6901009920358, 6901035603515, 6901035603638, 6901035603638, 6901035604284, 6901035609265, 6901035609265, 6901035609265, 6901035609715, 6901035609715, 6901035613002, 6901035625074, 6901070600890, 6901070601088, 6901070601088, 6901073090032, 6901073090032, 6901180581683, 6901180915884, 6901209211775, 6901209253263, 6901209257452, 6901209257452, 6901225997233, 6901225997233, 6901225997233, 6901236382530, 6901236383292, 6901236383292, 6901236388044, 6901236388044, 6901533201428, 6901533201428, 6901584066052, 6901584194236, 6901584195158, 6901584195349, 6901584197794, 6901584198784, 6901584199224, 6901584400498, 6901584400931, 6901584401334, 6901584401624, 6901584504202, 6901584504356, 6901584700147, 6901584700147, 6901584700161, 6901584700161, 6901668005809, 6901668006035, 6901668053718, 6901668053916, 6901668053916, 6901668053916, 6901668931047, 6901668931085, 6901668934017, 6901668934451, 6901668935496, 6901668936271, 6901668936332, 6901668936356, 6901668936394, 6901798187215, 6901798191335, 6901798194923, 6901844500487, 6901844500487, 6901844550017, 6901844593687, 6901845040517, 6901845041491, 6901845045796, 6902007010065, 6902007010379, 6902007211547, 6902007414016, 6902007506018, 6902018791045, 6902018792172, 6902083882433, 6902083896959, 6902088112887, 6902088708103, 6902088708103, 6902088717266, 6902088717266, 6902088717990, 6902088717990, 6902212016890, 6902227012078, 6902227018162, 6902445007115, 6902445032223, 6902445032223, 6902534238451, 6902878111892, 6902878111892, 6902878112677, 6902878112677, 6902878122485, 6902878122485, 6902890218814, 6902890227083, 6902890229995, 6902890229995, 6902890233923, 6902890234418, 6902890236092, 6902890236092, 6902890237419, 6902890237419, 6902890237754, 6902890245247, 6902890249337, 6902890250166, 6902890253754, 6902890256496, 6902890257721, 6902890257943, 6902890258827, 6902890258940, 6902890259442, 6902890259497, 6902902003896, 6902902009805, 6902902012713, 6902902012904, 6902934990683, 6902934990683, 6902934990683, 6903148048955, 6903148048955, 6903148261231, 6903148261231, 6903252016314, 6904417100480, 6904508004031, 6904589981818, 6904682123207, 6904682300172, 6904682300233, 6906151633750, 6906303004056, 6906303999888, 6906303999888, 6906366213044, 6906907907012, 6906907907012, 6907149707194, 6907435672908, 6907435672908, 6907476590803, 6907861049534, 6907861049534, 6907974983909, 6907974983909, 6907992511955, 6907992513188, 6907992513188, 6907992513362, 6907992514901, 6907992514901, 6907992518398, 6907992631264, 6907992631264, 6907992631264, 6907992820217, 6907992822723, 6907992822723, 6907992822723, 6907992822761, 6907992822761, 6907992822976, 6907992822976, 6907992823010, 6907992823010, 6907992823010, 6907992823195, 6907992823348, 6907992823348, 6907992824703, 6908312001897, 6909131169201, 6909131181234, 6909131181234, 6909131280258, 6909131280647, 6909131280647, 6909131282535, 6909131282559, 6909131282559, 6909493400240, 6909493400240, 6909493400257, 6909493632443, 6909493632443, 6909841188813, 6910019013455, 6910019013455, 6910019018801, 6911316000131, 6911316230026, 6911316233133, 6911316361874, 6911316370203, 6911316375314, 6911316375376, 6911316376410, 6911316380028, 6911316380028, 6911316380219, 6911316380653, 6911316380806, 6911316381056, 6911316582392, 6911567881633, 6911567886522, 6911567887550, 6911567888007, 6911569010475, 6911569010826, 6911569011229, 6911569014381, 6911754102978, 6911988000316, 6911988017840, 6911988017840, 6911988034779, 6911988050656, 6913029002006, 6914068012933, 6914757900527, 6914757900527, 6914782083226, 6914782109193, 6914782109209, 6914782109216, 6914782129757, 6914782129771, 6914782130005, 6914782202504, 6914782217416, 6914782218420, 6914789001056, 6914789001056, 6914789001056, 6914973604513, 6914973612860, 6914973613218, 6914973613232, 6914973613256, 6914973613294, 6915993300775, 6915993302229, 6915993302366, 6915993303424, 6915993303424, 6915993304650, 6916196423858, 6916196425203, 6916730992345, 6917751470447, 6917878000879, 6917878000879, 6917878002989, 6917878003573, 6917878007748, 6917878030111, 6917878047782, 6917878053318, 6917878069494, 6918149253222, 6918272090381, 6918272090381, 6918272090381, 6918381138448, 6918598032126, 6918768000221, 6918955140679, 6918955140679, 6919892633309, 6919892656209, 6919892656407, 6919892880109, 6919892880109, 6919892880109, 6919892880208, 6919892880208, 6919892880208, 6919892990037, 6919892991386, 6919892991577, 6919892991614, 6920130971893, 6920130972678, 6920143500059, 6920143500059, 6920143500745, 6920143500745, 6920152400029, 6920152414040, 6920152426067, 6920174736939, 6920180210775, 6920208902156, 6920208915996, 6920208915996, 6920208915996, 6920208916719, 6920208916719, 6920208916719, 6920208923021, 6920208933570, 6920208983520, 6920208983520, 6920208985050, 6920208985050, 6920208995547, 6920233002371, 6920233002371, 6920233023376, 6920233023376, 6920265888905, 6920265888905, 6920267903286, 6920295301375, 6920295301375, 6920368420422, 6920368420446, 6920368420446, 6920382700159, 6920459955383, 6920459957639, 6920564106564, 6920658267140, 6920696200031, 6920731751108, 6920731763156, 6920732120910, 6920732121078, 6920732121078, 6920732320006, 6920732320006, 6920790980938, 6920902951689, 6920907804225, 6920907804751, 6920907804775, 6920907804911, 6920907807943, 6920907807943, 6920907807943, 6920907808032, 6920907808278, 6920907808278, 6920907808278, 6920907810080, 6920907813005, 6920907819021, 6920912359048, 6921096190410, 6921097102771, 6921097102771, 6921098882351, 6921101209632, 6921168502127, 6921168550128, 6921168559244, 6921168594016, 6921168594993, 6921168595747, 6921168595747, 6921168595747, 6921211101154, 6921211101154, 6921211101154, 6921233902166, 6921233902166, 6921233902203, 6921233902203, 6921233902647, 6921233902647, 6921244498603, 6921284451033, 6921284451033, 6921284451217, 6921284451217, 6921284493972, 6921284493972, 6921292709232, 6921317600827, 6921317600827, 6921317944341, 6921317957631, 6921317958911, 6921336821142, 6921336821258, 6921336821258, 6921336821319, 6921336821319, 6921336821319, 6921336821715, 6921393000047, 6921393000047, 6921408428842, 6921413234988, 6921482336019, 6921482336064, 6921482336088, 6921555526897, 6921555536513, 6921555537268, 6921580294549, 6921580294556, 6921681105355, 6921681105355, 6921681105386, 6921774200776, 6921804600361, 6921804700023, 6921804700207, 6921804700306, 6921804700306, 6921804700306, 6921804701280, 6921956655219, 6921980758085, 6922024730029, 6922024730029, 6922024731200, 6922188772781, 6922222701913, 6922222701913, 6922222701913, 6922225088844, 6922266448850, 6922311001856, 6922311001856, 6922359500267, 6922408734568, 6922456857639, 6922477411599, 6922507807682, 6922507809754, 6922507822159, 6922507822647, 6922507823927, 6922507826966, 6922507831243, 6922555291150, 6922555291150, 6922555291150, 6922577726234, 6922577726258, 6922577726258, 6922598809664, 6922650313412, 6922824001305, 6922824001305, 6922824065024, 6922824589247, 6922824589261, 6922868221219, 6923120620870, 6923240600813, 6923349698025, 6923450605738, 6923450657607, 6923450657607, 6923450657638, 6923450657638, 6923450657638, 6923450658048, 6923450658048, 6923450659977, 6923450666357, 6923450666357, 6923450666357, 6923450666814, 6923450668504, 6923450668535, 6923450669693, 6923555258273, 6923644241735, 6923644241735, 6923644264192, 6923644264192, 6923644264192, 6923644264659, 6923644266271, 6923644270766, 6923644275198, 6923644275198, 6923644284329, 6923644285760, 6923644286736, 6923644286736, 6923807030251, 6923807030268, 6923841900923, 6923870799505, 6923870799529, 6923870799536, 6924149013094, 6924160714529, 6924170578357, 6924187839281, 6924226352306, 6924254695932, 6924503308026, 6924546001052, 6924546001182, 6924546001199, 6924546001281, 6924546001380, 6924546002714, 6924546006286, 6924611510090, 6924618333548, 6924640204182, 6924743919846, 6924743923270, 6924743925076, 6924743925076, 6924762310853, 6924762312789, 6924762312796, 6924762379843, 6924762379867, 6924790600025, 6924790600490, 6924810801326, 6924882498271, 6924960400097, 6925149736488, 6925303710903, 6925303710910, 6925303711184, 6925303711184, 6925303711184, 6925303723026, 6925303723408, 6925303723408, 6925303740788, 6925303792749, 6925303792749, 6925303792978, 6925303792978, 6925303792978, 6925303793579, 6925303795535, 6925425421817, 6925425424306, 6925432100187, 6925632602580, 6925648220891, 6925672231252, 6925678103690, 6925696400238, 6925696400245, 6925841400236, 6926145714029, 6926213558982, 6926213558999, 6926213559088, 6926265331809, 6926292517276, 6926292517276, 6926292586395, 6926410320016, 6926410320016, 6926410320016, 6926410320047, 6926410320047, 6926410320047, 6926410320115, 6926410321075, 6926410321075, 6926410321075, 6926410321396, 6926410336604, 6926475201015, 6926475201312, 6926475201312, 6926475201312, 6926475201350, 6926475201350, 6926475201350, 6926475201428, 6926475201428, 6926475201428, 6926475202951, 6926475204054, 6926475204344, 6926475204412, 6926475205587, 6926475206027, 6926475209400, 6926475209967, 6926475210062, 6926475210345, 6926475210604, 6926475210628, 6926650313151, 6926667100195, 6926721232251, 6926721251405, 6926721251405, 6926858909040, 6926892520089, 6926896702443, 6926896702955, 6926896703044, 6926896703044, 6926896704157, 6926896704423, 6926896704423, 6927236300107, 6927276801985, 6927276801985, 6927276802401, 6927462201131, 6927462205474, 6927462217224, 6927510438854, 6927514390622, 6927556601182, 6927643211140, 6927796500207, 6927796500207, 6927992570080, 6927992570080, 6928002374438, 6928002374551, 6928002375299, 6928002379327, 6928312901607, 6928312911170, 6928312911170, 6928312956171, 6928316800623, 6928316800623, 6928316800623, 6928500000860, 6928521300956, 6928804011159, 6928804011159, 6928804011159, 6928804013672, 6928822300037, 6928822300044, 6928844306635, 6928867702513, 6928894400031, 6928894400031, 6930044166421, 6930044177298, 6930044178844, 6930044188225, 6930044188379, 6930044188386, 6930044192161, 6930047600823, 6930210788419, 6930639260602, 6930639260619, 6930639260626, 6930639260640, 6930763971542, 6931008196409, 6931173500469, 6931544930024, 6931544930024, 6931544930031, 6931544930031, 6931563100637, 6931563100644, 6931563100880, 6931563110018, 6931590101720, 6931590101744, 6931649110871, 6931649110871, 6931899286906, 6931958014327, 6931958014938, 6931958025262, 6931958028706, 6932024200644, 6932024200781, 6932024200781, 6932024200781, 6932024201122, 6932024201351, 6932041213788, 6932397915060, 6932397930131, 6932397930612, 6932490342213, 6932571040007, 6932571040168, 6932571041004, 6932759720219, 6933811920400, 6933904416926, 6933982202817, 6934024502865, 6934024515902, 6934272913734, 6934660510316, 6934660510316, 6934660528526, 6934660528526, 6934665082313, 6934665082313, 6934665088247, 6934901003591, 6934901003591, 6935036481902, 6935145301061, 6935145341029, 6935202701551, 6935202701551, 6935270641919, 6935270644309, 6935270647263, 6935284411768, 6935284415162, 6935284415650, 6935284415667, 6935284415667, 6935284415933, 6935284417340, 6935284470215, 6935284471076, 6935284471229, 6935284471236, 6935361612835, 6935563603297, 6936072100451, 6936072100550, 6936072100550, 6936072100550, 6936158286291, 6936158286291, 6936158286291, 6936381703442, 6936394022790, 6936480203881, 6936515852626, 6936515881879, 6936891520645, 6936891520829, 6936891521604, 6937056100047, 6937056100047, 6937056101068, 6937095800175, 6937110382860, 6937110382860, 6937188412483, 6937188412483, 6937188413374, 6937188413374, 6937221704339, 6937221716196, 6937777800097, 6937835316096, 6937891300183, 6937962104207, 6937962104948, 6937962112738, 6937962112998, 6937962130183, 6938029400119, 6938029400119, 6938186602333, 6938636620016, 6938842801292, 6938842801292, 6938842801391, 6938842801407, 6938888880848, 6938888880848, 6938888880848, 6938888881630, 6938888882323, 6938888882613, 6938888886895, 6938888887342, 6939158400858, 6939485923358, 6939621400064, 6939621400859, 6939646305351, 6939726310251, 6939729902972, 6939729904075, 6939917833019, 6940008506217, 6940187200036, 6940188805827, 6940510900046, 6940791000398, 6940997710091, 6941051307813, 6941051311223, 6941308814125, 6941308815009, 6941308816679, 6941308817645, 6941308821291, 6941704404500, 6941704409246, 6941704413298, 6941704413298, 6941704431063, 6941760901463, 6941760904501, 6941760904525, 6942258100368, 6942258100368, 6942333700544, 6942663280808, 6942729400461, 6942729400461, 6942806981999, 6942806982057, 6942806982064, 6942878900157, 6942878900157, 6943345408619, 6943764700011, 6943764700011, 6943764700011, 6943836500464, 6943836500464, 6943836500648, 6943836500648, 6943836501133, 6943836501133, 6943896400025, 6944119500737, 6944119500737, 6944476568111, 6944476568128, 6944978700323, 6945710400020, 6946050106009, 6947174310037, 6947422000628, 6947422000628, 6947929612485, 6947929612515, 6947929612515, 6947929612546, 6947929617145, 6948195821014, 6948195821014, 6948195840244, 6948195841531, 6948797914107, 6948939664303, 6948939666642, 6948960101105, 6948960102447, 6949187398828, 6949190900520, 6949352201403, 6949352201403, 6949352201403, 6949352213444, 6949390830023, 6950155100107, 6950561400174, 6951027300687, 6951027300694, 6952032220120, 6952032220120, 6952032220120, 6952057920029, 6952057920029, 6952096710995, 6952231816537, 6952581460107, 6953042700206, 6953042700220, 6953042700398, 6953260601033, 6953663022275, 6953957901125, 6953957904065, 6953957904843, 6953957905154, 6953957910011, 6954065400388, 6954432710256, 6954436300293, 6954767490403, 6955118000036, 6955329209716, 6955523520167, 6955523520167, 6955887900056, 6955975700858, 6955975700858, 6956159701241, 6956311600122, 6956311600122, 6956311600122, 6956416204584, 6956511918416, 6956511973798, 6956592400206, 6956972700049, 6956972700049, 6957022260605, 6957451300477, 6958216898826, 6958483100042, 6958629902370, 6958938002181, 6959836922038, 6959836922724, 6970081712939, 6970274202681, 6970274204449, 6970315630121, 6970315630657, 6970340650194, 6970399921092, 6970399925878, 6970399925878, 6970443590007, 6970443590007, 6970589250551, 6970589251275, 6970589252593, 6970619840028, 6970623710126, 6970623710126, 6970640429988, 6970645313732, 6970673888127, 6970717330896, 6970770099716, 6970848271181, 6970879980014, 6970879980014, 6970879980199, 6970879980199, 6971057800117, 6971059940019, 6971062710050, 6971062711170, 6971087836179, 6971087836179, 6971126140335, 6971256749057, 6971284204221, 6971317080099, 6971329926057, 6971356940019, 6971356940019, 6971370130298, 6971415832255, 6971517260918, 6971517260925, 6971529860786, 6971561960154, 6971731980265, 6971731980265, 6971738650154, 6971738655388, 6971827491866, 6971827491880, 6971994570319, 6972026720054, 6972068530055, 6972228002316, 6972228003856, 6972235170893, 6972235172040, 6972239314705, 6972303250434, 6972303252667, 6972399920334, 6972754487052, 6972790050005, 6972790050067, 6972790050098, 6972790052733, 6972799491441, 6973169510014, 6973169510021, 6973482400726, 6973497202506, 6973652201603, 6973652201610, 6973652201825, 6974002780687, 6974128540080, 6974497110037, 6974508130573, 6975124570040, 6975176780510, 6975682480225, 8005647005953, 8888077109626, 9421903892317} + +func TestGetJdUpcCodeByUpc(t *testing.T) { + data := make([]string, 0, 0) + for _, v := range upcList { + result, err := api.GetJdUpcCodeByName("", utils.Int64ToStr(v), 1, 1) + if err != nil || len(result) <= 0 || len(result[0].Categories) < 0 { + globals.SugarLogger.Debugf("err := %v", err) + } else { + sql := fmt.Sprintf(`UPDATE sku_name n INNER JOIN sku_vendor_category_map m ON n.id=m.name_id SET n.jd_category_id = %s,m.vendor_category_id = %s WHERE n.upc = %s `, result[0].Categories[0], result[0].Categories[0], utils.Int64ToStr(v)) + sql += ";" + data = append(data, sql) + } + } + + fmt.Println("==============================================================") + for _, v := range data { + fmt.Println(v) + } +} + func TestGetAllCities(t *testing.T) { citys, err := api.GetAllCities() globals.SugarLogger.Debug("=========err %v", err) diff --git a/platformapi/mtwmapi/callback.go b/platformapi/mtwmapi/callback.go index 08e0d4e2..89955176 100644 --- a/platformapi/mtwmapi/callback.go +++ b/platformapi/mtwmapi/callback.go @@ -36,6 +36,8 @@ const ( MsgTypeStoreAuditStatusChanged = "storeAuditStatusChanged" MsgTypeSkuDelete = "skuDelete" MsgTypeStoreBind = "storeBind" + + MsgTypeOrderAgree = "agree" // 同意退款回调 ) type CallbackResponse struct { diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 2fd0db68..968ed372 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_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w + api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nngsVP37s-HXY86xe85H7Q") //token_n4TwqCntWWuvQwAawzxC0w //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r36FEse6_ywebQI65FNNWA") //token_n4TwqCntWWuvQwAawzxC0w cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index a9f8eab4..a50a7b08 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -93,7 +93,7 @@ func TestRetailCatDelete(t *testing.T) { } func TestRetailList(t *testing.T) { - result, err := api.RetailList("18900165", 2100, 100) + result, err := api.RetailList("18900165", 1, 100) if err != nil { t.Fatal(err) }