This commit is contained in:
邹宗楠
2025-09-17 15:58:38 +08:00
parent c303ba3a11
commit 3a5063f8f9
3 changed files with 19 additions and 6 deletions

View File

@@ -29,13 +29,13 @@ func init() {
// api = New("62289", "d3ec2358d6a819ea")
// 京西菜市
api = New("34665", "c3db75b754ea2d89")
//api = New("34665", "c3db75b754ea2d89")
//菜市测试
// api = New("62923", "aa4cdc6c1108486b")
// 京西果园
//api = New("35957", "10013fbb7c2ddad7")
api = New("35957", "10013fbb7c2ddad7")
// api.SetCookie("PASSPORT_DELIMONT_TOKEN", "PBE_2.0_5cd1c6141c127d4188f026ac01fc93656266683e8dfb3127c2fdf894259e9034125ff3bdd2a997a385802ee3ef1802ba93a04acea34fde2d2b6e802c5dcd4ec6e3f4ad909a1d806e3ceeb349ed726b03d60ed1fe7010d4140aa338d9c5f05e3fec172c78d3d7f0ca579d61b7015af1bf99aa46b04d2b8a64aa50646dc09afe94b6b60e0ba9a933635db5e8b2a035e9b6d693b289acf1b256d5b9a3f8478c87b0b009115bfd1394f20bb5a0dc2c07b8d013a25f286ec6bf7f2d86010d65507e31358834b7a6b58fbd88cb3f1a12cf71c997b91c1527f6f3c10693f7c2bd6073da8633a98cd2dc1114dfa5be5ee0e60b02cf7e4a94d0fb563a8c01717e7c050f02249117219c07a2eb211577c208ba77f4d536fa25139bc249be93b38d6fc495ef67a32aa206835d177db402bc534de1d29caf4f6b4fbcd912c13f167d00d1732222744c336a5189728f72fb5e153c4b1164171cfb0c811f34f4c2fedd43f721b8706b43f8d631251c")
//api.SetCookie("WMUSS", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ")
//api.SetCookie("WMSTOKEN", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ")

View File

@@ -40,9 +40,22 @@ func TestSendMsg(t *testing.T) {
}
func TestInvoice(t *testing.T) {
api.QueryInvoiceSetting([]string{"1306214718"})
_, err := api.QueryInvoiceSetting([]string{"1298742562"})
fmt.Println(err)
}
func TestQueryUnansweredInvoice(t *testing.T) {
api.QueryUnansweredInvoice("1306214718")
}
func TestBathUpdateInvoiceSetting(t *testing.T) {
api.BathUpdateInvoiceSetting("1298742562", &StoreInvoiceSetting{
InvoiceMaterial: "ELECTRONIC",
InvoiceClass: "VAT_COMMON",
InvoiceContact: struct {
Person string `json:"person"`
Phone string `json:"phone"`
}{Person: "老板", Phone: "15020067079"},
InvoiceMode: "SYS_MANUAL",
})
}

View File

@@ -117,7 +117,7 @@ type SellerInfo struct {
func (a *API) QueryInvoiceSetting(baiduShopId []string) ([]*SettingList, error) {
parameter := make([]*StoreIdList, 0, len(baiduShopId))
for _, v := range baiduShopId {
parameter = append(parameter, &StoreIdList{BaiDuShopId: v})
parameter = append(parameter, &StoreIdList{BaiDuShopId: v, ShopId: "5000061"})
}
data, err := a.AccessAPI("invoice.settings.list", map[string]interface{}{"shop_list": parameter})
@@ -170,12 +170,12 @@ func (a *API) BathUpdateInvoiceSetting(baiDuStoreId string, setting *StoreInvoic
failList := make([]*ResultList, 0, 0)
respList := data.Data.(map[string]interface{})
if respList["success_shop_list"] != nil {
if err = utils.UnmarshalUseNumber(utils.MustMarshal(respList["success_shop_list"]), successList); err != nil {
if err = utils.UnmarshalUseNumber(utils.MustMarshal(respList["success_shop_list"]), &successList); err != nil {
return nil, nil, err
}
}
if respList["failed_shop_list"] != nil {
if err = utils.UnmarshalUseNumber(utils.MustMarshal(respList["failed_shop_list"]), failList); err != nil {
if err = utils.UnmarshalUseNumber(utils.MustMarshal(respList["failed_shop_list"]), &failList); err != nil {
return nil, nil, err
}
}