From 0c0565dc0f7af59c9ce72b98de3d418e002e5e79 Mon Sep 17 00:00:00 2001 From: "hao.jin" Date: Wed, 11 May 2022 11:39:46 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=94=9F=E6=88=90?= =?UTF-8?q?ASN=E6=8A=A5=E6=96=87=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8A=A5=E6=96=87=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1=202.?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=AB=AF=E5=A2=9E=E5=8A=A0=E6=8A=A5?= =?UTF-8?q?=E6=96=87=E7=94=9F=E6=88=90=E7=9B=91=E5=90=AC=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=203.LAB=E6=8A=A5=E6=96=87=E8=A7=A3=E6=9E=90=E5=A4=84=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0ASN=E6=8A=A5=E6=96=87=E8=B6=85=E6=97=B6=E6=9C=AA?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E9=82=AE=E4=BB=B6=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JISAdmin/F_EDI_JIS5000Sequence.cs | 37 +++++++++++++++++++ .../Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs | 35 +++++++++++------- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs index 3316c02..652beba 100644 --- a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs +++ b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs @@ -446,6 +446,43 @@ namespace Stone.WinBiz.JISAdmin } + #region 监控ASN报文是否成功生成 + + var strAsnUpLoadsql = "select top 1 * from t_ASN_UPLOAD where isCreate = 0 order by uid "; + var dsAsnUpLoad = db.Exec_DataSet(strAsnUpLoadsql); + if (dsAsnUpLoad.Tables[0].Rows.Count > 0) + { + //获取 ASN报文上传的时间 + var createTime = DateTime.Parse(dsAsnUpLoad.Tables[0].Rows[0]["CreateTime"].ToString()); + var nowTime = DateTime.Now; + TimeSpan timeSpan = nowTime - createTime; + var min = timeSpan.TotalMinutes; + //超出10分钟 报文未生成,则进行预警预警 + if (min > 10) + { + var strErrTypeCode = "08"; + var strsql = "select top 1 * from t_ErrTypeLevel" + + " where Code = '" + strErrTypeCode + "'" + + " order by id desc"; + var dsErrMail = db.Exec_DataSet(strsql); + if (dsErrMail.Tables[0].Rows.Count > 0) + { + //获取收件人 + var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); + var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); + //设置邮件标题 + var title = ""; + title = "服务器器ASN报文生成失败-错误级别-" + errLvevl + "-" + errTypeDesc; + var strDetails = ""; + var asnNum = dsAsnUpLoad.Tables[0].Rows[0]["AsnNum"].ToString(); + strDetails = "ASN【" + asnNum + "】已超出10分钟未生成报文!"; + F_Mail.Send(title, strDetails, mailTo); + } + } + } + + #endregion Msg = strPartMsg; } diff --git a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs index ddcf5d3..5a51346 100644 --- a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs +++ b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs @@ -849,6 +849,12 @@ namespace Stone.WinBiz.JISAdmin List lstName = WriteANSFile_Standard(text, fileType, AsnNumber); FtpASN(lstName[0]); + #region 增加待生成报文数据 金杯李尔不使用FTP服务器 由服务器监听程序进行报文生成 + var strsql = ""; + strsql = "Insert into t_ASN_UPLOAD (AsnNum) values ('" + AsnNumber + "')"; + db.Exec_NonQuery(strsql); + #endregion + return lstName[1]; } @@ -1152,20 +1158,21 @@ namespace Stone.WinBiz.JISAdmin string name = "BMW." + fileType + ".JIT.AVIEXP." + AsnNumber + ""; filename = filename + "\\" + name; - StreamWriter sw = null; - try - { - sw = new StreamWriter(filename, false); - sw.Write(text); - } - catch (Exception ex) - { - throw ex; - } - finally - { - if (sw != null) sw.Close(); - } + //金杯李尔 不在客户端生成ASN报文,统一由服务器生成 + // StreamWriter sw = null; + // try + // { + // sw = new StreamWriter(filename, false); + // sw.Write(text); + // } + // catch (Exception ex) + // { + // throw ex; + // } + // finally + // { + // if (sw != null) sw.Close(); + // } List ret = new List(); ret.Add(filename);