From df487d7e20870b289edf68287b503b9400249a95 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Thu, 2 Sep 2021 10:40:41 +0800 Subject: [PATCH] =?UTF-8?q?tod=20=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/Pln_custorder_ver.go | 2 +- tod/Todtask.go | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/db/Pln_custorder_ver.go b/db/Pln_custorder_ver.go index bc3eb79..d5809e8 100644 --- a/db/Pln_custorder_ver.go +++ b/db/Pln_custorder_ver.go @@ -126,7 +126,7 @@ func (t *Pln_custorder_ver) SelectOne() (data Pln_custorder_ver, err error) { func (t *Pln_custorder_ver) SelectInfo() bool { var data Pln_custorder_ver e := G_DbEngine - ok, err := e.Table("pln_custorder_ver").Where("finr = ? and custordernr = ? and version < ? and seqmode = ? and parsed = ?", G_FINR, t.Custordernr, t.Version, 1, 0).Get(&data) + ok, err := e.Table("pln_custorder_ver").In("parsed",common.EDI_PARSE_NO,common.EDI_PARSE_ERROR).Where("finr = ? and custordernr = ? and version < ?", G_FINR, t.Custordernr, t.Version).Get(&data) if err != nil { return false } diff --git a/tod/Todtask.go b/tod/Todtask.go index b0ee33d..e309c44 100644 --- a/tod/Todtask.go +++ b/tod/Todtask.go @@ -200,10 +200,10 @@ func ParseTodCustorderNew() { perInfo.Custordernr = vcovlst[j].Pln_custorder_ver.Custordernr perInfo.Version = vcovlst[j].Pln_custorder_ver.Version res := perInfo.SelectInfo() - glog.InfoExtln("tod","Custordernr", vcovlst[j].Pln_custorder_ver.Custordernr) - glog.InfoExtln("tod","Version",vcovlst[j].Pln_custorder_ver.Version) - glog.InfoExtln("tod","上一版本Version",perInfo.Version) - glog.InfoExtln("tod","result",res) + glog.InfoExtln("tod", "Custordernr", vcovlst[j].Pln_custorder_ver.Custordernr) + glog.InfoExtln("tod", "Version", vcovlst[j].Pln_custorder_ver.Version) + glog.InfoExtln("tod", "上一版本Version", perInfo.Version) + glog.InfoExtln("tod", "result", res) if err != nil { glog.InfoExtln("TOD解析创建生产订单", "err is:", err) return @@ -215,7 +215,7 @@ func ParseTodCustorderNew() { if err = SendTodErrorEmail(projtablst[i], mailsubject, mailbody); err != nil { glog.InfoExtln("发送邮件", "err is :", err) } - glog.InfoExtln("tod","result:",mailsubject) + glog.InfoExtln("tod", "result:", mailsubject) continue } } @@ -397,7 +397,8 @@ func ParseTodCustorderNew() { // 保存客户订单的解析错误 // 如果有错误则不再更新后续其它数据 - if len(bl_co.Bl_verrdict) > 0 && bl_co.SeqType != 2 { + //if (len(bl_co.Bl_verrdict) > 0 && bl_co.SeqType != 2) || (bl_co.Parsed != 2 && bl_co.SeqType != 2) { + if len(bl_co.Bl_verrdict) > 0 && bl_co.Parsed != 2 && bl_co.SeqType != 2 { if err = bl_co.SaveParseErrors(session); err != nil { glog.InfoExtln("TOD解析创建生产订单", "Failed to Save CO: parse result due to: ", bl_co.Custordernr, err) bRet = false @@ -409,12 +410,13 @@ func ParseTodCustorderNew() { bRet = false } if bl_co.SeqType != 3 { - glog.InfoExtln("tod","Custordernr:",bl_co.Custordertab.Custordernr) + glog.InfoExtln("tod", "Custordernr:", bl_co.Custordertab.Custordernr) session.Commit() session.Close() etcd.G_jobLock.UnLock() continue } + } } else { bl_co.Custordertab.Handlestatus = common.CO_PARSE_STATUS_OK @@ -438,7 +440,7 @@ func ParseTodCustorderNew() { } } - if bRet || bl_co.Parsed == 2{ + if bRet || bl_co.Parsed == 2 { session.Commit() session.Close() } else {