From 9d3922a098eed4017150d026604c3cf279a245d7 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Mon, 20 Dec 2021 16:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8D=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/qm/implments/ReclinerReclst.dao.impl.go | 7 +++---- models/base/Const.go | 1 + task/printer.go | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dao/qm/implments/ReclinerReclst.dao.impl.go b/dao/qm/implments/ReclinerReclst.dao.impl.go index 202c23c..59e0c02 100644 --- a/dao/qm/implments/ReclinerReclst.dao.impl.go +++ b/dao/qm/implments/ReclinerReclst.dao.impl.go @@ -106,7 +106,7 @@ func (impl *ReclinerReclstDAOImplement) SelectOne(recNr int) (*model.ReclinerRec ******************************************************************************/ func (impl *ReclinerReclstDAOImplement) SelectSeriOne(orderId string) (*model.ReclinerReclst, error) { var data model.ReclinerReclst - ok, err := impl.session.Table(impl.meta.TableName).Where("PlantNr = ? and SerialOrderId = ? and RecType = ?",impl.plantNr, orderId,model.QM_SERI_TYPE).Get(&data) + ok, err := impl.session.Table(impl.meta.TableName).Where("PlantNr = ? and SerialOrderId = ? and RecType = ?", impl.plantNr, orderId, model.QM_SERI_TYPE).Get(&data) if err != nil { return nil, grmi.NewDataBaseError(err) } @@ -319,7 +319,6 @@ func (impl *ReclinerReclstDAOImplement) UpdateWhere(predicates []grmi.Predicate, return nil } - /****************************************************************************** * * @Reference LAPP_GAAS_GFrame_BACKEND/dao/log/PackOrderDAO.SelectUnPrint @@ -327,7 +326,7 @@ func (impl *ReclinerReclstDAOImplement) UpdateWhere(predicates []grmi.Predicate, ******************************************************************************/ func (impl *ReclinerReclstDAOImplement) SelectUnPrint(num int) ([]model.ReclinerReclst, error) { - session := impl.session.Table(impl.meta.TableName).Where("PlantNr = ? and Status = ?", impl.plantNr, 0, common.UN_PRINT).Asc("RecNr") + session := impl.session.Table(impl.meta.TableName).Where("PlantNr = ? and Status = ?", impl.plantNr, common.UN_PRINT).Asc("RecNr") data := make([]model.ReclinerReclst, 0) err := session.Limit(num).Find(&data) @@ -351,4 +350,4 @@ func (impl *ReclinerReclstDAOImplement) UpdateUnPrint(recIds []int) error { return grmi.NewDataBaseError(err) } return nil -} \ No newline at end of file +} diff --git a/models/base/Const.go b/models/base/Const.go index 848f46a..0f83a9d 100644 --- a/models/base/Const.go +++ b/models/base/Const.go @@ -120,5 +120,6 @@ const ( PRINT_BUSINESS_OBJ_TYPE_PACK = "PACK" UN_PRINT = "N" + ING_PRINT = "P" PRINT = "C" ) diff --git a/task/printer.go b/task/printer.go index 30002c3..8eec0de 100644 --- a/task/printer.go +++ b/task/printer.go @@ -5,6 +5,7 @@ import ( qmsvr "LAPP_GAAS_GFrame_BACKEND/services/qm" model "LAPP_GAAS_GFrame_BACKEND/models/log" qmmodel "LAPP_GAAS_GFrame_BACKEND/models/qm" + "LAPP_GAAS_GFrame_BACKEND/web/middleware/glog" "context" "time" ) @@ -67,7 +68,7 @@ func doTaskPrintPack(ctx context.Context) { var serviceOfPackOrder = svr.NewPackOrderService() err := serviceOfPackOrder.CreatePackOrderPrintInfo(task) if err !=nil{ - return + continue } } } @@ -91,7 +92,9 @@ func CreateRecPrintTask() { var serviceOfRec = qmsvr.NewReclinerReclstService() data, err := serviceOfRec.SelectUnPrint(printNum) + glog.InfoExtln("返修错误","data:",len(data)) if err != nil { + glog.InfoExtln("返修错误","err:",err) return } //锁定 @@ -100,6 +103,7 @@ func CreateRecPrintTask() { } err = serviceOfRec.UpdateUnPrint(recList) if err != nil { + glog.InfoExtln("返修错误","err:",err) time.Sleep(1 * time.Second) continue } @@ -126,7 +130,8 @@ func doTaskPrintRec(ctx context.Context) { var serviceOfRec = qmsvr.NewReclinerReclstService() err := serviceOfRec.CreateRecPrintInfo(task) if err !=nil{ - return + glog.InfoExtln("返修错误","返修错误打印err:",err) + continue } } }