1
This commit is contained in:
@@ -90,14 +90,12 @@ func AutoSettingFakeDelivery() {
|
||||
globals.SugarLogger.Errorf("newConfig 刷单门店设置异常")
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("======configList : %s", utils.Format4Output(configList, false))
|
||||
|
||||
// 获取刷单门店订单
|
||||
storeList := strings.Split(configList[0].Value, ",")
|
||||
for _, v := range storeList {
|
||||
storeIdAndVendorId := strings.Split(v, "-")
|
||||
orderList, err := dao.GetOrderListByStoreList(db, []int64{utils.Str2Int64(storeIdAndVendorId[0])}, utils.Str2Int(storeIdAndVendorId[1]))
|
||||
globals.SugarLogger.Debugf("======orderList : %s", utils.Format4Output(orderList, false))
|
||||
if err != nil {
|
||||
globals.SugarLogger.Errorf("获取门店刷单记录错误")
|
||||
continue
|
||||
@@ -125,7 +123,6 @@ func AutoSettingFakeDelivery() {
|
||||
riderKey = strings.Split(place.Name, "市")[0]
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("======riderKey : %s", utils.Format4Output(riderKey, false))
|
||||
|
||||
for _, v := range orderList {
|
||||
if len(riderListInfo[riderKey]) == model.NO {
|
||||
|
||||
@@ -203,12 +203,12 @@ func Init() {
|
||||
"09:35:00",
|
||||
})
|
||||
|
||||
// 每分钟轮询一次,推送抖店骑手信息
|
||||
// 每分钟轮询一次,推送骑手信息
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
delivery.UpdateFakeWayBillToTiktok()
|
||||
}, 10*time.Second, 5*time.Second)
|
||||
|
||||
// 抖音自动刷单(自动发单拣货,设置骑手)
|
||||
// (自动发单拣货,设置骑手)
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
auto_delivery.AutoSettingFakeDelivery()
|
||||
}, 10*time.Second, 3*time.Minute)
|
||||
|
||||
@@ -292,7 +292,7 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierAssigned)
|
||||
case 12: // 骑手接单
|
||||
riderInfo.LogisticsContext = model.RiderWaitGetGoods
|
||||
riderInfo.LogisticsStatus = 12
|
||||
riderInfo.LogisticsStatus = 10
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsORDERRECEIVED
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusCourierArrived
|
||||
@@ -324,7 +324,7 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateFakeWayBillToTiktok 轮询更新假订单到抖音
|
||||
// UpdateFakeWayBillToTiktok 轮询更新假订单到抖音(抖音/美团/饿百)
|
||||
func UpdateFakeWayBillToTiktok() {
|
||||
scheduleTimer, _ := rand.Int(rand.Reader, big.NewInt(1000))
|
||||
randTimeSchedule := scheduleTimer.Int64()
|
||||
@@ -362,7 +362,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
if riderInfo.LogisticsContext != model.RiderGetOrderDeliverFailed && riderInfo.LogisticsContext != model.RiderGetOrderDeliverOther && riderInfo.LogisticsContext != model.RiderWaitRider {
|
||||
riderInfo.LogisticsContext = fmt.Sprintf(riderInfo.LogisticsContext, riderInfo.CourierName, riderInfo.CourierPhone)
|
||||
}
|
||||
|
||||
|
||||
// 推送骑手信息
|
||||
paramsMap := utils.Struct2Map(riderInfo, "", true)
|
||||
handler := partner.GetPurchaseOrderHandlerFromVendorID(fakeWayBill[i].OrderVendorID)
|
||||
@@ -401,7 +401,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
globals.SugarLogger.Debugf("UPDATA goods_order Err :%s", err.Error())
|
||||
}
|
||||
// 饿百订单推送订单送达
|
||||
if fakeWayBill[i].OrderVendorID == model.VendorIDEBAI {
|
||||
if fakeWayBill[i].OrderVendorID == model.VendorIDEBAI || fakeWayBill[i].OrderVendorID == model.VendorIDMTWM {
|
||||
if err := handler.Swtich2SelfDelivered(order, "JingXiAdmin"); err != nil {
|
||||
globals.SugarLogger.Errorf("Swtich2SelfDelivered err := %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user