- don't judge DeliveryFlag in swtich2SelfDeliverWithRetry
- fix dada shop already exist error
This commit is contained in:
@@ -557,7 +557,7 @@ func (s *DefScheduler) cancelOtherWaybills(savedOrderInfo *WatchOrderInfo, bill2
|
|||||||
func (s *DefScheduler) swtich2SelfDeliverWithRetry(savedOrderInfo *WatchOrderInfo, bill *model.Waybill, retryCount int, duration time.Duration) {
|
func (s *DefScheduler) swtich2SelfDeliverWithRetry(savedOrderInfo *WatchOrderInfo, bill *model.Waybill, retryCount int, duration time.Duration) {
|
||||||
order := savedOrderInfo.order
|
order := savedOrderInfo.order
|
||||||
globals.SugarLogger.Debugf("swtich2SelfDeliverWithRetry orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("swtich2SelfDeliverWithRetry orderID:%s", order.VendorOrderID)
|
||||||
if (order.DeliveryFlag & model.OrderDeliveryFlagMaskPurcahseDisabled) == 0 {
|
if true { //这里应该不需要判断这样状态//(order.DeliveryFlag & model.OrderDeliveryFlagMaskPurcahseDisabled) == 0 {
|
||||||
if order.WaybillVendorID != order.VendorID {
|
if order.WaybillVendorID != order.VendorID {
|
||||||
if err := s.Swtich2SelfDeliver(order, ""); err != nil && err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation {
|
if err := s.Swtich2SelfDeliver(order, ""); err != nil && err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation {
|
||||||
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry failed, bill:%v, err:%v", bill, err)
|
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry failed, bill:%v, err:%v", bill, err)
|
||||||
|
|||||||
@@ -467,7 +467,12 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID
|
|||||||
storeDetail := storeDetailList[0]
|
storeDetail := storeDetailList[0]
|
||||||
if _, err = api.DadaAPI.ShopAdd(utils.Int2Str(storeID), storeDetail.Name, dadaapi.BusinessTypeConvStore, storeDetail.CityName,
|
if _, err = api.DadaAPI.ShopAdd(utils.Int2Str(storeID), storeDetail.Name, dadaapi.BusinessTypeConvStore, storeDetail.CityName,
|
||||||
storeDetail.DistrictName, storeDetail.Address, jxutils.IntCoordinate2Standard(storeDetail.Lng), jxutils.IntCoordinate2Standard(storeDetail.Lat),
|
storeDetail.DistrictName, storeDetail.Address, jxutils.IntCoordinate2Standard(storeDetail.Lng), jxutils.IntCoordinate2Standard(storeDetail.Lat),
|
||||||
storeDetail.Tel1, storeDetail.Tel1, nil); err == nil {
|
storeDetail.Tel1, storeDetail.Tel1, nil); err != nil {
|
||||||
|
if codeErr, ok := err.(*utils.ErrorWithCode); ok && codeErr.IntCode() == dadaapi.ResponseCodeShopAlreadyExist {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err == nil {
|
||||||
_, err = AddStoreCourierMap(ctx, db, storeDetail.ID, model.VendorIDDada, &model.StoreCourierMap{
|
_, err = AddStoreCourierMap(ctx, db, storeDetail.ID, model.VendorIDDada, &model.StoreCourierMap{
|
||||||
VendorStoreID: utils.Int2Str(storeDetail.ID),
|
VendorStoreID: utils.Int2Str(storeDetail.ID),
|
||||||
Status: model.StoreStatusOpened,
|
Status: model.StoreStatusOpened,
|
||||||
|
|||||||
Reference in New Issue
Block a user