Browse Source

tod 条件修改

master
娄文智 3 years ago
parent
commit
df487d7e20
2 changed files with 11 additions and 9 deletions
  1. +1
    -1
      db/Pln_custorder_ver.go
  2. +10
    -8
      tod/Todtask.go

+ 1
- 1
db/Pln_custorder_ver.go View File

@ -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
}


+ 10
- 8
tod/Todtask.go View File

@ -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 {


Loading…
Cancel
Save