From d5b829c21299d0d29ce110b3af5423182e6b1a73 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 28 Jun 2023 17:08:43 +0800 Subject: [PATCH] fix --- server/inventory/internal/logic/supplementlogic.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/inventory/internal/logic/supplementlogic.go b/server/inventory/internal/logic/supplementlogic.go index 3a82b9bc..ae981c8e 100644 --- a/server/inventory/internal/logic/supplementlogic.go +++ b/server/inventory/internal/logic/supplementlogic.go @@ -110,12 +110,12 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us deliveryMethod := int64(constants.DELIVERY_METHOD_CLOUD) isSup := int64(1) //生成雪花id - orderDetailTemplateSn, err := id_generator.GenSnowFlakeId() + newOrderDetailTemplateSn, err := id_generator.GenSnowFlakeId() if err != nil { logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "gen order detail template sn err") } - orderDetailSn, err := id_generator.GenSnowFlakeId() + newOrderDetailSn, err := id_generator.GenSnowFlakeId() if err != nil { logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "gen order detail sn err") @@ -140,7 +140,7 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us } //添加订单详情模板数据 orderDetailTemplateAddData := gmodel.FsOrderDetailTemplate{ - Sn: &orderDetailTemplateSn, + Sn: &newOrderDetailTemplateSn, ProductId: orderDetailTemplateInfo.ProductId, ModelId: orderDetailTemplateInfo.ModelId, TemplateId: orderDetailTemplateInfo.TemplateId, @@ -158,7 +158,7 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us factoryId := int64(1) isCloud := int64(1) orderDetailAddData := gmodel.FsOrderDetail{ - Sn: &orderDetailSn, + Sn: &newOrderDetailSn, OrderId: &orderAddData.Id, UserId: &userinfo.UserId, FactoryId: &factoryId, @@ -179,5 +179,7 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us logx.Error(err) return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to supplement your stock") } - return resp.SetStatus(basic.CodeOK) + return resp.SetStatusWithMessage(basic.CodeOK, "success", types.SupplementRsp{ + Sn: newOrderSn, + }) }