This commit is contained in:
邹宗楠
2024-01-08 10:35:33 +08:00
parent b2b52b336c
commit f95d55a8d2
5 changed files with 87 additions and 29 deletions

View File

@@ -333,7 +333,7 @@ func DelPrinterSeq(appID int, printNo string) (err error) {
if printers, _ := dao.GetPrinters(db, appID, printNo, 0, 0); len(printers) == 0 {
return fmt.Errorf("该应用下未找到该打印机print_no : %v", printNo)
} else {
printMsgs, _ := dao.GetPrintMsgs(db, printNo, "", model.PrintMsgAll, model.PrintMsgSuccess)
printMsgs, _ := dao.GetPrintMsgs2(db, printNo, "", model.PrintMsgAll, model.PrintMsgSuccess)
for _, v := range printMsgs {
v.DeletedAt = time.Now()
if _, err = dao.UpdateEntity(db, v, "DeletedAt"); err != nil {
@@ -399,7 +399,7 @@ func GetPrintMsg(appID int, msgID string) (printMsg *GetPrintMsgResult, err erro
var (
db = dao.GetDB()
)
if printMsgs, _ := dao.GetPrintMsgs(db, "", msgID, model.PrintMsgAll, model.PrintMsgAll); len(printMsgs) > 0 {
if printMsgs, _ := dao.GetPrintMsgs2(db, "", msgID, model.PrintMsgAll, model.PrintMsgAll); len(printMsgs) > 0 {
result := printMsgs[0]
printMsg = &GetPrintMsgResult{
MsgID: result.MsgID,
@@ -441,27 +441,3 @@ func GetPrinterStatus(appID int, printNo string) (status int, err error) {
//return status, nil
}
}
func connHandler(c net.Conn, printInfo *PrintInfo) (status int) {
defer c.Close()
//缓冲
buf := make([]byte, 1024)
data, _ := json.Marshal(printInfo)
//写入数据
c.Write(data)
//服务器端返回的数据写入buf
n, _ := c.Read(buf)
status = utils.Str2Int(string(buf[:n]))
//服务器端回传的信息
fmt.Println("server response:", string(buf[:n]))
return status
}
//#region 打印机拼装模板
// QueryPrinterSetting 查询用户设置
func QueryPrinterSetting() {
}
//#endregion 打印机