Browse Source

1.客户端生成ASN报文时,增加报文生成任务

2.服务器端增加报文生成监听程序
3.LAB报文解析处增加ASN报文超时未生成的邮件预警
master
hao.jin 3 years ago
parent
commit
0c0565dc0f
  1. 37
      Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs
  2. 35
      Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs

37
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;
}

35
Stone.WinForm/Stone.WinBiz/JISAdmin/F_JIS5000_Print.cs

@ -849,6 +849,12 @@ namespace Stone.WinBiz.JISAdmin
List<string> 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<string> ret = new List<string>();
ret.Add(filename);

Loading…
Cancel
Save