Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-10-30 17:42:46 +08:00
commit 2cedc71241
4 changed files with 27 additions and 30 deletions

View File

@ -53,8 +53,8 @@ type PayInfo struct {
// 金额明细 // 金额明细
type AmountInfo struct { type AmountInfo struct {
Change AmountCurrency `json:"change,omitempty"` // 变动金额 Change AmountCurrency `json:"change"` // 变动金额
ChangeRemark string `json:"change_remark,omitempty"` // 变动备注 ChangeRemark string `json:"change_remark"` // 变动备注
Current AmountCurrency `json:"current"` // 当前金额 Current AmountCurrency `json:"current"` // 当前金额
Initiate AmountCurrency `json:"initiate"` // 初始金额 Initiate AmountCurrency `json:"initiate"` // 初始金额
Metadata map[string]interface{} `json:"metadata"` // 额外明细 Metadata map[string]interface{} `json:"metadata"` // 额外明细

View File

@ -87,16 +87,15 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq
} }
var resultBLM constants.BLMServiceUrlResult var resultBLM constants.BLMServiceUrlResult
postMap := make(map[string]string, 2) postMap := make(map[string]string, 3)
postMap["logo_url"] = in.LogoUrl postMap["logo_url"] = in.LogoUrl
postMap["version"] = in.Version postMap["version"] = in.Version
postMap["is_all_template"] = "0"
// if in.Debug != nil && in.Debug.IsAllTemplateTag == 1 { if in.Debug != nil && in.Debug.IsAllTemplateTag == 1 {
// postMap["is_all_template"] = "1" postMap["is_all_template"] = "1"
// } else { } else {
// postMap["is_all_template"] = "0" postMap["is_all_template"] = "0"
// } }
logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC()) logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())
err := curl.NewClient(ctx, &curl.Config{ err := curl.NewClient(ctx, &curl.Config{

View File

@ -9,7 +9,6 @@ import (
"fusenapi/model/gmodel" "fusenapi/model/gmodel"
"fusenapi/utils/basic" "fusenapi/utils/basic"
"fusenapi/utils/file" "fusenapi/utils/file"
"fusenapi/utils/format"
"fusenapi/utils/handlers" "fusenapi/utils/handlers"
"fusenapi/utils/hash" "fusenapi/utils/hash"
"fusenapi/utils/order" "fusenapi/utils/order"
@ -17,7 +16,6 @@ import (
"fusenapi/utils/pdf" "fusenapi/utils/pdf"
"fusenapi/utils/queue" "fusenapi/utils/queue"
"math" "math"
"strconv"
"time" "time"
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
@ -404,20 +402,20 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
for _, orderProduct := range ress.OrderDetail.OrderProduct { for _, orderProduct := range ress.OrderDetail.OrderProduct {
var model00301 = constants.INVOICE_TEMPLATE_0301 var model00301 = constants.INVOICE_TEMPLATE_0301
var priceStr = format.NumToStringWithThousandthPercentile(orderProduct.ItemPrice.Current.CurrentAmount.(string)) var priceStr = orderProduct.ItemPrice.Current.CurrentAmount.(string)
var price = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.ItemPrice.Current.CurrentCurrency)], priceStr) var price = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.ItemPrice.Current.CurrentCurrency)], priceStr)
var priceTotalStr = format.NumToStringWithThousandthPercentile(orderProduct.TotalPrice.Current.CurrentAmount.(string)) var priceTotalStr = orderProduct.TotalPrice.Current.CurrentAmount.(string)
var priceTotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.TotalPrice.Current.CurrentCurrency)], priceTotalStr) var priceTotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(orderProduct.TotalPrice.Current.CurrentCurrency)], priceTotalStr)
productNum := strconv.FormatFloat(orderProduct.PurchaseQuantity.Current.(float64), 'f', -1, 64) productNum := orderProduct.PurchaseQuantity.Current.(string)
var productNumStr = format.NumToStringWithThousandthPercentile(productNum) var productNumStr = productNum
var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, priceTotal) var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, priceTotal)
products = products + productsInfo products = products + productsInfo
} }
model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, products) model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, products)
var subtotalStr = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentAmount.(string)) var subtotalStr = ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentAmount.(string)
var subtotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentCurrency)], subtotalStr) var subtotal = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Subtotal.Current.CurrentCurrency)], subtotalStr)
var taxStr = "0.00" var taxStr = "0.00"
if ress.OrderDetail.OrderAmount.Tax.Current.CurrentAmount != nil { if ress.OrderDetail.OrderAmount.Tax.Current.CurrentAmount != nil {
@ -428,14 +426,14 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
taxCurrency = constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)] taxCurrency = constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)]
} }
var tax = fmt.Sprintf("%s%s", taxCurrency, taxStr) var tax = fmt.Sprintf("%s%s", taxCurrency, taxStr)
var totalStr = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Total.Current.CurrentAmount.(string)) var totalStr = ress.OrderDetail.OrderAmount.Total.Current.CurrentAmount.(string)
var total = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)], totalStr) var total = fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Total.Current.CurrentCurrency)], totalStr)
// 生成收据发票--首款 // 生成收据发票--首款
if receiptSnsDeposit != "" { if receiptSnsDeposit != "" {
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode) model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode)
var payAmountStr01 = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentAmount.(string)) var payAmountStr01 = ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentAmount.(string)
v7 := "Deposit Requested" v7 := "Deposit Requested"
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentCurrency)], payAmountStr01) v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentCurrency)], payAmountStr01)
v9 := "Deposit Due" v9 := "Deposit Due"
@ -489,7 +487,7 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
// 生成收据发票--尾款 // 生成收据发票--尾款
if receiptSnsFinal != "" { if receiptSnsFinal != "" {
model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode) model002 = fmt.Sprintf(constants.INVOICE_TEMPLATE_02, receiptSnsDeposit, name, ctimeDate, street+" "+suite, city, state+zipCode)
var payAmountStr02 = format.NumToStringWithThousandthPercentile(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentAmount.(string)) var payAmountStr02 = ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentAmount.(string)
v7 := "Balance Requested" v7 := "Balance Requested"
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentCurrency)], payAmountStr02) v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentCurrency)], payAmountStr02)
v9 := "Balance Due" v9 := "Balance Due"

View File

@ -37,14 +37,14 @@ func GetAmountCurrency(req *AmountCurrencyReq) gmodel.AmountCurrency {
} }
type GetAmountInfoReq struct { type GetAmountInfoReq struct {
ExchangeRate int64 ExchangeRate int64 `json:"exchange_rate"`
Initiate int64 Initiate int64 `json:"initiate"`
Current int64 Current int64 `json:"current"`
Change int64 Change int64 `json:"change"`
ChangeRemark string ChangeRemark string `json:"change_remark"`
Metadata map[string]interface{} Metadata map[string]interface{} `json:"metadata"`
CurrentCurrency string CurrentCurrency string `json:"current_currency"`
OriginalCurrency string OriginalCurrency string `json:"original_currency"`
} }
// Change AmountCurrency `json:"change,omitempty"` // 变动金额 // Change AmountCurrency `json:"change,omitempty"` // 变动金额