From 122d558765d0c5dec81c19472f1b757e9c3c041a Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Sat, 7 Oct 2023 11:32:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E5=90=88=E5=9B=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/internal/types/types.go | 6 +++--- server/upload/etc/upload.yaml | 1 + server/upload/internal/config/config.go | 1 + .../upload/internal/logic/uploadlogologic.go | 5 +---- server_api/resource.api | 19 +++++++++---------- service/repositories/image_handle.go | 6 ++++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/resource/internal/types/types.go b/server/resource/internal/types/types.go index e8807725..e55d9bd3 100644 --- a/server/resource/internal/types/types.go +++ b/server/resource/internal/types/types.go @@ -28,6 +28,9 @@ type ResourceInfoReq struct { } type LogoCombineReq struct { + LogoUrl string `json:"logo_url"` // 合图参数 + TemplateTagColor TemplateTagColor `json:"template_tag_color"` + TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` TemplateId int64 `json:"template_id"` // 合图参数 TemplateTag string `json:"template_tag"` // 合图参数 Website string `json:"website,optional"` // 合图参数 @@ -35,9 +38,6 @@ type LogoCombineReq struct { Address string `json:"address,optional"` // 合图参数 Phone string `json:"phone,optional"` // 合图参数 Qrcode string `json:"qrcode,optional"` // 合图参数 - LogoUrl string `json:"logo_url"` // 合图参数 - TemplateTagColor TemplateTagColor `json:"template_tag_color"` - TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` } type TemplateTagColor struct { diff --git a/server/upload/etc/upload.yaml b/server/upload/etc/upload.yaml index 36922560..7c6f72fb 100644 --- a/server/upload/etc/upload.yaml +++ b/server/upload/etc/upload.yaml @@ -19,6 +19,7 @@ AWS: Secret: sjCEv0JxATnPCxno2KNLm0X8oDc7srUR+4vkYhvm Token: BLMService: + Version: "2" Url: "http://18.119.109.254:8999" # Url: "http://192.168.1.9:8999" ImageProcess: diff --git a/server/upload/internal/config/config.go b/server/upload/internal/config/config.go index b474e0e4..ad24a1cd 100644 --- a/server/upload/internal/config/config.go +++ b/server/upload/internal/config/config.go @@ -22,6 +22,7 @@ type Config struct { } } BLMService struct { + Version string Url string ImageProcess struct { Url string diff --git a/server/upload/internal/logic/uploadlogologic.go b/server/upload/internal/logic/uploadlogologic.go index 7db0fed9..f5e0c6fa 100644 --- a/server/upload/internal/logic/uploadlogologic.go +++ b/server/upload/internal/logic/uploadlogologic.go @@ -171,12 +171,9 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us logoHeight = 200 } var resultStr string - - var postMap = make(map[string]string, 1) - postMap["logo_url"] = logoUrl - resLogoStandard, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{ LogoUrl: logoUrl, + Version: l.svcCtx.Config.BLMService.Version, }) if err != nil { diff --git a/server_api/resource.api b/server_api/resource.api index 433c4116..f71b6234 100644 --- a/server_api/resource.api +++ b/server_api/resource.api @@ -55,17 +55,16 @@ type ( type ( LogoCombineReq { - TemplateId int64 `json:"template_id"` // 合图参数 - TemplateTag string `json:"template_tag"` // 合图参数 - Website string `json:"website,optional"` // 合图参数 - Slogan string `json:"slogan,optional"` // 合图参数 - Address string `json:"address,optional"` // 合图参数 - Phone string `json:"phone,optional"` // 合图参数 - Qrcode string `json:"qrcode,optional"` // 合图参数 - LogoUrl string `json:"logo_url"` // 合图参数 - TemplateTagColor TemplateTagColor `json:"template_tag_color"` - + LogoUrl string `json:"logo_url"` // 合图参数 + TemplateTagColor TemplateTagColor `json:"template_tag_color"` TemplateTagGroups []TemplateTagGroups `json:"template_tag_groups"` + TemplateId int64 `json:"template_id"` // 合图参数 + TemplateTag string `json:"template_tag"` // 合图参数 + Website string `json:"website,optional"` // 合图参数 + Slogan string `json:"slogan,optional"` // 合图参数 + Address string `json:"address,optional"` // 合图参数 + Phone string `json:"phone,optional"` // 合图参数 + Qrcode string `json:"qrcode,optional"` // 合图参数 } TemplateTagColor { Colors [][]string `json:"colors"` // 颜色组合 diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 7fbe4806..19a2c8c6 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -160,6 +160,7 @@ func (l *defaultImageHandle) LogoInfo(ctx context.Context, in *LogoInfoReq) (*Lo type ( LogoInfoSetReq struct { LogoUrl string `json:"logo_url"` + Version string `json:"version"` } LogoInfoSetRes struct { Res string `json:"res"` @@ -168,8 +169,9 @@ type ( func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq) (*LogoInfoSetRes, error) { var resultBLM constants.BLMServiceUrlResult - postMap := make(map[string]string, 1) + postMap := make(map[string]string, 2) postMap["logo_url"] = in.LogoUrl + postMap["version"] = in.Version logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC()) err := curl.NewClient(ctx, &curl.Config{ @@ -306,7 +308,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq "color": in.TemplateTagColor.Color, "index": in.TemplateTagColor.Index, } - var postMap = make(map[string]interface{}, 2) + var postMap = make(map[string]interface{}, 3) postMap["module_data"] = moduleDataMap postMap["tag_data"] = in.ProductTemplateTagGroups postMap["param_data"] = combineParam From 8d987c4c54741f0b3ebb7f498c7edfea5040eb64 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Sat, 7 Oct 2023 11:48:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E5=90=88=E5=9B=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 7 ++++++- service/repositories/shopping_cart.go | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index e9846d19..2a189a6c 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -1016,8 +1016,13 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe return errors.New("shoppingCartProductModel3d.StepPrice nil") } + var fittingPrice int64 + if shoppingCart.ShoppingCartProductModel3dFitting != nil { + fittingPrice = *shoppingCart.ShoppingCartProductModel3dFitting.Price + } + /* 计算价格 */ - productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, *shoppingCart.ShoppingCartProductModel3dFitting.Price) + productTotalPrice, productPrice, err := NewShoppingCart(tx, nil, nil).CaculateStepPrice(*shoppingCart.PurchaseQuantity, stepPriceJson, fittingPrice) if err != nil { errorCode = *basic.CodeErrOrderCreatProductPriceAbsent errorCode.Message = "create order failed, step price of product '" + shoppingCartSnapshot.ProductInfo.ProductName + "'is failed" diff --git a/service/repositories/shopping_cart.go b/service/repositories/shopping_cart.go index afc7e18f..ad6410ec 100644 --- a/service/repositories/shopping_cart.go +++ b/service/repositories/shopping_cart.go @@ -5,9 +5,10 @@ import ( "errors" "fusenapi/model/gmodel" "fusenapi/utils/hash" + "strings" + "github.com/aws/aws-sdk-go/aws/session" "gorm.io/gorm" - "strings" ) func NewShoppingCart(gormDB *gorm.DB, bLMServiceUrl *string, awsSession *session.Session) ShoppingCart { From df5414fc1dc4eaae7664f7534738331d851cf0a9 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Sat, 7 Oct 2023 11:53:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=E5=88=97=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 2a189a6c..b869cb94 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -807,11 +807,11 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create func (d *defaultOrder) List(ctx context.Context, in *ListReq) (res *ListRes, err error) { var orderList []gmodel.FsOrder model := d.MysqlConn.Model(&gmodel.FsOrder{}).Where("is_del = ?", 0) + model.Where("pay_status > ?", 0) if in.UserId != 0 { model.Where("user_id = ?", in.UserId) } - // Where("pay_status > ?", 0) if in.DeliveryMethod != 0 { model.Where("delivery_method = ?", in.DeliveryMethod) } From 8870b389bead602db14b425b249ebf5c3388632d Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Sat, 7 Oct 2023 11:54:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=E5=88=97=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index b869cb94..9616b580 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -687,7 +687,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create ntimeTimeOut := ntime.Unix() // 测试超时支付不限制 - if ctimeTimeOut == ntimeTimeOut { + if ctimeTimeOut < ntimeTimeOut { errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout err = errors.New("order pay timeout") logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err)