暂时不拉银豹,京东订单修改
This commit is contained in:
@@ -417,7 +417,7 @@ func doDailyWork() {
|
|||||||
//刷新物料订单状态
|
//刷新物料订单状态
|
||||||
localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx)
|
localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx)
|
||||||
//同步银豹到京西
|
//同步银豹到京西
|
||||||
cms.CurVendorSync.SyncStoreSkusFromYb(jxcontext.AdminCtx, nil, true, true)
|
// cms.CurVendorSync.SyncStoreSkusFromYb(jxcontext.AdminCtx, nil, true, true)
|
||||||
//刷新京东商城订单结算价
|
//刷新京东商城订单结算价
|
||||||
orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -3).Format("20060102"), time.Now().Format("20060102"))
|
orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -3).Format("20060102"), time.Now().Format("20060102"))
|
||||||
//同步上架京东商城待售商品
|
//同步上架京东商城待售商品
|
||||||
|
|||||||
@@ -125,18 +125,32 @@ func (c *PurchaseHandler) OnOrderInfoChangeMsg(vendorOrgCode string, msg *jdapi.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) onOrderInfoChangeMsg(vendorOrgCode string, msg *jdapi.CallbackOrderInfoChangeMsg) (retVal *jdapi.CallbackResponse) {
|
func (c *PurchaseHandler) onOrderInfoChangeMsg(vendorOrgCode string, msg *jdapi.CallbackOrderInfoChangeMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
a := getAPI(vendorOrgCode)
|
|
||||||
order, _, err := c.getOrder(a, msg.BillID)
|
|
||||||
if err == nil {
|
|
||||||
globals.SugarLogger.Debugf("onOrderInfoChangeMsg orderID:%s", msg.BillID)
|
|
||||||
orderInfoChangeSet(order, msg)
|
|
||||||
globals.SugarLogger.Debugf("onOrderInfoChangeMsg2: %v", order)
|
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
|
order, err := dao.GetSimpleOrder(db, msg.BillID)
|
||||||
|
if err == nil {
|
||||||
|
globals.SugarLogger.Debugf("onOrderInfoChangeMsg msg:%v", utils.Format4Output(msg, false))
|
||||||
|
if msg.BuyerFullAddress != "" {
|
||||||
|
order.ConsigneeAddress = msg.BuyerFullAddress
|
||||||
|
}
|
||||||
|
if msg.BuyerFullName != "" {
|
||||||
|
order.ConsigneeName = msg.BuyerFullName
|
||||||
|
}
|
||||||
|
if msg.BuyerMobile != "" {
|
||||||
|
order.ConsigneeMobile = msg.BuyerMobile
|
||||||
|
}
|
||||||
|
if msg.BuyerLat != "" {
|
||||||
|
order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat))
|
||||||
|
}
|
||||||
|
if msg.BuyerLng != "" {
|
||||||
|
order.ConsigneeLng = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng))
|
||||||
|
}
|
||||||
|
if msg.OrderBuyerRemark != "" {
|
||||||
|
order.BuyerComment = msg.OrderBuyerRemark
|
||||||
|
}
|
||||||
_, err = dao.UpdateEntity(db, order, "ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeLat", "ConsigneeLng", "BuyerComment")
|
_, err = dao.UpdateEntity(db, order, "ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeLat", "ConsigneeLng", "BuyerComment")
|
||||||
weixinmsg.NotifyOrderChanged(order)
|
weixinmsg.NotifyOrderChanged(order)
|
||||||
// partner.CurOrderManager.ChangeOrderInfo(order)
|
|
||||||
}
|
}
|
||||||
return retVal
|
return jdapi.SuccessResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateOrderBySettleMent(order *model.GoodsOrder, orderSettlement *jdapi.OrderSettlementInfo) {
|
func updateOrderBySettleMent(order *model.GoodsOrder, orderSettlement *jdapi.OrderSettlementInfo) {
|
||||||
@@ -579,24 +593,3 @@ func (c *PurchaseHandler) ConfirmSelfTake(ctx *jxcontext.Context, order *model.G
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func orderInfoChangeSet(order *model.GoodsOrder, msg *jdapi.CallbackOrderInfoChangeMsg) {
|
|
||||||
if msg.BuyerFullAddress != "" {
|
|
||||||
order.ConsigneeAddress = msg.BuyerFullAddress
|
|
||||||
}
|
|
||||||
if msg.BuyerFullName != "" {
|
|
||||||
order.ConsigneeName = msg.BuyerFullName
|
|
||||||
}
|
|
||||||
if msg.BuyerMobile != "" {
|
|
||||||
order.ConsigneeMobile = msg.BuyerMobile
|
|
||||||
}
|
|
||||||
if msg.BuyerLat != "" {
|
|
||||||
order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat))
|
|
||||||
}
|
|
||||||
if msg.BuyerLng != "" {
|
|
||||||
order.ConsigneeLng = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng))
|
|
||||||
}
|
|
||||||
if msg.OrderBuyerRemark != "" {
|
|
||||||
order.BuyerComment = msg.OrderBuyerRemark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ var (
|
|||||||
sensitiveWordRegexp = regexp.MustCompile(`商品名称中含有敏感词(\[.*\])`)
|
sensitiveWordRegexp = regexp.MustCompile(`商品名称中含有敏感词(\[.*\])`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
addErr1 = "商品已存在"
|
||||||
|
)
|
||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
if globals.EnableYbStoreWrite {
|
if globals.EnableYbStoreWrite {
|
||||||
storeSku := storeSkuList[0]
|
storeSku := storeSkuList[0]
|
||||||
@@ -34,6 +38,14 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
|||||||
result, err = api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
result, err = api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// if strings.Contains(err.Error(), addErr1) {
|
||||||
|
// queryProductByBarcodeResult, err := api.YinBaoAPI.QueryProductByBarcodes([]string{storeSku.YbBarCode})
|
||||||
|
// if err != nil && len(queryProductByBarcodeResult) > 0 {
|
||||||
|
// if queryProductByBarcodeResult[0].Enable == model.SkuStatusDeleted {
|
||||||
|
// api.YinBaoAPI.SaveProduct(userId, keyword, saveProductParam)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
||||||
} else {
|
} else {
|
||||||
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
|
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
|
||||||
|
|||||||
@@ -216,7 +216,6 @@ func (c *DjswController) UpdateSku() {
|
|||||||
func (c *DjswController) OrderAddTips() {
|
func (c *DjswController) OrderAddTips() {
|
||||||
c.orderStatus()
|
c.orderStatus()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DjswController) OrderInfoChange() {
|
func (c *DjswController) OrderInfoChange() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
|
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
|
||||||
|
|||||||
Reference in New Issue
Block a user