- fk
This commit is contained in:
@@ -3,6 +3,7 @@ package mtps
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
@@ -13,10 +14,10 @@ import (
|
||||
|
||||
var (
|
||||
auditStatusMap = map[int]int{
|
||||
mtpsapi.ShopStatusCreateSuccess: model.StoreAuditStatusCreated,
|
||||
mtpsapi.ShopStatusAuditCreated: model.StoreAuditStatusCreated,
|
||||
mtpsapi.ShopStatusAuditRejected: model.StoreAuditStatusRejected,
|
||||
mtpsapi.ShopStatusAuditPassed: model.StoreAuditStatusCreated,
|
||||
mtpsapi.ShopStatusOnline: model.StoreAuditStatusOnline,
|
||||
mtpsapi.ShopStatusAuditOnline: model.StoreAuditStatusOnline,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -58,14 +59,18 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
||||
CoordinateType: mtpsapi.CoordinateTypeMars,
|
||||
BusinessHours: string(utils.MustMarshal(businessHours)),
|
||||
}
|
||||
shopStatus := mtpsapi.ShopStatusCreateSuccess
|
||||
shopStatus := mtpsapi.ShopStatusAuditCreated
|
||||
if globals.EnableStoreWrite {
|
||||
shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo)
|
||||
if err == nil {
|
||||
vendorStoreID = shopInfo.ShopID
|
||||
status = getAuditStatus(shopStatus)
|
||||
}
|
||||
} else {
|
||||
vendorStoreID = utils.Int64ToStr(jxutils.GenFakeID())
|
||||
status = model.StoreAuditStatusOnline
|
||||
}
|
||||
if err == nil {
|
||||
status = getAuditStatus(shopStatus)
|
||||
}
|
||||
return "", status, err
|
||||
return vendorStoreID, status, err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeDetail *dao.StoreDetail2, err error) {
|
||||
@@ -83,6 +88,8 @@ func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorSt
|
||||
},
|
||||
VendorID: model.VendorIDMTPS,
|
||||
VendorStoreID: shopInfo.ShopID,
|
||||
CourierStatus: model.StoreStatusOpened,
|
||||
AuditStatus: model.StoreAuditStatusOnline,
|
||||
}
|
||||
}
|
||||
return storeDetail, err
|
||||
|
||||
Reference in New Issue
Block a user