查打印机状态
This commit is contained in:
@@ -340,3 +340,26 @@ func (c *ApiController) GetPrintMsg(dataMap map[string]interface{}) (data, errCo
|
||||
}
|
||||
return data, errCode, err
|
||||
}
|
||||
|
||||
//查询打印机状态
|
||||
func (c *ApiController) GetPrinterStatus(dataMap map[string]interface{}) (data, errCode string, err error) {
|
||||
var (
|
||||
printNo string
|
||||
appID int
|
||||
)
|
||||
globals.SugarLogger.Debugf("Begin API GetPrinterStatus data: [%v]", utils.Format4Output(dataMap, false))
|
||||
if _, ok := dataMap[keyPrintNo].(string); !ok {
|
||||
return buildParamErrCodeAndErr(keyPrintNo)
|
||||
} else {
|
||||
if printNo = dataMap[keyPrintNo].(string); printNo == "" {
|
||||
return buildParamErrCodeAndErr(keyPrintNo)
|
||||
}
|
||||
}
|
||||
appID = dataMap[keyAppID].(int)
|
||||
if status, err := cms.GetPrinterStatus(appID, printNo); err != nil {
|
||||
return "", model.ErrCodeGeneralFailed, err
|
||||
} else {
|
||||
return utils.Int2Str(status), errCode, err
|
||||
}
|
||||
return data, errCode, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user