1
This commit is contained in:
@@ -114,6 +114,45 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
||||
return fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...)
|
||||
}
|
||||
|
||||
//退货/取消订单 正常尺寸模板
|
||||
func (c *PrinterHandler) getCancelOrRefundOrderContent(order *model.GoodsOrder, printType int, storeDetail *dao.StoreDetail) (content string) {
|
||||
orderParams := []interface{}{}
|
||||
orderFmt := ``
|
||||
if storeDetail.BrandIsPrint == model.NO {
|
||||
orderFmt += `
|
||||
<S2><C>%s</C></S2><RN><RN>
|
||||
`
|
||||
if order.VendorOrgCode == "34665" {
|
||||
orderParams = append(orderParams, globals.StoreNameEbai2)
|
||||
} else {
|
||||
orderParams = append(orderParams, storeDetail.BrandName)
|
||||
}
|
||||
}
|
||||
|
||||
if printType == model.YES { // 取消订单
|
||||
orderFmt = `<C>取消订单详情</C><RN>`
|
||||
} else { // 售后订单
|
||||
orderFmt = `<C>售后清淡详情</C><RN>`
|
||||
}
|
||||
|
||||
orderFmt += `********************************
|
||||
<S2>下单时间: %s<RN><RN></S2>
|
||||
<S2>订单编号: %s<RN></S2>
|
||||
<RN>
|
||||
<S2>%s#%d</S2><RN><RN>
|
||||
<S2><B1>共%d种%d件商品</B1></S2>
|
||||
<RN>`
|
||||
|
||||
orderParams = append(orderParams,
|
||||
utils.Time2Str(order.OrderCreatedAt),
|
||||
order.VendorOrderID,
|
||||
jxutils.GetVendorName(order.VendorID),
|
||||
order.OrderSeq,
|
||||
)
|
||||
orderParams = append(orderParams, order.SkuCount, order.GoodsCount)
|
||||
return fmt.Sprintf(strings.Replace(orderFmt, "\n", "", -1), orderParams...)
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel string, storeDetail *dao.StoreDetail) (content string) {
|
||||
expectedDeliveryTime := order.ExpectedDeliveredTime
|
||||
if utils.IsTimeZero(expectedDeliveryTime) {
|
||||
@@ -241,7 +280,16 @@ func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store,
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
||||
return nil, err
|
||||
if len(order.Skus) == 0 {
|
||||
return
|
||||
}
|
||||
content := c.getCancelOrRefundOrderContent(order, printType, storeDetail)
|
||||
|
||||
if content == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return c.PrintMsg(ctx, store.PrinterSN, store.PrinterKey, order.VendorOrderID, content)
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) RegisterPrinter(ctx *jxcontext.Context, deviceID, deviceSecret, printerName string, storeID int64) (notUsed1, notUsed2 string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user