|
|
@ -65,7 +65,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
protected readonly IProductPlanInfoServices _productPlanInfoServices;
|
|
|
|
protected readonly IProductPlanInfoServices _productPlanInfoServices;
|
|
|
|
protected readonly ISysUserInfoServices? _sysUserInfoServices;
|
|
|
|
protected readonly ISysUserInfoServices? _sysUserInfoServices;
|
|
|
|
protected readonly IMaterialCompletionServices? _materialCompletionServices;
|
|
|
|
protected readonly IMaterialCompletionServices? _materialCompletionServices;
|
|
|
|
protected readonly ISmSyncModelServices? _smSyncModelServices;
|
|
|
|
protected readonly ISmSyncModelServices? _smSyncModelServices;
|
|
|
|
public HwPLc.PlcModel obj_backPanel = null;
|
|
|
|
public HwPLc.PlcModel obj_backPanel = null;
|
|
|
|
public HwPLc.PlcModel obj_sidePanel = null;
|
|
|
|
public HwPLc.PlcModel obj_sidePanel = null;
|
|
|
|
bool backFlag = true;//后板标识
|
|
|
|
bool backFlag = true;//后板标识
|
|
|
@ -134,11 +134,11 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
#region 完成任务执行
|
|
|
|
#region 完成任务执行
|
|
|
|
public async Task ExecUpdateComplatePlan()
|
|
|
|
public async Task ExecUpdateComplatePlan()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
|
|
|
//System.Timers.Timer timer = new System.Timers.Timer(1000);
|
|
|
|
timer.Elapsed += new System.Timers.ElapsedEventHandler(UpdateComplatePlan);
|
|
|
|
//timer.Elapsed += new System.Timers.ElapsedEventHandler(UpdateComplatePlan);
|
|
|
|
timer.AutoReset = true;
|
|
|
|
//timer.AutoReset = true;
|
|
|
|
timer.Enabled = true;
|
|
|
|
//timer.Enabled = true;
|
|
|
|
timer.Start();
|
|
|
|
//timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
await Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -155,12 +155,12 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
timer.Start();
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
await Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public Task SheetMetalTasks()
|
|
|
|
public Task SheetMetalTasks()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
return Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -191,56 +191,61 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>未获取到需要下发的前板任务");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>未获取到需要下发的前板任务");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
planInfoList = planInfoList.Where(d => d.PlanAmount > d.SidePanelAmount && (d.ExecuteStatus == 1 || d.ExecuteStatus == 2) && d.PlanType == 2).ToList();
|
|
|
|
planInfoList = planInfoList.Where(d => d.PlanAmount > d.SidePanelAmount && (d.ExecuteStatus == 1 || d.ExecuteStatus == 2)).ToList();
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0) return;
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0) return;
|
|
|
|
planInfoList = planInfoList.Where(d => d.ExecuteStatus == 1 || d.ExecuteStatus == 2).ToList();
|
|
|
|
//planInfoList = planInfoList.Where(d => d.ExecuteStatus == 1 || d.ExecuteStatus == 2).ToList();
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0) return;
|
|
|
|
//if (planInfoList == null || planInfoList.Count == 0) return;
|
|
|
|
var planInfos = planInfoList.Where(d => d.PlanType == 2).ToList();
|
|
|
|
var planInfos = planInfoList.Where(d => d.PlanType == 2 || d.PlanType == 1).ToList();
|
|
|
|
if (planInfos != null)
|
|
|
|
if (planInfos != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (planInfos.Count > 0)
|
|
|
|
if (planInfos.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SheetMetaSendPlanInfoView planInfo = planInfos.FirstOrDefault(d => d.SidePanelAmount != d.PlanAmount);
|
|
|
|
do
|
|
|
|
if (planInfo == null) return;
|
|
|
|
|
|
|
|
if (planInfo.PlanType == 2)//如果类型为2,前板计划单独下发
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Bin> binList = GetSideBinStatus(obj_sidePanel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "0").Result;
|
|
|
|
|
|
|
|
if (smSyncModel == null) return;
|
|
|
|
|
|
|
|
Bin bin = binList.SingleOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
|
|
|
|
if (bin == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SendPlanTaskToSidPanel(planInfo, obj_sidePanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
SheetMetaSendPlanInfoView planInfo = planInfos.FirstOrDefault(d => d.SidePanelAmount != d.PlanAmount);
|
|
|
|
|
|
|
|
if (planInfo == null) return;
|
|
|
|
|
|
|
|
if (planInfo.PlanType == 2)//如果类型为2,前板计划单独下发
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Bin> binList = GetSideBinStatus(obj_sidePanel);
|
|
|
|
|
|
|
|
|
|
|
|
//UpdateSidPanelPlanTaskByComplate(planInfo);
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "0").Result;
|
|
|
|
// sideFlag = false;
|
|
|
|
if (smSyncModel == null) return;
|
|
|
|
}
|
|
|
|
Bin bin = binList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
if (planInfo.PlanType == 1)
|
|
|
|
if (bin == null) return;
|
|
|
|
{
|
|
|
|
|
|
|
|
//联合下发,检测前后板是否都设置了此型号,如果没有执行下一条任务
|
|
|
|
SendPlanTaskToSidPanel(planInfo, obj_sidePanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
List<Bin> backBinList = GetBackBinStatus(obj_backPanel);
|
|
|
|
|
|
|
|
List<Bin> sideBinList = GetSideBinStatus(obj_sidePanel);
|
|
|
|
//UpdateSidPanelPlanTaskByComplate(planInfo);
|
|
|
|
if (backBinList != null && sideBinList != null)
|
|
|
|
// sideFlag = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (planInfo.PlanType == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "2").Result;
|
|
|
|
//联合下发,检测前后板是否都设置了此型号,如果没有执行下一条任务
|
|
|
|
Bin backBin = backBinList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
List<Bin> backBinList = GetBackBinStatus(obj_backPanel);
|
|
|
|
Bin sideBin = sideBinList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
List<Bin> sideBinList = GetSideBinStatus(obj_sidePanel);
|
|
|
|
if (backBin == null || sideBin == null)
|
|
|
|
if (backBinList != null && sideBinList != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
planInfos.Remove(planInfo);//移除list中当前的对象,执行下一个计划
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "1").Result;
|
|
|
|
|
|
|
|
Bin backBin = backBinList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
|
|
|
|
Bin sideBin = sideBinList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
|
|
|
|
if (backBin == null || sideBin == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
planInfos.Remove(planInfo);//移除list中当前的对象,执行下一个计划
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"移除数据:{planInfo.ToJson()}");
|
|
|
|
Console.WriteLine($"移除数据:{planInfo.ToJson()}");
|
|
|
|
//sideFlag = true;
|
|
|
|
sideFlag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SendPlanTaskToSidPanel(planInfo, obj_sidePanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
SendPlanTaskToSidPanel(planInfo, obj_sidePanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
//UpdateSidPanelPlanTaskByComplate(planInfo);
|
|
|
|
//UpdateSidPanelPlanTaskByComplate(planInfo);
|
|
|
|
// sideFlag = false;
|
|
|
|
sideFlag = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (sideFlag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -279,35 +284,38 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Task.Run(() =>
|
|
|
|
//Task.Run(() =>
|
|
|
|
//{
|
|
|
|
//{
|
|
|
|
|
|
|
|
//循环读取PLC应答信号,PLC应答后复位应答信号、更新计划状态为执行中
|
|
|
|
|
|
|
|
bool isFlag = true;
|
|
|
|
|
|
|
|
bool isTaskFlag = true;
|
|
|
|
|
|
|
|
DateTime startTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
if (obj_sidePanel != null)
|
|
|
|
if (obj_sidePanel != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//判断当前是否有手动下发的任务,有退出当前方法
|
|
|
|
|
|
|
|
isTaskFlag = GetNewTask(planInfo.ObjId);
|
|
|
|
|
|
|
|
if (isTaskFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//计划编号10个字:D6000-D6009、物料编号10个字:D6010-D6019、计划数量1个字:D6020、应答字1个字D6021
|
|
|
|
//计划编号10个字:D6000-D6009、物料编号10个字:D6010-D6019、计划数量1个字:D6020、应答字1个字D6021
|
|
|
|
obj_sidePanel.plc.WriteString("D6000", planInfo.TaskCode);
|
|
|
|
obj_sidePanel.plc.WriteString("D6000", planInfo.TaskCode);
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6022", SmProductId.ToString());//产品号
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6022", SmProductId.ToString());//产品号
|
|
|
|
string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
|
|
|
|
string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
|
|
|
|
obj_sidePanel.plc.WriteString("D6010", planInfo.MaterialSpecificatons);
|
|
|
|
obj_sidePanel.plc.WriteString("D6010", planInfo.MaterialSpecificatons);
|
|
|
|
int surplus = planInfo.PlanAmount - planInfo.SidePanelAmount;
|
|
|
|
// int surplus = planInfo.PlanAmount-planInfo.CompleteAmount;
|
|
|
|
|
|
|
|
int surplus = planInfo.PlanAmount;
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6020", surplus.ToString());
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6020", surplus.ToString());
|
|
|
|
Thread.Sleep(500);
|
|
|
|
Thread.Sleep(500);
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6021", "1");
|
|
|
|
obj_sidePanel.plc.WriteInt16("D6021", "1");
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>下发机头号为:{planInfo.MaterialSpecificatons}");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>下发机头号为:{planInfo.MaterialSpecificatons}");
|
|
|
|
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>计划【{planInfo.TaskCode}】已下发,等待前板设备应答.......");
|
|
|
|
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>计划【{planInfo.TaskCode}】已下发,等待前板设备应答.......");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待前板设备应答.......", "White");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待前板设备应答.......", "White");
|
|
|
|
#region PLC反馈信号逻辑处理
|
|
|
|
#region PLC反馈信号逻辑处理
|
|
|
|
//循环读取PLC应答信号,PLC应答后复位应答信号、更新计划状态为执行中
|
|
|
|
|
|
|
|
bool isFlag = true;
|
|
|
|
|
|
|
|
bool isTaskFlag = true;
|
|
|
|
|
|
|
|
DateTime startTime = DateTime.Now;
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//判断当前是否有手动下发的任务,有退出当前方法
|
|
|
|
|
|
|
|
isTaskFlag = GetNewTask(planInfo.ObjId);
|
|
|
|
|
|
|
|
if (isTaskFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int answer = obj_sidePanel.plc.ReadInt16("D6021");
|
|
|
|
int answer = obj_sidePanel.plc.ReadInt16("D6021");
|
|
|
|
if (answer == 2)
|
|
|
|
if (answer == 2)
|
|
|
@ -319,12 +327,11 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
isFlag = false;
|
|
|
|
isFlag = false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
} while (isFlag);
|
|
|
|
} while (isFlag);
|
|
|
|
|
|
|
|
|
|
|
|
if (isTaskFlag) return ;
|
|
|
|
if (isTaskFlag) return;
|
|
|
|
|
|
|
|
|
|
|
|
//更新计划状态为2执行中
|
|
|
|
//更新计划状态为2执行中
|
|
|
|
planInfo.ExecuteStatus = 2;
|
|
|
|
planInfo.ExecuteStatus = 2;
|
|
|
@ -466,7 +473,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void InitSendBackPanelPlan(object sender, System.Timers.ElapsedEventArgs e)
|
|
|
|
public void InitSendBackPanelPlan(object sender, System.Timers.ElapsedEventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
|
|
|
|
var obj_backPanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("BackPanelPLC"));
|
|
|
|
if (obj_backPanel == null) return;
|
|
|
|
if (obj_backPanel == null) return;
|
|
|
|
var obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
|
|
|
|
var obj_sidePanel = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("SidePanelPlc"));
|
|
|
@ -476,7 +483,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
backFlag = false;
|
|
|
|
backFlag = false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var planInfoList = _executePlanInfoServices.QuerySheetMetalSendPlanData("1001").Result;
|
|
|
|
var planInfoList = _executePlanInfoServices.QuerySheetMetalSendPlanData("1001").Result;
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0)
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine("未获取到需要下发的后板任务");
|
|
|
|
Console.WriteLine("未获取到需要下发的后板任务");
|
|
|
@ -500,11 +507,11 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
List<Bin> binList = GetBackBinStatus(obj_backPanel);
|
|
|
|
List<Bin> binList = GetBackBinStatus(obj_backPanel);
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "1").Result;
|
|
|
|
SmSyncModel smSyncModel = _smSyncModelServices.FirstAsync(d => d.MaterialSpecifications.Equals(planInfo.MaterialSpecificatons) && d.Category == "1").Result;
|
|
|
|
if (smSyncModel == null) return;
|
|
|
|
if (smSyncModel == null) return;
|
|
|
|
Bin bin = binList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId));
|
|
|
|
Bin bin = binList.FirstOrDefault(d => d.ProductId.Equals(smSyncModel.SmProductId) );
|
|
|
|
if (bin == null)
|
|
|
|
if (bin == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine($"未查询到钣金设备对计划!当前计划【{planInfo.TaskCode}】");
|
|
|
|
Console.WriteLine($"未查询到钣金设备对计划!当前计划【{planInfo.TaskCode}】");
|
|
|
|
// backFlag = true;
|
|
|
|
// backFlag = true;
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -534,18 +541,18 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
planInfos.Remove(planInfo);
|
|
|
|
planInfos.Remove(planInfo);
|
|
|
|
Console.WriteLine($"移除数据:{planInfo.ToJson()}");
|
|
|
|
Console.WriteLine($"移除数据:{planInfo.ToJson()}");
|
|
|
|
// backFlag = true;
|
|
|
|
// backFlag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SendPlanTaskToBackPanel(planInfo, obj_backPanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
SendPlanTaskToBackPanel(planInfo, obj_backPanel, smSyncModel.SmProductId.ObjToInt());
|
|
|
|
UpdateBackPanelPlanTaskByComplate(planInfo);
|
|
|
|
UpdateBackPanelPlanTaskByComplate(planInfo);
|
|
|
|
// backFlag = false;
|
|
|
|
// backFlag = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// backFlag = false;
|
|
|
|
// backFlag = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -587,36 +594,40 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
bool isFlag = true;
|
|
|
|
|
|
|
|
bool isTaskFlag = true;
|
|
|
|
|
|
|
|
DateTime startTime = DateTime.Now;
|
|
|
|
//Task.Run(() =>
|
|
|
|
//Task.Run(() =>
|
|
|
|
//{
|
|
|
|
//{
|
|
|
|
if (obj_backPanel != null)
|
|
|
|
if (obj_backPanel != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断当前是否有手动下发的任务,有退出当前方法
|
|
|
|
|
|
|
|
isTaskFlag = GetNewTask(planInfo.ObjId);
|
|
|
|
|
|
|
|
if (isTaskFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
//计划编号10个字:D6000-D6009、物料编号10个字:D6010-D6019、计划数量1个字:D6020、应答字1个字D6021
|
|
|
|
//计划编号10个字:D6000-D6009、物料编号10个字:D6010-D6019、计划数量1个字:D6020、应答字1个字D6021
|
|
|
|
obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode);
|
|
|
|
obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode);
|
|
|
|
obj_backPanel.plc.WriteInt16("D4022", productId.ToString());
|
|
|
|
obj_backPanel.plc.WriteInt16("D4022", productId.ToString());
|
|
|
|
string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
|
|
|
|
string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
|
|
|
|
obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons);
|
|
|
|
obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons);
|
|
|
|
int surplus = planInfo.PlanAmount - planInfo.CompleteAmount;//剩余计划数量
|
|
|
|
// int surplus = planInfo.PlanAmount - planInfo.CompleteAmount;//剩余计划数量
|
|
|
|
|
|
|
|
int surplus = planInfo.PlanAmount;//剩余计划数量
|
|
|
|
obj_backPanel.plc.WriteInt16("D4020", surplus.ToString());
|
|
|
|
obj_backPanel.plc.WriteInt16("D4020", surplus.ToString());
|
|
|
|
Thread.Sleep(500);
|
|
|
|
Thread.Sleep(500);
|
|
|
|
obj_backPanel.plc.WriteInt16("D4021", "1");
|
|
|
|
obj_backPanel.plc.WriteInt16("D4021", "1");
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>下发机头号为:{planInfo.MaterialSpecificatons}");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>下发机头号为:{planInfo.MaterialSpecificatons}");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>计划【{planInfo.TaskCode}】已下发,等待背板设备应答.......");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>计划【{planInfo.TaskCode}】已下发,等待背板设备应答.......");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待背板设备应答......", "White");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"计划【{planInfo.TaskCode}】已下发,等待背板设备应答......", "White");
|
|
|
|
#region PLC反馈信号逻辑处理
|
|
|
|
#region PLC反馈信号逻辑处理
|
|
|
|
//循环读取PLC应答信号,PLC应答后复位应答信号、更新计划状态为执行中
|
|
|
|
//循环读取PLC应答信号,PLC应答后复位应答信号、更新计划状态为执行中
|
|
|
|
bool isFlag = true;
|
|
|
|
|
|
|
|
bool isTaskFlag = true;
|
|
|
|
|
|
|
|
DateTime startTime = DateTime.Now;
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//判断当前是否有手动下发的任务,有退出当前方法
|
|
|
|
|
|
|
|
isTaskFlag = GetNewTask(planInfo.ObjId);
|
|
|
|
|
|
|
|
if (isTaskFlag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int backPalnelAnswer = obj_backPanel.plc.ReadInt16("D4021");
|
|
|
|
int backPalnelAnswer = obj_backPanel.plc.ReadInt16("D4021");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>应答信号:{backPalnelAnswer}");
|
|
|
|
Console.WriteLine($"【{DateTime.Now.ToString("HH:m:s")}】===>应答信号:{backPalnelAnswer}");
|
|
|
@ -1116,7 +1127,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
//D6030
|
|
|
|
//D6030
|
|
|
|
//计划编号:D6030-D6039,物料编号:D6040-D6049,计划完成数:D6050,计划下线数:D6051,设备状态:D6052-D6056,生产节拍:D6057-D6058
|
|
|
|
//计划编号:D6030-D6039,物料编号:D6040-D6049,计划完成数:D6050,计划下线数:D6051,设备状态:D6052-D6056,生产节拍:D6057-D6058
|
|
|
|
byte[] info = obj.plc.Read("D6030", 59);
|
|
|
|
byte[] info = obj.plc.Read("D6030", 59);
|
|
|
@ -1155,12 +1166,12 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (planInfo.ExecuteStatus !=2)
|
|
|
|
if (planInfo.ExecuteStatus != 2) // 还需要考虑联合计划任务状态
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isFlag = false;
|
|
|
|
isFlag = false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//添加完工记录
|
|
|
|
//添加完工记录 wan
|
|
|
|
RecordSidePanelComplate sidePanelComplate = new RecordSidePanelComplate()
|
|
|
|
RecordSidePanelComplate sidePanelComplate = new RecordSidePanelComplate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProductlineCode = "1001",
|
|
|
|
ProductlineCode = "1001",
|
|
|
@ -1187,8 +1198,9 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
|
|
|
|
|
|
|
|
lastComplateAmount = sidePanelComplates.First().CompleteAmount;
|
|
|
|
lastComplateAmount = sidePanelComplates.First().CompleteAmount;
|
|
|
|
sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount;
|
|
|
|
sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount;
|
|
|
|
sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
|
|
|
|
|
|
|
|
// sumComplateAmount = complateAmount; // 改为plc读取的数量
|
|
|
|
if (sidePanelComplate.OutPutAmount == 0)
|
|
|
|
if (sidePanelComplate.OutPutAmount == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
Thread.Sleep(5000);
|
|
|
@ -1206,9 +1218,10 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
RefreshExecInfoEvent?.Invoke($"前板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}", "White");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"前板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}", "White");
|
|
|
|
|
|
|
|
|
|
|
|
planInfo.CompleteAmount = planInfo.PlanAmount;
|
|
|
|
planInfo.CompleteAmount = planInfo.PlanAmount;
|
|
|
|
|
|
|
|
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
_ = _executePlanInfoServices.UpdateAsync(planInfo).Result;
|
|
|
|
_ = _executePlanInfoServices.UpdateAsync(planInfo).Result;
|
|
|
|
|
|
|
|
UpdateProductPlanInfo(planInfo);
|
|
|
|
//更新前端展示图表
|
|
|
|
//更新前端展示图表
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
@ -1216,14 +1229,22 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
planInfo.CompleteAmount = sumComplateAmount;
|
|
|
|
planInfo.CompleteAmount = sumComplateAmount;
|
|
|
|
var r =await _executePlanInfoServices.UpdateAsync(planInfo);
|
|
|
|
RefreshExecInfoEvent?.Invoke($"前板计划执行完成,:{planInfo.CompleteAmount}", "White");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var r = _executePlanInfoServices.UpdateAsync(planInfo).Result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpdateProductPlanInfo(planInfo);
|
|
|
|
|
|
|
|
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();
|
|
|
|
//任务没有完成但是已经暂停、退出系统
|
|
|
|
//任务没有完成但是已经暂停、退出系统
|
|
|
|
if (planInfo.ExecuteStatus==0)
|
|
|
|
if (planInfo.ExecuteStatus == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isFlag = false;
|
|
|
|
isFlag = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1235,9 +1256,10 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//如果没有完成记录插入一条默认完成数量为0
|
|
|
|
//如果没有完成记录插入一条默认完成数量为0
|
|
|
|
|
|
|
|
sidePanelComplate.OffLineAmount = 0;
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
_ = _sidePanelComplateServices.InsertSidePanelCimplate(sidePanelComplate).Result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1248,7 +1270,47 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 更新生产计划
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="planInfo"></param>
|
|
|
|
|
|
|
|
public void UpdateProductPlanInfo(ExecutePlanInfo planInfo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 更新生产计划
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ProductPlanInfo productInfo = _productPlanInfoServices.FirstAsync(x => x.PlanCode == planInfo.ProductPlanCode).Result;
|
|
|
|
|
|
|
|
if (productInfo != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var planInfoList = _executePlanInfoServices.QuerySheetMetalSendPlanData("1001").Result;
|
|
|
|
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine("未获取到需要下发的后板任务");
|
|
|
|
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var plan = planInfoList.FirstOrDefault(d => d.TaskCode == planInfo.TaskCode);
|
|
|
|
|
|
|
|
productInfo.SideCount = plan.SidePanelAmount;
|
|
|
|
|
|
|
|
productInfo.BackCount = plan.BackPanelAmount;
|
|
|
|
|
|
|
|
if (productInfo.CompleteAmount <= productInfo.SideCount && productInfo.CompleteAmount <= plan.BackPanelAmount)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
productInfo.CompleteAmount = Math.Min(plan.SidePanelAmount, plan.BackPanelAmount);
|
|
|
|
|
|
|
|
_ = _productPlanInfoServices.UpdateAsync(productInfo).Result;
|
|
|
|
|
|
|
|
if (productInfo.CompleteAmount == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_sysUserInfoServices.UpdateSapPlan(productInfo.OrderCode);//第一次执行更新日历表
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RefreshExecInfoEvent?.Invoke($"更新工位生产计划数异常:{ex.Message}", "Red");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#region 下发背板生产计划
|
|
|
|
#region 下发背板生产计划
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 下发背板生产计划
|
|
|
|
/// 下发背板生产计划
|
|
|
@ -1363,7 +1425,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var planInfo = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode && x.ExecuteStatus == 2).Result;
|
|
|
|
var planInfo = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode).Result;
|
|
|
|
if (planInfo == null)
|
|
|
|
if (planInfo == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine($"未查询到【{planCode}】运行任务!");
|
|
|
|
Console.WriteLine($"未查询到【{planCode}】运行任务!");
|
|
|
@ -1371,6 +1433,13 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (planInfo.ExecuteStatus != 2) // 还需要考虑联合计划任务状态
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isFlag = false;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//var planInfoStatus = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode && x.ExecuteStatus == 3).Result;
|
|
|
|
//var planInfoStatus = _executePlanInfoServices.FirstAsync(x => x.TaskCode == planCode && x.ExecuteStatus == 3).Result;
|
|
|
|
//if (planInfoStatus != null)
|
|
|
|
//if (planInfoStatus != null)
|
|
|
|
//{
|
|
|
|
//{
|
|
|
@ -1425,14 +1494,17 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
|
|
|
|
|
|
|
|
planInfo.CompleteAmount = planInfo.PlanAmount;
|
|
|
|
planInfo.CompleteAmount = planInfo.PlanAmount;
|
|
|
|
_backPanelComplateServices.InsertBackPanelCimplate(backPanelComplate);
|
|
|
|
_backPanelComplateServices.InsertBackPanelCimplate(backPanelComplate);
|
|
|
|
|
|
|
|
|
|
|
|
_executePlanInfoServices.UpdateAsync(planInfo);
|
|
|
|
_executePlanInfoServices.UpdateAsync(planInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpdateProductPlanInfo(planInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
planInfo.CompleteAmount = sumComplateAmount;
|
|
|
|
planInfo.CompleteAmount = sumComplateAmount;
|
|
|
|
_executePlanInfoServices.UpdateAsync(planInfo);
|
|
|
|
_executePlanInfoServices.UpdateAsync(planInfo);
|
|
|
|
_backPanelComplateServices.InsertBackPanelCimplate(backPanelComplate);
|
|
|
|
_backPanelComplateServices.InsertBackPanelCimplate(backPanelComplate);
|
|
|
|
|
|
|
|
UpdateProductPlanInfo(planInfo);
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();//更新界面
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
|
RefreshChatEvent?.Invoke();//刷新图表
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();
|
|
|
|
RefreshCreatePlanInfoEvent?.Invoke();
|
|
|
@ -1565,7 +1637,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (pPlanInfoList.Count != 0 && pPlanInfoList != null)
|
|
|
|
// if (pPlanInfoList.Count != 0 && pPlanInfoList != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_ = _productPlanInfoServices.UpdateAsync(t).Result;
|
|
|
|
_ = _productPlanInfoServices.UpdateAsync(t).Result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1615,7 +1687,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
string mode = string.Empty;
|
|
|
|
string mode = string.Empty;
|
|
|
|
List<SmSyncModel> addList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> addList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> updateList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> updateList = new List<SmSyncModel>();
|
|
|
|
var smSyncModelList = _smSyncModelServices.QueryAsync(d=>d.Category=="0").Result;
|
|
|
|
var smSyncModelList = _smSyncModelServices.QueryAsync(d => d.Category == "0").Result;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= 600; i++)
|
|
|
|
for (int i = 1; i <= 600; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1657,7 +1729,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
obj.Category = "0";
|
|
|
|
obj.Category = "0";
|
|
|
|
updateList.Add(obj);
|
|
|
|
updateList.Add(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode) && obj.SmModel!= mode)
|
|
|
|
if (!string.IsNullOrEmpty(obj.SmModel) && !string.IsNullOrEmpty(mode) && obj.SmModel != mode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
obj.SmProductId = j.ToString();
|
|
|
|
obj.SmProductId = j.ToString();
|
|
|
|
obj.SmModel = mode.Trim();
|
|
|
|
obj.SmModel = mode.Trim();
|
|
|
@ -1671,7 +1743,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (addList != null && addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
|
|
|
|
if (addList != null && addList.Count > 0) await _smSyncModelServices.AddAsync(addList);
|
|
|
|
if (updateList != null&&updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
|
|
|
|
if (updateList != null && updateList.Count > 0) await _smSyncModelServices.UpdateAsync(updateList);
|
|
|
|
RefreshExecInfoEvent?.Invoke($"===============采集前板配置结束===============", "White");
|
|
|
|
RefreshExecInfoEvent?.Invoke($"===============采集前板配置结束===============", "White");
|
|
|
|
Console.WriteLine("===============采集结束===============");
|
|
|
|
Console.WriteLine("===============采集结束===============");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1703,7 +1775,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
string mode = string.Empty;
|
|
|
|
string mode = string.Empty;
|
|
|
|
List<SmSyncModel> addList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> addList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> updateList = new List<SmSyncModel>();
|
|
|
|
List<SmSyncModel> updateList = new List<SmSyncModel>();
|
|
|
|
var smSyncModelList = _smSyncModelServices.QueryAsync(d=>d.Category=="1").Result;
|
|
|
|
var smSyncModelList = _smSyncModelServices.QueryAsync(d => d.Category == "1").Result;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= 600; i++)
|
|
|
|
for (int i = 1; i <= 600; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1992,7 +2064,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (statusFlag)
|
|
|
|
if (statusFlag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
statusFlag=false;
|
|
|
|
statusFlag = false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = _executePlanInfoServices.QueryAsync(d => d.ExecuteStatus == 2 && d.PlanAmount == d.CompleteAmount).Result;
|
|
|
|
var result = _executePlanInfoServices.QueryAsync(d => d.ExecuteStatus == 2 && d.PlanAmount == d.CompleteAmount).Result;
|
|
|
@ -2011,7 +2083,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine( );
|
|
|
|
Console.WriteLine();
|
|
|
|
logHelper.Error($"更新钣金计划任务状态异常:{ex.Message}");
|
|
|
|
logHelper.Error($"更新钣金计划任务状态异常:{ex.Message}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
finally
|
|
|
@ -2019,7 +2091,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
statusFlag = true;
|
|
|
|
statusFlag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2027,7 +2099,7 @@ namespace Aucma.Core.SheetMetalTasks
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<SheetMetaSendPlanInfoView> planInfoList = _executePlanInfoServices.QuerySheetMetalSendPlanData("1001").Result;
|
|
|
|
List<SheetMetaSendPlanInfoView> planInfoList = _executePlanInfoServices.QuerySheetMetalSendPlanData("1001").Result;
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0) return false;
|
|
|
|
if (planInfoList == null || planInfoList.Count == 0) return false;
|
|
|
|
var task= planInfoList.FirstOrDefault(d=>d.ExecuteStatus==2&& d.ObjId!= Id);
|
|
|
|
var task = planInfoList.FirstOrDefault(d => d.ExecuteStatus == 2 && d.ObjId != Id);
|
|
|
|
if (task == null) return false;
|
|
|
|
if (task == null) return false;
|
|
|
|
else return true;
|
|
|
|
else return true;
|
|
|
|
|
|
|
|
|
|
|
|