aa
This commit is contained in:
@@ -24,6 +24,10 @@ func AddPrinters(c *gin.Context, tokenInfo *model.TokenInfo, appID int, printInf
|
||||
return fmt.Errorf("未查询到此应用!app_id:%d", appID)
|
||||
}
|
||||
for _, v := range printInfos {
|
||||
if v.PrintNo == "" {
|
||||
errs = append(errs, fmt.Errorf("请输入正确的打印机编号!print_no :%s 。", v.PrintNo))
|
||||
continue
|
||||
}
|
||||
printers, _ := dao.GetPrinters(db, appID, v.PrintNo)
|
||||
if len(printers) > 0 {
|
||||
errs = append(errs, fmt.Errorf("此打印机已被其他应用绑定!print_no :%s 。", v.PrintNo))
|
||||
@@ -68,6 +72,10 @@ func DelPrinters(c *gin.Context, appID int, tokenInfo *model.TokenInfo, printNos
|
||||
return fmt.Errorf("未查询到此应用!app_id:%d", appID)
|
||||
}
|
||||
for _, v := range printNos {
|
||||
if v == "" {
|
||||
errs = append(errs, fmt.Errorf("请输入正确的打印机编号!print_no :%s 。", v))
|
||||
continue
|
||||
}
|
||||
printers, _ := dao.GetPrinters(db, appID, v)
|
||||
if len(printers) == 0 {
|
||||
errs = append(errs, fmt.Errorf("未在该应用下查到此打印机!app_id: %d, print_no: %s", appID, v))
|
||||
|
||||
Reference in New Issue
Block a user