From 1fb52f2e5d7a82922786116bcbf143213c9c3680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 17 Jan 2020 17:56:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E9=97=A8=E5=BA=97=E7=BB=91=E5=AE=9A=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E9=85=8D=E9=80=81=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 11 +++++++++++ business/model/const.go | 20 ++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 5c310112d..d96e212a7 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1454,6 +1454,9 @@ func addStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID if err = dao.CreateEntity(db, storeCourierMap); err != nil { return nil, err } + if globals.IsAddEvent { + err = AddEventDetail(db, ctx, model.OperateAdd, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`) + } outStoreCourierMap = storeCourierMap } else { err = ErrCanNotFindVendor @@ -1472,6 +1475,9 @@ func DeleteStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendo model.FieldStoreID: storeID, model.FieldVendorID: vendorID, }) + if globals.IsAddEvent { + err = AddEventDetail(db, ctx, model.OperateDelete, vendorID, model.ThingTypeStore, storeID, "", `{"VendorID":`+utils.Int2Str(vendorID)+`}`) + } return num, err } @@ -1487,6 +1493,7 @@ func UpdateStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendo if err = dao.GetEntity(db, storeCourier, model.FieldStoreID, model.FieldVendorID, model.FieldDeletedAt); err != nil { return 0, err } + var beforeStoreCourier = *storeCourier delete(payload, "auditStatus") // 不允许直接修改auditStatus的值 valid := dao.NormalMakeMapByStructObject(payload, storeCourier, userName) if len(valid) > 0 { @@ -1497,6 +1504,10 @@ func UpdateStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendo } } num, err = dao.UpdateEntityLogically(db, storeCourier, valid, userName, nil) + if globals.IsAddEvent { + mapBefore := refutil.FindMapAndStructMixed(valid, beforeStoreCourier) + err = AddEventDetail(db, ctx, model.OperateUpdate, vendorID, model.ThingTypeStore, storeID, BuildDiffData(mapBefore), BuildDiffData(valid)) + } } return num, err } diff --git a/business/model/const.go b/business/model/const.go index 4a91efed9..41217cd30 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -120,14 +120,18 @@ var ( } ApiFunctionName = map[string]string{ - "UpdateStoresSkus": "门店商品管理", - "UpdateStoresSkusSale": "门店商品可售状态修改", - "CopyStoreSkus": "京西门店商品复制到京西", - "UpdateStore": "门店管理-更新门店信息", - "CreateStore": "门店管理-创建门店", - "DeleteStore": "门店管理-删除门店", - "DeleteStoreVendorMap": "门店解绑", - "AddStoreVendorMap": "门店绑定", + "UpdateStoresSkus": "门店商品管理", + "UpdateStoresSkusSale": "门店商品可售状态修改", + "CopyStoreSkus": "京西门店商品复制到京西", + "UpdateStore": "门店管理-更新门店信息", + "CreateStore": "门店管理-创建门店", + "DeleteStore": "门店管理-删除门店", + "DeleteStoreVendorMap": "门店解绑", + "AddStoreVendorMap": "门店绑定", + "UpdateStoreVendorMap": "门店修改平台绑定信息", + "DeleteStoreCourierMap": "门店解绑三方配送平台", + "AddStoreCourierMap": "门店绑定三方配送平台", + "UpdateStoreCourierMap": "门店修改三方配送平台绑定信息", } MultiStoresVendorMap = map[int]int{