添加京西云打印机
This commit is contained in:
@@ -63,7 +63,7 @@ type IPrinterHandler interface {
|
||||
RebindPrinter(ctx *jxcontext.Context, lastBindResult *BindPrinterResult) (bindResult *BindPrinterResult, err error)
|
||||
|
||||
PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder, printType string) (printerStatus *PrinterStatus, err error)
|
||||
PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *PrinterStatus, err error)
|
||||
PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorId int) (printerStatus *PrinterStatus, err error)
|
||||
PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *PrinterStatus, err error)
|
||||
|
||||
EmptyPrintList(ctx *jxcontext.Context, id1, id2 string) (err error)
|
||||
|
||||
@@ -265,7 +265,7 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
||||
return c.PrintMsg(ctx, store.PrinterSN, store.PrinterKey, order.VendorOrderID, content)
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorId int) (printerStatus *partner.PrinterStatus, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -236,6 +236,9 @@ func (c *PrinterHandler) getOrderContentByTemplate(order *model.GoodsOrder, stor
|
||||
|
||||
func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
globals.SugarLogger.Debugf("jxprint PrintOrderByOrder orderID:%s, storeID:%d", order.VendorOrderID, store.ID)
|
||||
if storeDetail.PrinterVendorID != model.VendorIDJxprint {
|
||||
return nil, nil
|
||||
}
|
||||
if len(order.Skus) == 0 {
|
||||
return
|
||||
}
|
||||
@@ -268,13 +271,18 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
||||
return c.PrintMsg(ctx, store.PrinterSN, order.VendorOrderID, "", string(orderPrint))
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
// PrintStore 打印门店
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorCode int) (printerStatus *partner.PrinterStatus, err error) {
|
||||
data := make(map[string]interface{}, 0)
|
||||
data[StoreStatus] = utils.Int2Str(store.Status) // 门店状态
|
||||
data[StoreStatus] = utils.Int2Str(store.Status) // 门店状态
|
||||
data[StoreStatus] = utils.Int2Str(store.Status) // 门店状态
|
||||
data[StoreStatus] = utils.Int2Str(store.Status)
|
||||
data[StoreName] = storeDetail.VendorStoreName
|
||||
data[VendorName] = model.VendorChineseNames[vendorCode]
|
||||
orderPrint, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, err
|
||||
return c.PrintMsg(ctx, store.PrinterSN, "", "", string(orderPrint))
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
||||
|
||||
@@ -307,7 +307,7 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
||||
return c.PrintMsg(ctx, store.PrinterSN, store.PrinterKey, order.VendorOrderID, content)
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorId int) (printerStatus *partner.PrinterStatus, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorId int) (printerStatus *partner.PrinterStatus, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
||||
return c.PrintMsg(ctx, store.PrinterSN, store.PrinterKey, order.VendorOrderID, content)
|
||||
}
|
||||
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, printType string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, vendorId int) (printerStatus *partner.PrinterStatus, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -329,18 +329,18 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorOrgCode s
|
||||
// 当前京东的storeCrud消息不会在门店状态改变时发送,所以意义不大,先放在这里
|
||||
func (c *PurchaseHandler) OnStoreMsg(vendorOrgCode string, msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
|
||||
var err error
|
||||
// if msg.StatusID == jdapi.StatusIDUpdateStore {
|
||||
// var storeStatus int
|
||||
// vendorStoreID := msg.BillID
|
||||
// if storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorStoreID); err == nil {
|
||||
// err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDJD, storeStatus)
|
||||
// } else {
|
||||
// // 可能在门店删除的情况下会出查不到门店的错误
|
||||
// if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == 4 {
|
||||
// err = nil
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if msg.StatusID == jdapi.StatusIDUpdateStore {
|
||||
var storeStatus int
|
||||
vendorStoreID := msg.BillID
|
||||
if storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorOrgCode, 0, vendorStoreID); err == nil {
|
||||
err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDJD, storeStatus)
|
||||
} else {
|
||||
// 可能在门店删除的情况下会出查不到门店的错误
|
||||
if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == 4 {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return jdapi.Err2CallbackResponse(err, "")
|
||||
}
|
||||
|
||||
|
||||
@@ -560,12 +560,10 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
|
||||
err = callNewOrder(order)
|
||||
//如果是物料的订单,直接到拣货完成,配送中的状态
|
||||
if order.OrderType != model.OrderTypeNormal {
|
||||
// if order.FromStoreID != 0 {
|
||||
if order.OrderType != model.OrderTypeDefendPrice {
|
||||
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order, model.PrintTypeOrder)
|
||||
}
|
||||
PickupGoods(order, false, "jxadmin")
|
||||
// }
|
||||
} else {
|
||||
//普通的订单要看用没用优惠券,用了的话,要把这个用户用过的优惠券状态改了
|
||||
if order.CouponIDs != "" {
|
||||
|
||||
Reference in New Issue
Block a user