change - 组装计划、货道信息设置

collectionStore
wenjy 6 months ago
parent 69484298b1
commit c66668b66a

@ -413,7 +413,11 @@ namespace Aucma.Scada.Business
break;
}
var taksInfos =_realTaskInfoService.GetTaskInfosByTaskStatus(new string[] { appConfig.shellStoreCode, appConfig.linerStoreCode }, 2,2);
var taksInfos = _realTaskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.shellStoreCode, appConfig.linerStoreCode }, 2);
if (taksInfos != null)
{
taksInfos = taksInfos.Where(x => x.taskStatus != 3).ToList();
if (taksInfos.Count == 0)
{
@ -458,12 +462,16 @@ namespace Aucma.Scada.Business
isFlase = false;
}
}
Task.Delay(2000).Wait();
} while (isFlase);
}
}
Task.Delay(5000).Wait();
}catch(Exception ex)
}
catch (Exception ex)
{
Console.WriteLine($"组装计划自动执行异常:{ex.Message}");
}

@ -246,7 +246,7 @@ namespace Aucma.Scada.Business
if (spaceList != null)
{
spaceList = spaceList.Where(x => x.spaceStatus == 4).ToList();
spaceList = spaceList.Where(x => x.unusualFlag == 2).ToList();
BaseSpaceInfo spaceInfo = GetSpaceInfosByPlc(spaceList, false);

@ -149,6 +149,7 @@ namespace Aucma.Scada.Business
if (spaceInfo != null)
{
spaceInfo.unusualFlag = spaceInfo.unusualFlag == 1 ? 2 : 1;
result = _spaceInfoService.UpdateSpaceInfo(spaceInfo);
logHelper.Info($"修改仓库:{storeCode};货道:{spaceCode};异常标识:{spaceInfo.unusualFlag};修改{(result == true ? "" : "")}");
}
@ -175,7 +176,7 @@ namespace Aucma.Scada.Business
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo != null)
{
spaceInfo.spaceStatus = spaceInfo.spaceStatus == 1 ? 2 : 1;
spaceInfo.spaceStatus = spaceInfo.spaceStatus == 1 ? 3 : 1;
result = _spaceInfoService.UpdateSpaceInfo(spaceInfo);
logHelper.Info($"修改仓库:{storeCode};货道:{spaceCode};货道状态:{spaceInfo.unusualFlag};修改{(result == true ? "" : "")}");
}

@ -97,7 +97,7 @@ namespace Aucma.Scada.Business
public delegate void RefreshLogMessage(string message);
public event RefreshLogMessage RefreshLogMessageEvent;
public delegate void RefreshAssemblyPlanInit();
public delegate void RefreshAssemblyPlanInit(int isFlag = 0);
public event RefreshAssemblyPlanInit RefreshAssemblyPlanInitEvent;
public delegate void RefreshStoreStock();
@ -122,7 +122,8 @@ namespace Aucma.Scada.Business
taskHandleBusiness.OutStoreFinsihEvent += OutStoreFinish;
taskHandleBusiness.UpdateMesPlanCompleteEvent += UpdatePlanInfo;
StartPassDown();
}catch (Exception ex)
}
catch (Exception ex)
{
Console.WriteLine($"OutStoreBusiness异常{ex.Message}");
PrintLogErrorMessage($"OutStoreBusiness异常{ex.Message}");
@ -151,13 +152,58 @@ namespace Aucma.Scada.Business
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{
string taskCode = System.Guid.NewGuid().ToString("N").Substring(0, 10);
RealTaskInfo shellTask = OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
Thread.Sleep(500);
RealTaskInfo linerTask = OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
Thread.Sleep(500);
//RealTaskInfo shellTask = OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
//Thread.Sleep(500);
//RealTaskInfo linerTask = OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
//Thread.Sleep(500);
var shellSpaceInfo = GetSpaceInfoByMaterialType(appConfig.shellStoreCode, shellBomInfo.materialCode);
Thread.Sleep(100);
var linerSpaceInfo = GetSpaceInfoByMaterialType(appConfig.linerStoreCode, linerBomInfo.materialCode);
Thread.Sleep(100);
//判断库存
if (shellSpaceInfo != null && linerSpaceInfo != null)
{
RealTaskInfo shell_task = CreateOutStoreTask(shellSpaceInfo, planInfo.executePlanCode, taskCode); //创建出库任务
if (shell_task != null)
{
PrintLogInfoMessage("箱壳出库计划创建成功");
}
else
{
PrintLogInfoMessage("箱壳出库计划创建失败");
assemblyPlanBusiness.autoFlag = false;
RefreshAssemblyPlanInitEvent?.Invoke(2);
}
Thread.Sleep(100);
RealTaskInfo liner_task = CreateOutStoreTask(shellSpaceInfo, planInfo.executePlanCode, taskCode); //创建出库任务
if (shell_task != null)
{
PrintLogInfoMessage("箱壳出库计划创建成功");
}
else
{
PrintLogInfoMessage("箱壳出库计划创建失败");
assemblyPlanBusiness.autoFlag = false;
RefreshAssemblyPlanInitEvent?.Invoke(2);
}
}
else
{
PrintLogInfoMessage($"组装计划:{planInfo.executePlanCode};出库失败,货道不匹配,未匹配到相同型号物料");
assemblyPlanBusiness.autoFlag = false;
}
Thread.Sleep(1000 * 2);
}
}
else
{
@ -387,7 +433,8 @@ namespace Aucma.Scada.Business
{
// PrintLogInfoMessage("未获取到需要下发的箱壳出库任务");
}
}catch(Exception ex)
}
catch (Exception ex)
{
PrintLogErrorMessage("下传箱壳出库任务逻辑处理异常", ex);
}
@ -760,11 +807,11 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"通过PLC读取货道信息货道{spaceInfo.spaceName};在库数量:{item.spaceStock};货道状态:{item.spaceStatus}");
}
var list = info.Where(x=>x.spaceStatus == 1 && x.spaceStock > 0 && (x.spaceStock - x.outRouteAmount) > 0).ToList();
var list = info.Where(x => x.spaceStatus == 1 && x.spaceStock > 0).ToList(); // && (x.spaceStock - x.outRouteAmount) > 0
if (list.Count > 0)
{
result = info.OrderBy(x => x.spaceStock - x.outRouteAmount).First();
result = info.OrderBy(x => x.spaceStock).First();
}
else
{

@ -348,8 +348,22 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
/// <summary>
/// 出库完成刷新计划列表
/// </summary>
private void RefreshPlanInfoDataGrid()
private void RefreshPlanInfoDataGrid(int isFlag = 0)
{
if (isFlag == 1)
{
AutoSendContent = "关闭";
}
else if (isFlag == 2)
{
AutoSendContent = "自动下发";
}
else
{
//
}
RefreshExecutePlan();
App.Current.Dispatcher.Invoke((Action)(() =>

Loading…
Cancel
Save