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,11 +53,11 @@ type PayInfo struct {
// 金额明细
type AmountInfo struct {
Change AmountCurrency `json:"change,omitempty"` // 变动金额
ChangeRemark string `json:"change_remark,omitempty"` // 变动备注
Current AmountCurrency `json:"current"` // 当前金额
Initiate AmountCurrency `json:"initiate"` // 初始金额
Metadata map[string]interface{} `json:"metadata"` // 额外明细
Change AmountCurrency `json:"change"` // 变动金额
ChangeRemark string `json:"change_remark"` // 变动备注
Current AmountCurrency `json:"current"` // 当前金额
Initiate AmountCurrency `json:"initiate"` // 初始金额
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
postMap := make(map[string]string, 2)
postMap := make(map[string]string, 3)
postMap["logo_url"] = in.LogoUrl
postMap["version"] = in.Version
postMap["is_all_template"] = "0"
// if in.Debug != nil && in.Debug.IsAllTemplateTag == 1 {
// postMap["is_all_template"] = "1"
// } else {
// postMap["is_all_template"] = "0"
// }
if in.Debug != nil && in.Debug.IsAllTemplateTag == 1 {
postMap["is_all_template"] = "1"
} else {
postMap["is_all_template"] = "0"
}
logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())
err := curl.NewClient(ctx, &curl.Config{

View File

@ -9,7 +9,6 @@ import (
"fusenapi/model/gmodel"
"fusenapi/utils/basic"
"fusenapi/utils/file"
"fusenapi/utils/format"
"fusenapi/utils/handlers"
"fusenapi/utils/hash"
"fusenapi/utils/order"
@ -17,7 +16,6 @@ import (
"fusenapi/utils/pdf"
"fusenapi/utils/queue"
"math"
"strconv"
"time"
"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 {
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 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)
productNum := strconv.FormatFloat(orderProduct.PurchaseQuantity.Current.(float64), 'f', -1, 64)
var productNumStr = format.NumToStringWithThousandthPercentile(productNum)
productNum := orderProduct.PurchaseQuantity.Current.(string)
var productNumStr = productNum
var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, priceTotal)
products = products + productsInfo
}
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 taxStr = "0.00"
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)]
}
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)
// 生成收据发票--首款
if receiptSnsDeposit != "" {
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"
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.Deposit.PayAmount.Current.CurrentCurrency)], payAmountStr01)
v9 := "Deposit Due"
@ -489,7 +487,7 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic
// 生成收据发票--尾款
if receiptSnsFinal != "" {
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"
v8 := fmt.Sprintf("%s%s", constants.OrderCurrencyMessage[constants.Currency(ress.OrderDetail.OrderAmount.RemainingBalance.PayAmount.Current.CurrentCurrency)], payAmountStr02)
v9 := "Balance Due"

View File

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