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",
|
||||
"22:00:00",
|
||||
}
|
||||
// 七牛云流量检查
|
||||
ChangeStoreSkuSaleStatusList = []string{
|
||||
"7:00:00",
|
||||
"8:00:00",
|
||||
"9:00:00",
|
||||
//"10:00:00",
|
||||
//"11:00:00",
|
||||
//"12:00:00",
|
||||
//"13:00:00",
|
||||
//"14:00:00",
|
||||
//"15:00:00",
|
||||
//"16:00:00",
|
||||
//"17:00:00",
|
||||
//"18:00:00",
|
||||
//"19:00:00",
|
||||
//"20:00:00",
|
||||
//"7:00:00",
|
||||
//"8:00:00",
|
||||
//"9:00:00",
|
||||
/* //"10:00:00",
|
||||
//"11:00:00",
|
||||
//"12:00:00",
|
||||
//"13:00:00",
|
||||
//"14:00:00",
|
||||
//"15:00:00",
|
||||
//"16:00:00",
|
||||
//"17:00:00",
|
||||
//"18:00:00",
|
||||
//"19:00:00",
|
||||
//"20:00:00",*/
|
||||
}
|
||||
openRemoteStoreTimeList = []string{
|
||||
"04:30:00",
|
||||
@@ -333,9 +334,9 @@ func Init() {
|
||||
}, updateActStatusTimeList)
|
||||
ScheduleScoreStore()
|
||||
// ScheduleCheckStoreAlert()
|
||||
ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
||||
cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, 0, true, true)
|
||||
}, ChangeStoreSkuSaleStatusList)
|
||||
//ScheduleTimerFunc("ChangeStoreSkuSaleStatus", func() {
|
||||
// cms.CurVendorSync.ChangeStoreSkuSaleStatus(jxcontext.AdminCtx, 0, true, true)
|
||||
//}, ChangeStoreSkuSaleStatusList)
|
||||
ScheduleTimerFunc("BeginSavePriceRefer", func() {
|
||||
report.BeginSavePriceRefer(jxcontext.AdminCtx, nil, nil, true, true)
|
||||
}, priceReferTimeList)
|
||||
|
||||
@@ -123,13 +123,30 @@ func (c *PurchaseHandler) onAfsOrderMsg(msgId string, msg interface{}) (retVal *
|
||||
err = partner.CurOrderManager.OnAfsOrderNew(afsOrder, orderStatus)
|
||||
}
|
||||
} else {
|
||||
err = partner.CurOrderManager.OnAfsOrderStatusChanged(orderStatus)
|
||||
if err == nil && msgId == tiktokShop.CallbackReturnRefundAgreedMsgTagId {
|
||||
goodsOrder, _ := partner.CurOrderManager.LoadOrder(orderStatus.RefVendorOrderID, orderStatus.VendorID)
|
||||
goodsOrder.Status = model.OrderStatusCanceled
|
||||
goodsOrder.VendorStatus = orderStatus.VendorStatus
|
||||
dao.UpdateEntity(db, goodsOrder, "Status", "VendorStatus")
|
||||
if err2 := partner.CurOrderManager.OnAfsOrderStatusChanged(orderStatus); err2 == nil {
|
||||
if msgId == tiktokShop.CallbackRefundOrderSuccessMsgTagId {
|
||||
skuList, _ := dao.GetSimpleOrderSkus(db, orderStatus.RefVendorOrderID, nil)
|
||||
totalSkuCount := 0
|
||||
for _, v := range skuList {
|
||||
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, "")
|
||||
|
||||
Reference in New Issue
Block a user