|
@@ -204,9 +204,9 @@ namespace SCADA_DAQ.Customer.Machines
|
|
if (ServerConncetStatus)
|
|
if (ServerConncetStatus)
|
|
{
|
|
{
|
|
NotConnctNumberOfTimes++;
|
|
NotConnctNumberOfTimes++;
|
|
- bool toBeProduced;
|
|
|
|
- bool inProduction;
|
|
|
|
- bool produced;
|
|
|
|
|
|
+ bool toBeProduced = false;
|
|
|
|
+ bool inProduction = false;
|
|
|
|
+ bool produced = false;
|
|
var taskInfoItem = DAL.APP_TaiLing_TaskManagement.GetData<TaskManagementModel>()?
|
|
var taskInfoItem = DAL.APP_TaiLing_TaskManagement.GetData<TaskManagementModel>()?
|
|
.Where(t => t.WorkShopId == CustomerEnv.ProductionLineConfigValue.WorkShopId
|
|
.Where(t => t.WorkShopId == CustomerEnv.ProductionLineConfigValue.WorkShopId
|
|
&& t.ProductionLineId == CustomerEnv.ProductionLineConfigValue.ProductionLineId && t.OrderState != "已生产")
|
|
&& t.ProductionLineId == CustomerEnv.ProductionLineConfigValue.ProductionLineId && t.OrderState != "已生产")
|
|
@@ -224,7 +224,7 @@ namespace SCADA_DAQ.Customer.Machines
|
|
);
|
|
);
|
|
Log.Info($"订单{taskInfoItem.OrderId}开始生产");
|
|
Log.Info($"订单{taskInfoItem.OrderId}开始生产");
|
|
}
|
|
}
|
|
- else if (taskInfoItem.CurrentProduction >= taskInfoItem.ScheduledProduction)
|
|
|
|
|
|
+ else if (taskInfoItem.CurrentProduction + 1 >= taskInfoItem.ScheduledProduction)
|
|
{
|
|
{
|
|
// 结束生产
|
|
// 结束生产
|
|
var dateDiff = (DateTime.Now - taskInfoItem.WorkStartTime).TotalSeconds.ToInt(); // 时间差/s
|
|
var dateDiff = (DateTime.Now - taskInfoItem.WorkStartTime).TotalSeconds.ToInt(); // 时间差/s
|
|
@@ -239,11 +239,14 @@ namespace SCADA_DAQ.Customer.Machines
|
|
else if (taskInfoItem.WorkStartTime != new DateTime() && taskInfoItem.OrderState == "生产中")
|
|
else if (taskInfoItem.WorkStartTime != new DateTime() && taskInfoItem.OrderState == "生产中")
|
|
{
|
|
{
|
|
inProduction = DAL.APP_TaiLing_TaskManagement.Update($"ID={taskInfoItem.ID}",
|
|
inProduction = DAL.APP_TaiLing_TaskManagement.Update($"ID={taskInfoItem.ID}",
|
|
- new UpdateItem(SqlSchema.DBNames.T_Col_Name.APP_TaiLing_TaskManagement.CurrentProduction_Int, taskInfoItem.CurrentProduction + 1 + NotConnctNumberOfTimes)
|
|
|
|
|
|
+ new UpdateItem(SqlSchema.DBNames.T_Col_Name.APP_TaiLing_TaskManagement.CurrentProduction_Int, taskInfoItem.CurrentProduction + NotConnctNumberOfTimes)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
NumberOfTimes = 0;
|
|
NumberOfTimes = 0;
|
|
- NotConnctNumberOfTimes = 0;
|
|
|
|
|
|
+ if (toBeProduced || produced || inProduction)
|
|
|
|
+ {
|
|
|
|
+ NotConnctNumberOfTimes = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|