操作日志门店绑定
This commit is contained in:
@@ -1109,7 +1109,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
|
|||||||
}()
|
}()
|
||||||
if err = dao.CreateEntity(db, storeMap); err == nil {
|
if err = dao.CreateEntity(db, storeMap); err == nil {
|
||||||
if globals.IsAddEvent {
|
if globals.IsAddEvent {
|
||||||
err = AddEventDetail(db, ctx, model.OperateAdd, storeID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
|
err = AddEventDetail(db, ctx, model.OperateAdd, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
|
||||||
}
|
}
|
||||||
dao.Commit(db)
|
dao.Commit(db)
|
||||||
outStoreMap = storeMap
|
outStoreMap = storeMap
|
||||||
@@ -1138,7 +1138,7 @@ func DeleteStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
|||||||
model.FieldStatus: model.StoreStatusDisabled,
|
model.FieldStatus: model.StoreStatusDisabled,
|
||||||
}, userName, nil)
|
}, userName, nil)
|
||||||
if globals.IsAddEvent {
|
if globals.IsAddEvent {
|
||||||
err = AddEventDetail(db, ctx, model.OperateDelete, storeID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
|
err = AddEventDetail(db, ctx, model.OperateDelete, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num, err
|
return num, err
|
||||||
@@ -1179,6 +1179,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
|||||||
if err = dao.GetEntity(db, storeMap, model.FieldStoreID, model.FieldVendorID, model.FieldDeletedAt); err != nil {
|
if err = dao.GetEntity(db, storeMap, model.FieldStoreID, model.FieldVendorID, model.FieldDeletedAt); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
var beforeStoreMap = *storeMap
|
||||||
syncStatus := model.SyncFlagModifiedMask
|
syncStatus := model.SyncFlagModifiedMask
|
||||||
valid := dao.StrictMakeMapByStructObject(payload, storeMap, userName)
|
valid := dao.StrictMakeMapByStructObject(payload, storeMap, userName)
|
||||||
if valid["status"] != nil {
|
if valid["status"] != nil {
|
||||||
@@ -1246,6 +1247,10 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if num > 0 {
|
if num > 0 {
|
||||||
|
if globals.IsAddEvent {
|
||||||
|
mapBefore := refutil.FindMapAndStructMixed(valid, beforeStoreMap)
|
||||||
|
err = AddEventDetail(db, ctx, model.OperateUpdate, vendorID, model.ThingTypeStore, storeID, BuildDiffData(mapBefore), BuildDiffData(valid))
|
||||||
|
}
|
||||||
if vendorID != model.VendorIDJX {
|
if vendorID != model.VendorIDJX {
|
||||||
if valid["pricePercentage"] != nil || valid["pricePercentagePack"] != nil {
|
if valid["pricePercentage"] != nil || valid["pricePercentagePack"] != nil {
|
||||||
storeSkuBind := &model.StoreSkuBind{}
|
storeSkuBind := &model.StoreSkuBind{}
|
||||||
|
|||||||
Reference in New Issue
Block a user