This commit is contained in:
邹宗楠
2023-08-19 10:50:15 +08:00
parent 018308ce61
commit 5cb97fb787
4 changed files with 29 additions and 7 deletions

View File

@@ -764,6 +764,11 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
if intVendorSkuID != 0 && v.VendorSkuID != "-70000" { // todo hard code
skuBindInfo := skumapper[v.VendorSkuID]
if skuBindInfo == nil {
// 商品直接在美团创建,本地不存在商品信息,且为美团商品.如果门店是报价门店则获取商品的进货价
//if v.ShopPrice == model.NO && v.VendorID == model.VendorIDMTWM && order.OrderPayPercentage >= 50 {
//
//}
if v.ShopPrice == 0 {
v.ShopPrice = v.SalePrice * 70 / 100
}

View File

@@ -717,12 +717,21 @@ func (c *OrderManager) GetLogisticsOrderStatusList(orderId, LogisticsId string,
func (c *OrderManager) GetWayBillStatusList(orderId, LogisticsId string, vendorId int) ([]*model.OrderStatus, error) {
sql := `SELECT *
FROM order_status t1
WHERE t1.vendor_order_id = ? AND t1.ref_vendor_order_id = ? AND t1.vendor_id = ?`
sqlParams := []interface{}{
LogisticsId,
orderId,
vendorId,
WHERE 1=1 `
sqlParams := make([]interface{}, 0, 0)
if LogisticsId != "" {
sql += ` AND t1.vendor_order_id = ? `
sqlParams = append(sqlParams, LogisticsId)
}
if orderId != "" {
sql += ` AND t1.ref_vendor_order_id = ? `
sqlParams = append(sqlParams, orderId)
}
if vendorId != 0 {
sql += ` AND t1.vendor_id = ? `
sqlParams = append(sqlParams, vendorId)
}
sql += ` ORDER BY status_time ASC `
var result []*model.OrderStatus
if err := dao.GetRows(dao.GetDB(), &result, sql, sqlParams...); err != nil {

View File

@@ -900,6 +900,14 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
}
}
// 获取配送记录,
statusList, _ := orderman.FixedOrderManager.GetWayBillStatusList(order.VendorOrderID, order.VendorOrderID, 0)
for _, v := range statusList {
if v.Status == model.OrderStatusMsg && utils.Str2Int64WithDefault(v.VendorStatus, 0) != model.NO {
excludeVendorIDs = append(excludeVendorIDs, utils.Str2Int(v.VendorStatus))
}
}
//2020-11-16 预计收益-配送费 > 0 再发
if order.EarningType == model.EarningTypeQuote {
for _, vendorID := range waybillVendorIDs {
@@ -985,7 +993,7 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
if _, err = s.CreateWaybillOnProviders4SavedOrder(jxcontext.AdminCtx, savedOrderInfo, nil, excludeVendorIDs, false, maxDeliveryFee); err == nil {
savedOrderInfo.retryCount++
} else {
partner.CurOrderManager.OnOrderMsg(order, fmt.Sprintf("发起自动创建三方运单,目标创建运单平台[%s],创建失败:%v", jxutils.GetVendorName(vendorID), err), "")
partner.CurOrderManager.OnOrderMsg(order, utils.Int2Str(vendorID), fmt.Sprintf("发起自动创建三方运单,目标创建运单平台[%s],创建失败:%v", jxutils.GetVendorName(vendorID), err))
//content := "您的门店 [" + storeDetail.Name + "]OrderID:[" + order.VendorOrderID + "],自动呼叫骑手失败[" + fmt.Sprintf(err.Error()) + "],请手动呼叫骑手"
//if user, err := dao.GetUserByID(dao.GetDB(), "mobile", storeDetail.MarketManPhone); err == nil {
// ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)

View File

@@ -21,7 +21,7 @@ type StoreDetail struct {
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
VendorStoreName string `json:"vendorStoreName"`
VendorStatus int `json:"vendor_status"` // 取值同Store.Status
VendorPayPercentage int `json:"vendorPayPercentage"` //平台结算比例
VendorPayPercentage int `json:"vendorPayPercentage"` //平台结算比例,大于50是报价门店
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"`
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"`
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`