...
|
...
|
@@ -74,7 +74,7 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
set;
|
|
|
}
|
|
|
|
|
|
public bool IsThreadNeedRun
|
|
|
public static bool IsThreadNeedRun
|
|
|
{
|
|
|
get;
|
|
|
set;
|
...
|
...
|
@@ -83,7 +83,7 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
public MainService()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
IsThreadNeedRun = true;
|
|
|
IsThreadNeedRun = false;
|
|
|
ConnectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
|
|
|
QmName = ConfigurationManager.AppSettings["qmName"];
|
|
|
QueueInName = ConfigurationManager.AppSettings["queueInName"];
|
...
|
...
|
@@ -96,10 +96,17 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
{
|
|
|
try
|
|
|
{
|
|
|
Log.WriteLog("9systemlog", "订阅服务开启");
|
|
|
IsThreadNeedRun = true;
|
|
|
ServiceThread = new Thread(StartServiceThread_IMF);
|
|
|
ServiceThread.Start();
|
|
|
//change by mrz 解决子线程异常退出的问题
|
|
|
while (true)
|
|
|
{
|
|
|
if (!IsThreadNeedRun && !ServiceThread.IsAlive)
|
|
|
{
|
|
|
ServiceThread = new Thread(StartServiceThread_IMF);
|
|
|
ServiceThread.Start();
|
|
|
Log.WriteLog("9systemlog", "订阅服务开启");
|
|
|
}
|
|
|
Thread.Sleep(5000);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
...
|
...
|
@@ -179,6 +186,7 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
|
|
|
public void StartServiceThread_IMF(object obj)
|
|
|
{
|
|
|
IsThreadNeedRun = true;
|
|
|
string connectionString = ConnectionString;
|
|
|
while (IsThreadNeedRun)
|
|
|
{
|
...
|
...
|
@@ -262,6 +270,7 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
}
|
|
|
}catch(IOException e){
|
|
|
Log.WriteLog("9systemlog", e.ToString()+"IOerror");
|
|
|
IsThreadNeedRun = false;
|
|
|
}
|
|
|
Thread.Sleep(500);
|
|
|
}
|
...
|
...
|
@@ -269,7 +278,7 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
|
|
|
protected override void OnStop()
|
|
|
{
|
|
|
IsThreadNeedRun = false;
|
|
|
IsThreadNeedRun = true;
|
|
|
try
|
|
|
{
|
|
|
ServiceThread.Abort();
|
...
|
...
|
@@ -425,6 +434,18 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
text = arrivedMaster.WAYBILLNOMASTER;
|
|
|
Log.WriteMessage("FSU_FOH", arrivedMaster.WAYBILLNOMASTER, xmlDoc.InnerXml);
|
|
|
string masterid = "";
|
|
|
// add by mrz校验预配件数重量,件重对不上转人工发送
|
|
|
DateTime pre_flightDate = DateTime.Parse(arrivedMaster.FLIGHTDATE).Date;
|
|
|
IEnumerable<Model.PrepareMaster> premaster_result = CustomsCargoSystem.Data.PrepareMaster.query_preparemaster(connectionString, arrivedMaster.CARRIER, arrivedMaster.FLIGHTNO, pre_flightDate, arrivedMaster.WAYBILLNOMASTER);
|
|
|
if (premaster_result.Count() > 0)
|
|
|
{
|
|
|
Model.PrepareMaster pre_configured = premaster_result.FirstOrDefault();
|
|
|
if (pre_configured.totalweight != arrivedMaster.ARRIVEDTOTALWEIGHT && pre_configured.totalpiece != arrivedMaster.ARRIVEDTOTALPIECE)
|
|
|
{
|
|
|
arrivedMaster.STATUS = "17";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
num = CustomsCargoSystem.Data.ArrivedMaster.Save(connectionString, arrivedMaster, out masterid);
|
|
|
if (num > 0 && !string.IsNullOrEmpty(masterid))
|
|
|
{
|
...
|
...
|
@@ -439,6 +460,19 @@ namespace CustomsCargoSystem.ExchangeDataStorageService |
|
|
{
|
|
|
CustomsCargoSystem.Model.ArrivedSecondary arrivedSecondary = CustomsCargoSystem.Parser.ArrivedSecondary.Parse(xmlDoc);
|
|
|
Log.WriteMessage("FZE_FOH", arrivedSecondary.WAYBILLNOMASTER, xmlDoc.InnerXml);
|
|
|
|
|
|
// add by mrz校验预配件数重量,件重对不上转人工发送
|
|
|
DateTime pre_flightDate = arrivedSecondary.FLIGHTDATE.Date;
|
|
|
IEnumerable<CustomsCargoSystem.Model.PrepareSecondary> source = CustomsCargoSystem.Data.PrepareSecondary.querydatabywaybillnosecondary(connectionString, arrivedSecondary.WAYBILLNOMASTER, arrivedSecondary.WAYBILLNOSECONDARY);
|
|
|
if (source.Count() > 0)
|
|
|
{
|
|
|
Model.PrepareSecondary pre_configured = source.FirstOrDefault();
|
|
|
if (pre_configured.prepareweight != arrivedSecondary.ARRIVEDTOTALWEIGHT && pre_configured.preparepiece != arrivedSecondary.ARRIVEDTOTALPIECE)
|
|
|
{
|
|
|
arrivedSecondary.status = "17";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
num = CustomsCargoSystem.Data.ArrivedSecondary.Save(connectionString, arrivedSecondary);
|
|
|
}
|
|
|
if ("UDEP" == innerText2)
|
...
|
...
|
|