Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -2,11 +2,10 @@ package basesch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
@@ -35,9 +34,11 @@ func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, order *
|
||||
courierVendorIDMap := jxutils.IntList2Map(courierVendorIDs)
|
||||
excludeCourierVendorIDMap := jxutils.IntList2Map(excludeCourierVendorIDs)
|
||||
errList := errlist.New()
|
||||
globals.SugarLogger.Debugf("===excludeCourierVendorIDMap===========:%s", utils.Format4Output(excludeCourierVendorIDMap, false))
|
||||
|
||||
store, _ := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
|
||||
for _, storeCourier := range storeCourierList {
|
||||
globals.SugarLogger.Debugf("===excludeCourierVendorIDMap===========:%s", utils.Format4Output(excludeCourierVendorIDMap[storeCourier.VendorID], false))
|
||||
switch storeCourier.Status {
|
||||
case model.YES:
|
||||
if (courierVendorIDs == nil || courierVendorIDMap[storeCourier.VendorID] == 1) &&
|
||||
@@ -383,9 +384,9 @@ func (c *BaseScheduler) CheckStoreBalanceWithTip(ctx *jxcontext.Context, order *
|
||||
if roundTipFee != tipFee {
|
||||
return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("小费必须是1元的整数倍")
|
||||
}
|
||||
if order.WaybillTipMoney >= tipFee {
|
||||
return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("本次小费金额不能小于已经支付的小费")
|
||||
}
|
||||
//if order.WaybillTipMoney >= tipFee {
|
||||
// return model.ErrCodeOnePayTipFeeMore, fmt.Errorf("本次小费金额不能小于已经支付的小费")
|
||||
//}
|
||||
if order.CreateDeliveryType == model.YES {
|
||||
//加小费只判断余额
|
||||
storeAcct, err := cms.GetStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order))
|
||||
|
||||
@@ -2,13 +2,12 @@ package defsch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"math"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
||||
@@ -288,7 +287,18 @@ func (s *DefScheduler) CreateWaybillOnProvidersEx(ctx *jxcontext.Context, vendor
|
||||
return nil, errCode, err
|
||||
}
|
||||
}
|
||||
excludeCourierVendorIDs := make([]int, 0, 0)
|
||||
allDelivery := map[int]int{model.VendorIDFengNiao: 1, model.VendorIDDada: 1, model.VendorIDMTPS: 1, model.VendorIDUUPT: 1, model.VendorIDSFPS: 1}
|
||||
for _, v := range courierVendorIDs {
|
||||
if allDelivery[v] == model.YES {
|
||||
delete(allDelivery, v)
|
||||
}
|
||||
}
|
||||
for k, _ := range allDelivery {
|
||||
excludeCourierVendorIDs = append(excludeCourierVendorIDs, k)
|
||||
}
|
||||
|
||||
globals.SugarLogger.Debugf("===excludeCourierVendorIDs===========:%s", utils.Format4Output(excludeCourierVendorIDs, false))
|
||||
billFunc := func() {
|
||||
bills, err = func() (bills []*model.Waybill, err error) {
|
||||
if vendorID == model.VendorIDELM {
|
||||
@@ -313,7 +323,7 @@ func (s *DefScheduler) CreateWaybillOnProvidersEx(ctx *jxcontext.Context, vendor
|
||||
order.DeliveryFlag = 0
|
||||
err = partner.CurOrderManager.UpdateOrderStatusAndDeliveryFlag(order)
|
||||
// 创建订单
|
||||
if bills, err = s.CreateWaybillOnProviders4SavedOrder(ctx, savedOrderInfo, courierVendorIDs, nil, forceCreate, maxDeliveryFee); err == nil && len(bills) > 0 {
|
||||
if bills, err = s.CreateWaybillOnProviders4SavedOrder(ctx, savedOrderInfo, courierVendorIDs, excludeCourierVendorIDs, forceCreate, maxDeliveryFee); err == nil && len(bills) > 0 {
|
||||
partner.CurOrderManager.OnOrderMsg(order, "手动创建运单成功", fmt.Sprintf("%s创建%s平台运单,强发:%t,最高限价:%d", ctx.GetUserName(), model.VendorChineseNames[bills[0].WaybillVendorID], forceCreate, maxDeliveryFee))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -842,7 +842,7 @@ func (c *PurchaseHandler) AdjustOrder(ctx *jxcontext.Context, order *model.Goods
|
||||
|
||||
if err = api.DeliveryFinish(param); err != nil {
|
||||
globals.SugarLogger.Debugf("PickupGoods 拣货失败可能是BizSubOrderId 没填写 : %s", err.Error())
|
||||
return err
|
||||
return fmt.Errorf("订单缺过失败,请拣货完成前取货.或者联系客户发起部分退款")
|
||||
}
|
||||
c.postFakeMsg(order.VendorOrderID, tao_vegetable.OrderStatusPickedUp, tao_vegetable.OrderStatusPickedUp)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user