This commit is contained in:
laodaming 2023-06-28 17:08:43 +08:00
parent 979df28ae2
commit d5b829c212

View File

@ -110,12 +110,12 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us
deliveryMethod := int64(constants.DELIVERY_METHOD_CLOUD) deliveryMethod := int64(constants.DELIVERY_METHOD_CLOUD)
isSup := int64(1) isSup := int64(1)
//生成雪花id //生成雪花id
orderDetailTemplateSn, err := id_generator.GenSnowFlakeId() newOrderDetailTemplateSn, err := id_generator.GenSnowFlakeId()
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "gen order detail template sn 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 { if err != nil {
logx.Error(err) logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeServiceErr, "gen order detail sn 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{ orderDetailTemplateAddData := gmodel.FsOrderDetailTemplate{
Sn: &orderDetailTemplateSn, Sn: &newOrderDetailTemplateSn,
ProductId: orderDetailTemplateInfo.ProductId, ProductId: orderDetailTemplateInfo.ProductId,
ModelId: orderDetailTemplateInfo.ModelId, ModelId: orderDetailTemplateInfo.ModelId,
TemplateId: orderDetailTemplateInfo.TemplateId, TemplateId: orderDetailTemplateInfo.TemplateId,
@ -158,7 +158,7 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us
factoryId := int64(1) factoryId := int64(1)
isCloud := int64(1) isCloud := int64(1)
orderDetailAddData := gmodel.FsOrderDetail{ orderDetailAddData := gmodel.FsOrderDetail{
Sn: &orderDetailSn, Sn: &newOrderDetailSn,
OrderId: &orderAddData.Id, OrderId: &orderAddData.Id,
UserId: &userinfo.UserId, UserId: &userinfo.UserId,
FactoryId: &factoryId, FactoryId: &factoryId,
@ -179,5 +179,7 @@ func (l *SupplementLogic) Supplement(req *types.SupplementReq, userinfo *auth.Us
logx.Error(err) logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to supplement your stock") 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,
})
} }