From befb0e6906c78a2cfe23b28c977bb9c2d7aa95d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 16 May 2024 13:58:01 +0800 Subject: [PATCH] 1 --- business/jxstore/act/act.go | 8 +++++++- controllers/act.go | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 9e2122049..010068ef9 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -670,7 +670,6 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOr } func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOrgCode string, actStoreSku []*ActStoreSkuParam) (err error) { - globals.SugarLogger.Debugf("================actStoreSku := %s", utils.Format4Output(actStoreSku, false)) var ( db = dao.GetDB() actStoreSkuMap = make(map[int][]*model.StoreSkuBind) @@ -722,6 +721,7 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i // } // } //} + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(1111, false)) txDB, _ := dao.Begin(db) defer func() { if r := recover(); r != nil { @@ -730,6 +730,7 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i } }() dao.WrapAddIDCULDEntity(act, ctx.GetUserName()) + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(2222, false)) err = dao.CreateEntityTx(txDB, act) if err != nil { dao.Rollback(db, txDB) @@ -740,12 +741,14 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i VendorID: vendorID, VendorOrgCode: vendorOrgCode, } + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(3333, false)) dao.WrapAddIDCULDEntity(actMap, ctx.GetUserName()) err = dao.CreateEntityTx(txDB, actMap) if err != nil { dao.Rollback(db, txDB) return err } + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(444, false)) for storeID, storeSkus := range actStoreSkuMap { for _, storeSku := range storeSkus { actStoreSkuModel := &model.ActStoreSku{ @@ -757,6 +760,7 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i ActPrice: int64(storeSku.JdsPrice), } dao.WrapAddIDCULDEntity(actStoreSkuModel, ctx.GetUserName()) + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(555, false)) err = dao.CreateEntityTx(txDB, actStoreSkuModel) if err != nil { dao.Rollback(db, txDB) @@ -772,6 +776,7 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i ActualActPrice: int64(storeSku.JdsPrice), } dao.WrapAddIDCULDEntity(actStoreSkuMapModel, ctx.GetUserName()) + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(666, false)) err = dao.CreateEntityTx(txDB, actStoreSkuMapModel) if err != nil { dao.Rollback(db, txDB) @@ -779,6 +784,7 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i } } } + globals.SugarLogger.Debugf("================createACte := %s", utils.Format4Output(1111, false)) dao.Commit(db, txDB) if !globals.IsProductEnv() { return err diff --git a/controllers/act.go b/controllers/act.go index ffbb65bc8..37c440fb4 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -2,6 +2,7 @@ package controllers import ( "fmt" + "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm" @@ -160,6 +161,7 @@ func (c *ActController) CreateActForMtByOrder() { } //retVal, err = act.CreateAct(params.Ctx, actObj, vendorIDs, params.VendorOrgCode, nil, actStoreSkuList, params.IsAsync) err = act.CreateActForMtByOrder(params.Ctx, actObj, vendorIDs, params.VendorOrgCode, actStoreSkuList) + globals.SugarLogger.Debugf("================CreateActForMtByOrder := %v", err) } } return "success", "", err