aa
This commit is contained in:
@@ -1530,3 +1530,33 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
}
|
||||
globals.SugarLogger.Debug("SetMTPSStatus is Complete")
|
||||
}
|
||||
|
||||
func SetMTPSStatus2(storeID int) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
storeIDs []int
|
||||
)
|
||||
if storeID != 0 {
|
||||
storeIDs = append(storeIDs, storeID)
|
||||
}
|
||||
stores, _ := dao.GetStoreCourierList(db, storeIDs, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll)
|
||||
for _, v := range stores {
|
||||
storeDetail, _ := dao.GetStoreDetail2(db, v.StoreID, "", model.VendorIDMTPS)
|
||||
_, err := api.MtpsAPI.CheckOrder(utils.Int2Str(v.StoreID), storeDetail.Address, int64(storeDetail.Lng), int64(storeDetail.Lat), time.Now().Unix())
|
||||
if mtpsapi.IsOpen(err) {
|
||||
sl := make(map[string]interface{})
|
||||
sl["status"] = 1
|
||||
sl["vendorStatus"] = 1
|
||||
UpdateStoreCourierMap(jxcontext.AdminCtx, db, v.StoreID, model.VendorIDMTPS, sl, "jxadmin")
|
||||
} else {
|
||||
if mtpsapi.IsExist(err) {
|
||||
DeleteStoreCourierMap(jxcontext.AdminCtx, db, v.StoreID, model.VendorIDMTPS, "jxadmin")
|
||||
} else {
|
||||
sl := make(map[string]interface{})
|
||||
sl["status"] = 0
|
||||
sl["vendorStatus"] = 0
|
||||
UpdateStoreCourierMap(jxcontext.AdminCtx, db, v.StoreID, model.VendorIDMTPS, sl, "jxadmin")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,8 @@ func Init() {
|
||||
//刷新物料订单状态
|
||||
localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx)
|
||||
//同步美团配送与否状态及美团门店是否存在
|
||||
cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0)
|
||||
//cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0)
|
||||
cms.SetMTPSStatus2(0)
|
||||
//售后单如果超过12小时没有审核,就自动通过
|
||||
RefreshAfsOrderStatusAccess(jxcontext.AdminCtx)
|
||||
//刷新门店分组管理
|
||||
|
||||
@@ -1970,7 +1970,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
cms.RefreshPageStore()
|
||||
cms.SetMTPSStatus2(668202)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user