From 7cab73150ba3f41fe9f6cb4eac5f69a8da0448de Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 14 May 2024 20:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=A4=9A=E5=A4=9A=E8=81=94=E7=9B=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/cps_pdd/order.go | 61 +++++++++++++++++++++++++++++++++++++++++++++ pdd_union/order.go | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 md/cps_pdd/order.go create mode 100644 pdd_union/order.go diff --git a/md/cps_pdd/order.go b/md/cps_pdd/order.go new file mode 100644 index 0000000..d3e2d13 --- /dev/null +++ b/md/cps_pdd/order.go @@ -0,0 +1,61 @@ +package cps_pdd + +type CpsPddOrder struct { + OrderListGetResponse struct { + OrderList []struct { + ActivityTags []int `json:"activity_tags"` + AuthDuoId int `json:"auth_duo_id"` + BandanRiskConsult int `json:"bandan_risk_consult"` + BatchNo string `json:"batch_no"` + CashGiftId int `json:"cash_gift_id"` + CatIds []int `json:"cat_ids"` + CpaNew int `json:"cpa_new"` + CustomParameters string `json:"custom_parameters"` + FailReason string `json:"fail_reason"` + GoodsCategoryName string `json:"goods_category_name"` + GoodsId int `json:"goods_id"` + GoodsName string `json:"goods_name"` + GoodsPrice int `json:"goods_price"` + GoodsQuantity int `json:"goods_quantity"` + GoodsSign string `json:"goods_sign"` + GoodsThumbnailUrl string `json:"goods_thumbnail_url"` + GroupId int `json:"group_id"` + IsDirect int `json:"is_direct"` + MallId int `json:"mall_id"` + MallName string `json:"mall_name"` + NoSubsidyReason string `json:"no_subsidy_reason"` + OrderAmount int `json:"order_amount"` + OrderCreateTime int `json:"order_create_time"` + OrderGroupSuccessTime int `json:"order_group_success_time"` + OrderModifyAt int `json:"order_modify_at"` + OrderPayTime int `json:"order_pay_time"` + OrderReceiveTime int `json:"order_receive_time"` + OrderSettleTime int `json:"order_settle_time"` + OrderSn string `json:"order_sn"` + OrderStatus int `json:"order_status"` + OrderStatusDesc string `json:"order_status_desc"` + OrderVerifyTime int `json:"order_verify_time"` + PId string `json:"p_id"` + PlatformDiscount int `json:"platform_discount"` + PriceCompareStatus int `json:"price_compare_status"` + PromotionAmount int `json:"promotion_amount"` + PromotionRate int `json:"promotion_rate"` + RedPacketType int `json:"red_packet_type"` + SceneAtMarketFee int `json:"scene_at_market_fee"` + SepDuoId int `json:"sep_duo_id"` + SepMarketFee int `json:"sep_market_fee"` + SepParameters string `json:"sep_parameters"` + SepPid string `json:"sep_pid"` + SepRate int `json:"sep_rate"` + ShareAmount int `json:"share_amount"` + ShareRate int `json:"share_rate"` + SubsidyAmount int `json:"subsidy_amount"` + SubsidyDuoAmountLevel int `json:"subsidy_duo_amount_level"` + SubsidyDuoAmountTenMillion int `json:"subsidy_duo_amount_ten_million"` + SubsidyType int `json:"subsidy_type"` + Type int `json:"type"` + ZsDuoId int `json:"zs_duo_id"` + } `json:"order_list"` + TotalCount int `json:"total_count"` + } `json:"order_list_get_response"` +} diff --git a/pdd_union/order.go b/pdd_union/order.go new file mode 100644 index 0000000..83822fc --- /dev/null +++ b/pdd_union/order.go @@ -0,0 +1,45 @@ +package pdd_union + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md/cps_pdd" + zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" + "encoding/json" + "strings" +) + +func GetOrder(keyArr map[string]string, param map[string]interface{}) []map[string]string { + send, _ := Send(keyArr, "pdd.ddk.all.order.list.increment.get", param) + var res cps_pdd.CpsPddOrder + json.Unmarshal([]byte(send), &res) + var data = make([]map[string]string, 0) + for _, v := range res.OrderListGetResponse.OrderList { + if v.OrderStatus == -1 { + continue + } + tmp := map[string]string{} + tmp["check_success_time"] = zhios_third_party_utils.IntToStr(v.OrderVerifyTime) + tmp["oid"] = v.OrderSn + tmp["gid"] = v.GoodsSign + tmp["goods_title"] = v.GoodsName + tmp["commission"] = zhios_third_party_utils.Float64ToStr(float64(v.PromotionAmount) / 100) + tmp["commission_rate"] = zhios_third_party_utils.Float64ToStr(float64(v.PromotionRate) / 10) + tmp["goods_price"] = zhios_third_party_utils.Float64ToStr(float64(v.GoodsPrice) / 100) + tmp["payment"] = zhios_third_party_utils.Float64ToStr(float64(v.OrderAmount) / 100) + tmp["goods_img"] = v.GoodsThumbnailUrl + tmp["goods_num"] = zhios_third_party_utils.IntToStr(v.GoodsQuantity) + tmp["create_time"] = zhios_third_party_utils.IntToStr(v.OrderCreateTime) + tmp["payment_time"] = zhios_third_party_utils.IntToStr(v.OrderPayTime) + tmp["update_time"] = zhios_third_party_utils.IntToStr(v.OrderModifyAt) + tmp["status_str"] = v.OrderStatusDesc + tmp["pdd_pid"] = v.PId + tmp["fail_status"] = v.FailReason + tmp["custom_parameters"] = v.CustomParameters + tmp["status_str"] = v.OrderStatusDesc + tmp["ord_type"] = "0" + if strings.Contains(v.FailReason, "比价") || v.PriceCompareStatus == 1 { + tmp["ord_type"] = "1" + } + data = append(data, tmp) + } + return data +}