This commit is contained in:
richboo111
2023-03-20 14:12:32 +08:00
parent 8e152a44f6
commit 8c8c06c1a2

View File

@@ -161,11 +161,14 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
if order.VendorID == model.VendorIDEBAI {
getCode = fmt.Sprintf("<CB>饿百取货码:%s</CB>", jxutils.GetEbaiOrderGetCode(order))
}
if order.BuyerComment == "" {
order.BuyerComment = "客户电话: " + order.ConsigneeMobile + ",配送遇到问题,可联系18048531223取消配送单,禁止未配送直接完成订单!"
}
orderParams := []interface{}{}
orderFmt := ``
if storeDetail != nil {
if storeDetail.BrandIsPrint == model.NO {
orderFmt += `<BR><C>%s</C></BR>\n`
orderFmt += `<C><B>%s</B><C>`
if order.VendorOrgCode == "34665" {
orderParams = append(orderParams, globals.StoreNameEbai2)
} else {
@@ -175,21 +178,20 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
}
orderFmt += `
` + xpyunapi.StrRepeat("-", 32) + `
<BR><L>下单时间: %s
<BR><L>预计送达: %s
<BR><L>客户姓名: %s
<BR><L>客户电话: %s
<BR><HB>订单编号: %s</HB>
<IMG></IMG><BR><C><B>%s: #%d</B></C>
<C><QRCODE s=6 e=L l=center>%s</QRCODE></C>"
` + getCode + `
` + xpyunapi.StrRepeat("-", 32) + `
<L>下单时间: %s
<L>预计送达: %s
<L>客户姓名: %s
<L>客户电话: %s<BR>
<HB>订单编号: %s</HB><BR>
<CB>%s#%d
<C><QRCODE s=6 e=L l=center>%s</QRCODE></C></CB>
` + getCode +
xpyunapi.StrRepeat("-", 32) + `
<HB>客户地址: %s</HB>
` + xpyunapi.StrRepeat("-", 32) + `客户备注: %s
` + xpyunapi.StrRepeat("-", 32) + `
<BR>客户备注: %s
` + xpyunapi.StrRepeat("-", 32) + `
<BR>商品列表<BR>
商品名` + xpyunapi.StrRepeat(" ", 2) + `数量` + xpyunapi.StrRepeat(" ", 3) + `单价` + xpyunapi.StrRepeat(" ", 5) + `小计<BR>
商品列表
商品名` + xpyunapi.StrRepeat(" ", 2) + `数量` + xpyunapi.StrRepeat(" ", 3) + `单价` + xpyunapi.StrRepeat(" ", 5) + `小计
` + xpyunapi.StrRepeat("-", 32) + `
`
orderParams = append(orderParams,
@@ -209,14 +211,16 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
orderFmt += xpyunapi.FormatPrintOrderItem(sku.SkuName, sku.Count, utils.Int64ToFloat64(sku.SalePrice))
}
orderFmt += `
<L>共%d种%d件商品<BR></L>
<L>实际支付: %s元<BR></L>
<L>共%d种%d件商品</L>
<L>实际支付: %s</L>
`
orderFmt += `<BR><BR>`
orderFmt += xpyunapi.StrRepeat("-", 14) + "#23完" + xpyunapi.StrRepeat("-", 14)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
orderFmt += `<BR>`
orderFmt += xpyunapi.StrRepeat("-", 14) + "#%d完" + xpyunapi.StrRepeat("-", 14)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice), order.OrderSeq)
return fmt.Sprintf(orderFmt, orderParams...)
}
//todo 待修改
func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel string, storeDetail *dao.StoreDetail) (content string) {
expectedDeliveryTime := order.ExpectedDeliveredTime
if utils.IsTimeZero(expectedDeliveryTime) {
@@ -226,11 +230,14 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
if order.VendorID == model.VendorIDEBAI {
getCode = fmt.Sprintf("<CB>饿百取货码:%s</CB>", jxutils.GetEbaiOrderGetCode(order))
}
if order.BuyerComment == "" {
order.BuyerComment = "客户电话: " + order.ConsigneeMobile + ",配送遇到问题,可联系18048531223取消配送单,禁止未配送直接完成订单!"
}
orderParams := []interface{}{}
orderFmt := ``
if storeDetail != nil {
if storeDetail.BrandIsPrint == model.NO {
orderFmt += `<BR><C>%s</C></BR>\n`
orderFmt += `<C><B>%s</B><C>`
if order.VendorOrgCode == "34665" {
orderParams = append(orderParams, globals.StoreNameEbai2)
} else {
@@ -240,21 +247,21 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
}
orderFmt += `
` + xpyunapi.StrRepeat("-", 32) + `
<BR><L>下单时间: %s</BR>
<BR><L>预计送达: %s</BR>
<BR><L>客户姓名: %s</BR>
<BR><L>客户电话: %s</BR>
<BR><HB>订单编号: %s</HB></BR>
<IMG></IMG><BR><C><B>%s: #%d</B></BR></C>
<C><QRCODE s=6 e=L l=center>%s</QRCODE></C>"
` + getCode + `
<HB><L>下单时间: %s
<L>预计送达: %s
<L>客户姓名: %s
<L>客户电话: %s</HB><BR>
<HB2>订单编号: %s</HB2><BR>
<CB>%s#%d
<C><QRCODE s=6 e=L l=center>%s</QRCODE></C></CB>
` + getCode +
xpyunapi.StrRepeat("-", 32) + `
<HB>客户地址: %s</HB>
` + xpyunapi.StrRepeat("-", 32) + `<HB>客户备注: %s
` + xpyunapi.StrRepeat("-", 32) + `
<HB>客户地址: %s</HB><BR>
` + xpyunapi.StrRepeat("-", 32) + `
<BR>客户备注: %s<BR>
` + xpyunapi.StrRepeat("-", 32) + `
<BR>商品列表 ` + xpyunapi.StrRepeat("-", 6) + `<BR>
商品名` + xpyunapi.StrRepeat("-", 2) + `数量` + xpyunapi.StrRepeat("-", 3) + `单价` + xpyunapi.StrRepeat("-", 5) + `小计<BR>"
商品列表
商品名` + xpyunapi.StrRepeat(" ", 2) + `数量` + xpyunapi.StrRepeat(" ", 3) + `单价` + xpyunapi.StrRepeat(" ", 5) + `小计</HB>
` + xpyunapi.StrRepeat("-", 32) + "<HB>" + `
`
orderParams = append(orderParams,
utils.Time2Str(order.OrderCreatedAt),
@@ -272,12 +279,11 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
for _, sku := range order.Skus {
orderFmt += xpyunapi.FormatPrintOrderItem(sku.SkuName, sku.Count, utils.Int64ToFloat64(sku.SalePrice))
}
orderFmt += `
<L>共%d种%d件商品<BR></L>
<L>实际支付: %s元<BR></L>
` + xpyunapi.StrRepeat("-", 2) + `
orderFmt += `<L>共%d种%d件商品</L>
<L>实际支付: %s</L>
`
orderFmt += `<BR><BR>`
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
orderFmt += `<BR>`
orderFmt += xpyunapi.StrRepeat("-", 14) + "#%d完</HB>" + xpyunapi.StrRepeat("-", 14)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice), order.OrderSeq)
return fmt.Sprintf(orderFmt, orderParams...)
}