Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -79,21 +79,22 @@ var (
|
|||||||
"19:00:00",
|
"19:00:00",
|
||||||
"22:00:00",
|
"22:00:00",
|
||||||
}
|
}
|
||||||
|
// 七牛云流量检查
|
||||||
ChangeStoreSkuSaleStatusList = []string{
|
ChangeStoreSkuSaleStatusList = []string{
|
||||||
"7:00:00",
|
//"7:00:00",
|
||||||
"8:00:00",
|
//"8:00:00",
|
||||||
"9:00:00",
|
//"9:00:00",
|
||||||
//"10:00:00",
|
/* //"10:00:00",
|
||||||
//"11:00:00",
|
//"11:00:00",
|
||||||
//"12:00:00",
|
//"12:00:00",
|
||||||
//"13:00:00",
|
//"13:00:00",
|
||||||
//"14:00:00",
|
//"14:00:00",
|
||||||
//"15:00:00",
|
//"15:00:00",
|
||||||
//"16:00:00",
|
//"16:00:00",
|
||||||
//"17:00:00",
|
//"17:00:00",
|
||||||
//"18:00:00",
|
//"18:00:00",
|
||||||
//"19:00:00",
|
//"19:00:00",
|
||||||
//"20:00:00",
|
//"20:00:00",*/
|
||||||
}
|
}
|
||||||
openRemoteStoreTimeList = []string{
|
openRemoteStoreTimeList = []string{
|
||||||
"04:30:00",
|
"04:30:00",
|
||||||
@@ -333,9 +334,9 @@ func Init() {
|
|||||||
}, updateActStatusTimeList)
|
}, updateActStatusTimeList)
|
||||||
ScheduleScoreStore()
|
ScheduleScoreStore()
|
||||||
// ScheduleCheckStoreAlert()
|
// ScheduleCheckStoreAlert()
|
||||||
ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
//ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
||||||
cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, 0, true, true)
|
// cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, 0, true, true)
|
||||||
}, ChangeStoreSkuSaleStatusList)
|
//}, ChangeStoreSkuSaleStatusList)
|
||||||
ScheduleTimerFunc("BeginSavePriceRefer", func() {
|
ScheduleTimerFunc("BeginSavePriceRefer", func() {
|
||||||
report.BeginSavePriceRefer(jxcontext.AdminCtx, nil, nil, true, true)
|
report.BeginSavePriceRefer(jxcontext.AdminCtx, nil, nil, true, true)
|
||||||
}, priceReferTimeList)
|
}, priceReferTimeList)
|
||||||
|
|||||||
@@ -123,13 +123,30 @@ func (c *PurchaseHandler) onAfsOrderMsg(msgId string, msg interface{}) (retVal *
|
|||||||
err = partner.CurOrderManager.OnAfsOrderNew(afsOrder, orderStatus)
|
err = partner.CurOrderManager.OnAfsOrderNew(afsOrder, orderStatus)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err = partner.CurOrderManager.OnAfsOrderStatusChanged(orderStatus)
|
if err2 := partner.CurOrderManager.OnAfsOrderStatusChanged(orderStatus); err2 == nil {
|
||||||
if err == nil && msgId == tiktokShop.CallbackReturnRefundAgreedMsgTagId {
|
if msgId == tiktokShop.CallbackRefundOrderSuccessMsgTagId {
|
||||||
goodsOrder, _ := partner.CurOrderManager.LoadOrder(orderStatus.RefVendorOrderID, orderStatus.VendorID)
|
skuList, _ := dao.GetSimpleOrderSkus(db, orderStatus.RefVendorOrderID, nil)
|
||||||
goodsOrder.Status = model.OrderStatusCanceled
|
totalSkuCount := 0
|
||||||
goodsOrder.VendorStatus = orderStatus.VendorStatus
|
for _, v := range skuList {
|
||||||
dao.UpdateEntity(db, goodsOrder, "Status", "VendorStatus")
|
totalSkuCount += v.Count
|
||||||
|
}
|
||||||
|
|
||||||
|
financialSku, _ := dao.GetOrderRefundSkuList(db, []string{orderStatus.RefVendorOrderID})
|
||||||
|
refundSkuCount := 0
|
||||||
|
for _, v := range financialSku {
|
||||||
|
refundSkuCount += v.Count
|
||||||
|
}
|
||||||
|
if totalSkuCount == refundSkuCount {
|
||||||
|
goodsOrder, _ := partner.CurOrderManager.LoadOrder(orderStatus.RefVendorOrderID, orderStatus.VendorID)
|
||||||
|
goodsOrder.Status = model.OrderStatusCanceled
|
||||||
|
goodsOrder.VendorStatus = orderStatus.VendorStatus
|
||||||
|
dao.UpdateEntity(db, goodsOrder, "Status", "VendorStatus")
|
||||||
|
// 取消三方运单
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tiktokShop.Err2CallbackResponse(err, "")
|
return tiktokShop.Err2CallbackResponse(err, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user