This commit is contained in:
邹宗楠
2023-03-03 15:08:30 +08:00
parent a9416695ba
commit 6407af6136
6 changed files with 21 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ func Init() {
return
}
for _, v := range []string{"四川", "广东", "西", "重庆"} {
for _, v := range []string{"四川", "广东", "西", "重庆"} {
if _, ok := list[v]; ok && len(list[v]) >= 200 {
continue
}
@@ -95,7 +95,12 @@ func AutoSettingFakeDelivery() {
for _, v := range orderList {
jxutils.CallMsgHandler(func() {
// 1.根据订单客户地址获取骑手列表
riderKey := strings.Split(v.ConsigneeAddress, "省")[0]
riderKey := ""
if strings.Contains(v.ConsigneeAddress, "重庆") || strings.Contains(v.ConsigneeAddress, "上海") || strings.Contains(v.ConsigneeAddress, "北京") {
riderKey = strings.Split(v.ConsigneeAddress, "市")[0]
} else {
riderKey = strings.Split(v.ConsigneeAddress, "省")[0]
}
if len(riderListInfo[riderKey]) == model.NO {
// 骑手列表
configRiderList, err := dao.QueryConfigs(db, "riderList", "AutoRiderList", "")
@@ -127,6 +132,7 @@ func AutoSettingFakeDelivery() {
}
//自动发单
for riderName, riderPhone := range riderListInfo[riderKey][randTime] {
globals.SugarLogger.Debugf("SelfDeliveringAndUpdateStatus : %s", v.VendorOrderID)
if err := defsch.FixedScheduler.SelfDeliveringAndUpdateStatus(jxcontext.AdminCtx, v.VendorOrderID, v.VendorID, jxcontext.AdminCtx.GetUserName(), riderName, riderPhone); err != nil {
globals.SugarLogger.Errorf("自动发货错误:[%v]", err)
return