Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop

This commit is contained in:
richboo111
2022-10-08 17:02:44 +08:00
2 changed files with 15 additions and 13 deletions

View File

@@ -1670,9 +1670,15 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
if err = dao.GetEntity(db, storeMap, model.FieldStoreID, model.FieldVendorID, model.FieldDeletedAt); err != nil {
return 0, err
}
globals.SugarLogger.Debug("==============payload", utils.Format4Output(payload, false))
globals.SugarLogger.Debug("==============storeMap", utils.Format4Output(storeMap, false))
globals.SugarLogger.Debug("==============userName", utils.Format4Output(userName, false))
var beforeStoreMap = *storeMap
syncStatus := model.SyncFlagModifiedMask
valid := dao.StrictMakeMapByStructObject(payload, storeMap, userName)
globals.SugarLogger.Debug("==============validvalidvalidvalidvalid", utils.Format4Output(valid, false))
if valid["status"] != nil {
syncStatus |= model.SyncFlagStoreStatus
}
@@ -1717,7 +1723,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
}
if err == nil {
// globals.SugarLogger.Debug(utils.Format4Output(valid, false))
globals.SugarLogger.Debug("==============2525", utils.Format4Output(valid, false))
if len(valid) > 0 {
txDB, _ := dao.Begin(db)
defer func() {
@@ -1743,6 +1749,8 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
dao.Rollback(db, txDB)
return 0, err
}
globals.SugarLogger.Debug("==============num", num)
if num > 0 {
if globals.IsAddEvent {
mapBefore := refutil.FindMapAndStructMixed(valid, beforeStoreMap)

View File

@@ -171,18 +171,8 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
if db == nil {
db = dao.GetDB()
}
sqlStr := ` SELECT
t1.*,
t2.status, t2.vendor_store_id, t2.vendor_org_code,
IF(t1.updated_at > t2.updated_at, t1.last_operator, t2.last_operator) real_last_operator, t2.sync_status, t2.vendor_store_name
FROM store t1
LEFT JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND (t2.deleted_at = ?)
WHERE t1.id = ?
ORDER BY t2.updated_at`
err = dao.GetRow(db, &storeInfo, sqlStr, model.VendorIDDD, utils.DefaultTimeValue, utils.Int2Str(storeID))
if err != nil {
return err
}
storeInfo, err = dao.GetStoreDetail(db, storeID, model.VendorIDDD, "")
errList := errlist.New()
timeStr := ""
m := make(map[int64]string)
@@ -231,6 +221,8 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
}
//修改店铺状态
if storeInfo.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
globals.SugarLogger.Debug("================1", 1)
globals.SugarLogger.Debug("================mergedStoreStatus", mergedStoreStatus)
errList.AddErr(P.UpdateStoreStatus(jxcontext.AdminCtx, storeInfo.VendorOrgCode, storeID, storeInfo.VendorStoreID, mergedStoreStatus))
}
_, err3 := api.EditStore(params)
@@ -243,7 +235,9 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
// UpdateStoreStatus shop/unsuspendStore 门店恢复营业
func (p *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, status int) (err error) {
globals.SugarLogger.Debug("================2", 1)
isOnline := bizStatusJX2DouDian(status)
globals.SugarLogger.Debug("================2", isOnline)
api := getAPI(vendorOrgCode, storeID, vendorStoreID)
if globals.EnableDdStoreWrite {
if isOnline != tiktok_api.StoreStatusOnline { //暂停营业状态