查打印机状态

This commit is contained in:
suyl
2021-07-01 14:51:27 +08:00
parent 92b6d309e4
commit 3aec25bbdd
3 changed files with 74 additions and 57 deletions

View File

@@ -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
}