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