Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -2,6 +2,7 @@ package bidding
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/ascription_place"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -101,3 +102,30 @@ func QueryNeedDeleteSku() string {
|
|||||||
fmt.Println("dd2 ", len(dd))
|
fmt.Println("dd2 ", len(dd))
|
||||||
return strings.Join(dd, ",")
|
return strings.Join(dd, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdateTiktokOrderPhoneAddress() error {
|
||||||
|
var goodsOrder []*model.GoodsOrder
|
||||||
|
var db = dao.GetDB()
|
||||||
|
sql := `SELECT * FROM goods_order WHERE order_created_at >= "2023-02-01 00:00:00" AND vendor_id = "14" ORDER BY order_created_at DESC`
|
||||||
|
if err := dao.GetRows(db, &goodsOrder, sql, nil); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range goodsOrder {
|
||||||
|
if v.PhoneAscription != "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ascription, err := ascription_place.Find(v.ConsigneeMobile)
|
||||||
|
if err != nil {
|
||||||
|
v.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + err.Error()
|
||||||
|
} else {
|
||||||
|
if strings.Contains(v.ConsigneeAddress, ascription.Province) && strings.Contains(v.ConsigneeAddress, ascription.City) {
|
||||||
|
v.PhoneAscription = model.PhoneAscriptionAddressYes + "-" + ascription.Province + ascription.City
|
||||||
|
} else {
|
||||||
|
v.PhoneAscription = model.PhoneAscriptionAddressNo + "-" + "归属信息不匹配:" + ascription.Province + ascription.City
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dao.UpdateEntity(db, v, "PhoneAscription")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
orderSettlement, _ := getAPI(order.VendorOrgCode).OrderShoudSettlementService2(order.VendorOrderID)
|
orderSettlement, _ := getAPI(order.VendorOrgCode).OrderShoudSettlementService2(order.VendorOrderID)
|
||||||
UpdateOrderBySettleMent(order, orderSettlement)
|
UpdateOrderBySettleMent(order, orderSettlement)
|
||||||
err = partner.CurOrderManager.UpdateOrderFields(order, []string{"NewEarningPrice"})
|
err = partner.CurOrderManager.UpdateOrderFields(order, []string{"NewEarningPrice", "TotalShopMoney"})
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,3 +95,16 @@ func (c *BiddingController) NeedDeleteGetStoreBindStatus() {
|
|||||||
return dd, "", nil
|
return dd, "", nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateTiktokOrderPhoneAddress 更新抖音电话归属地
|
||||||
|
// @Title 更新抖音电话归属地
|
||||||
|
// @Description 更新抖音电话归属地
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /UpdateTiktokOrderPhoneAddress [get]
|
||||||
|
func (c *BiddingController) UpdateTiktokOrderPhoneAddress() {
|
||||||
|
c.callUpdateTiktokOrderPhoneAddress(func(params *tBindUpdateTiktokOrderPhoneAddressParams) (interface{}, string, error) {
|
||||||
|
err := bidding.UpdateTiktokOrderPhoneAddress()
|
||||||
|
return nil, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -4215,6 +4215,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:BiddingController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "UpdateTiktokOrderPhoneAddress",
|
||||||
|
Router: `/UpdateTiktokOrderPhoneAddress`,
|
||||||
|
AllowHTTPMethods: []string{"get"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
// 版本设置
|
// 版本设置
|
||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:VersionController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
|
|||||||
Reference in New Issue
Block a user