- json for PrinterStatus
This commit is contained in:
@@ -17,15 +17,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type PrinterStatus struct {
|
type PrinterStatus struct {
|
||||||
PrintResult int // 0:成功,1:没有配置网络打印机
|
PrintResult int `json:"printResult"` // 0:成功,1:没有配置网络打印机
|
||||||
|
|
||||||
// PrinterStatusUnknown = 0
|
// PrinterStatusUnknown = 0
|
||||||
// PrinterStatusOffline = 1
|
// PrinterStatusOffline = 1
|
||||||
// PrinterStatusOnlineOK = 2
|
// PrinterStatusOnlineOK = 2
|
||||||
// PrinterStatusOnlineAbnormal = 3
|
// PrinterStatusOnlineAbnormal = 3
|
||||||
PrinterStatus int
|
PrinterStatus int `json:"printerStatus"`
|
||||||
Printed int // 已经打印的单数
|
Printed int `json:"printed"` // 已经打印的单数
|
||||||
Waiting int // 等待打印的单数,超过1一般不太正常
|
Waiting int `json:"waiting"` // 等待打印的单数,超过1一般不太正常
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -151,8 +151,10 @@ func GetNetPrinterStatus(ctx *jxcontext.Context, storeID int) (printResult *Prin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getNetPrinterStatus(ctx *jxcontext.Context, sn string) (printResult *PrinterStatus, err error) {
|
func getNetPrinterStatus(ctx *jxcontext.Context, sn string) (printResult *PrinterStatus, err error) {
|
||||||
printResult = &PrinterStatus{}
|
printResult = &PrinterStatus{
|
||||||
if printResult.PrintResult, err = api.FeieAPI.QueryPrinterStatus(sn); err == nil {
|
PrintResult: PrintResultSuccess,
|
||||||
|
}
|
||||||
|
if printResult.PrinterStatus, err = api.FeieAPI.QueryPrinterStatus(sn); err == nil {
|
||||||
printResult.Printed, printResult.Waiting, err = api.FeieAPI.QueryOrderInfoByDate(sn, time.Now())
|
printResult.Printed, printResult.Waiting, err = api.FeieAPI.QueryOrderInfoByDate(sn, time.Now())
|
||||||
}
|
}
|
||||||
return printResult, nil
|
return printResult, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user