aa
This commit is contained in:
@@ -1638,6 +1638,13 @@ func GetStoreCourierMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, ven
|
||||
}
|
||||
}
|
||||
}
|
||||
handler := partner.GetDeliveryPlatformFromVendorID(vendorID).Handler
|
||||
storeDetail, _ := handler.GetStore(ctx, storeID, "")
|
||||
for _, v := range storeCourierMaps {
|
||||
if v.VendorStoreName == "" {
|
||||
v.VendorStoreName = storeDetail.Name
|
||||
}
|
||||
}
|
||||
return storeCourierMaps, err
|
||||
}
|
||||
|
||||
@@ -1853,9 +1860,10 @@ func UpdateOrCreateCourierStores(ctx *jxcontext.Context, storeID int, isForceUpd
|
||||
}
|
||||
if _, err = updateOrCreateCourierStore(ctx, storeDetail); err == nil && isNeedAdd {
|
||||
storeCourier := &model.StoreCourierMap{
|
||||
VendorStoreID: storeDetail.VendorStoreID,
|
||||
Status: model.StoreStatusOpened,
|
||||
AuditStatus: storeDetail.AuditStatus,
|
||||
VendorStoreID: storeDetail.VendorStoreID,
|
||||
Status: model.StoreStatusOpened,
|
||||
AuditStatus: storeDetail.AuditStatus,
|
||||
VendorStoreName: storeDetail.Name,
|
||||
}
|
||||
if storeDetail.AuditStatus != model.StoreAuditStatusOnline {
|
||||
storeCourier.Status = model.StoreStatusDisabled
|
||||
@@ -2506,7 +2514,7 @@ func SyncStoresCourierInfo(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo
|
||||
storeCourier, err2 := handler.Handler.GetStore(ctx, store.ID, storeDetail2.VendorStoreID)
|
||||
if err = err2; err == nil {
|
||||
if storeDetail2.AuditStatus == model.StoreAuditStatusCreated { // 如果已经通过审核,更新本地状态
|
||||
partner.CurStoreManager.OnCourierStoreStatusChanged(ctx, storeCourier.VendorStoreID, vendorID, storeCourier.AuditStatus)
|
||||
partner.CurStoreManager.OnCourierStoreStatusChanged(ctx, storeCourier.VendorStoreID, vendorID, storeCourier.AuditStatus, storeCourier.Comment)
|
||||
}
|
||||
|
||||
distance := jxutils.EarthDistance(jxutils.IntCoordinate2Standard(store.Lng), jxutils.IntCoordinate2Standard(store.Lat), jxutils.IntCoordinate2Standard(storeCourier.Lng), jxutils.IntCoordinate2Standard(storeCourier.Lat))
|
||||
|
||||
@@ -102,18 +102,23 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *StoreManager) OnCourierStoreStatusChanged(ctx *jxcontext.Context, vendorStoreID string, vendorID int, auditStatus int) (err error) {
|
||||
func (s *StoreManager) OnCourierStoreStatusChanged(ctx *jxcontext.Context, vendorStoreID string, vendorID int, auditStatus int, message string) (err error) {
|
||||
if vendorStoreID != "" {
|
||||
db := dao.GetDB()
|
||||
_, err2 := dao.GetStoreDetail2(db, 0, vendorStoreID, vendorID)
|
||||
if err = err2; err == nil {
|
||||
status := model.StoreStatusOpened
|
||||
if auditStatus != model.StoreAuditStatusOnline {
|
||||
if auditStatus != model.StoreAuditStatusOnline && auditStatus != model.StoreAuditStatusUpdated {
|
||||
status = model.StoreStatusDisabled
|
||||
}
|
||||
comment := ""
|
||||
if auditStatus == model.StoreAuditStatusRejected {
|
||||
comment = message
|
||||
}
|
||||
_, err = dao.UpdateEntityLogically(db, &model.StoreCourierMap{}, map[string]interface{}{
|
||||
model.FieldStatus: status,
|
||||
"AuditStatus": auditStatus,
|
||||
"Comment": comment,
|
||||
}, ctx.GetUserName(), map[string]interface{}{
|
||||
model.FieldVendorStoreID: vendorStoreID,
|
||||
model.FieldVendorID: vendorID,
|
||||
|
||||
Reference in New Issue
Block a user