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);