LAPP 打印服务
支持条码打印和表单打印
通过Socket或windows打印方式
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package Engine
|
|
|
|
import (
|
|
conf "LAPP_PRN_Service/config"
|
|
"LAPP_PRN_Service/db"
|
|
"LAPP_PRN_Service/glog"
|
|
)
|
|
|
|
// 启动保存服务
|
|
// 同时通过协程从该管道中收取已完成的打印任务更新到数据库中
|
|
func StartSaver(conf *conf.EnvConfig,c chan db.PrintTask) {
|
|
|
|
go func() {
|
|
for {
|
|
// 从管道获取要保存的任务
|
|
task := <-c
|
|
// 关闭打印任务
|
|
m := new(db.PrintTask)
|
|
err := m.ChangePrintTaskStatus(task, "C")
|
|
if err != nil {
|
|
glog.InfoExtln("Printer","Failed to close the print task :", task)
|
|
}
|
|
}
|
|
}()
|
|
}
|