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