change - 出入库逻辑修改

foamRearStore
wenjy 1 year ago
parent ba6fb26eae
commit aa181bca96

Binary file not shown.

@ -104,7 +104,7 @@ namespace Aucma.Scada.Business
// planInfos[i].executeOrder = i + 1;
//}
//_executePlanInfoService.UpdateRangeExecutePlanInfo(planInfos);
planInfos = planInfos.Where(x => x.executeStatus != 3).ToList();
RefreshExecutePlanInfoEvent?.Invoke(planInfos);
}
}

@ -48,6 +48,11 @@ namespace Aucma.Scada.Business
/// 实时任务
/// </summary>
private IRealTaskInfoService _taskInfoService;
private IBaseSpaceDetailService _baseSpaceDetailService;
private IBaseBomInfoService _baseBomInfoService;
#endregion
#region 委托事件
@ -80,10 +85,21 @@ namespace Aucma.Scada.Business
{
_spaceInfoService = registerServices.GetService<IBaseSpaceInfoService>();
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_baseSpaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_baseBomInfoService = registerServices.GetService<IBaseBomInfoService>();
taskHandle.InStoreFinsihEvent += FoamTaskFeedback;
grabImage.RefreshMaterialCodeStrEvent += InStore;
grabImage.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
//Task.Run(() =>
//{
// Thread.Sleep(6000);
// for (int i = 1; i < 9; i++)
// {
// InStore("F23406001225101900" + i);
// }
//});
}
/// <summary>
@ -95,13 +111,17 @@ namespace Aucma.Scada.Business
try
{
PrintLogInfoMessage($"扫码成功,物料码:{materialCode}");
string materialType = materialCode;
string materialType = SubStringMaterialCode(materialCode);
var spaceInfo = _spaceInfoService.InStoreGetSpaceInfoByMaterialType(appConfig.foamStoreCode, materialType);
if (spaceInfo != null)
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
RefreshScanMateriaCodeEvent?.Invoke(materialCode, materialType, spaceInfo.spaceName, appConfig.foamStoreCode); //刷新界面扫码信息
CreateInStoreTask(spaceInfo, materialCode); //创建入库任务
RefreshScanMateriaCodeEvent?.Invoke(materialCode, GetMaterialName(materialType), spaceInfo.spaceName, appConfig.foamStoreCode); //刷新界面扫码信息
var result = CreateInStoreTask(spaceInfo, materialCode); //创建入库任务
if (result)
{
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
}
}
else
{
@ -119,30 +139,37 @@ namespace Aucma.Scada.Business
/// 创建入库任务
/// </summary>
/// <param name="spaceInfo"></param>
private void CreateInStoreTask(BaseSpaceInfo spaceInfo, string materialCode)
private bool CreateInStoreTask(BaseSpaceInfo spaceInfo, string materialCode)
{
//生成入库任务依次下发至PLC
bool result = false;
#region 任务赋值
RealTaskInfo realTaskInfo = new RealTaskInfo();
realTaskInfo.taskType = 1;
realTaskInfo.taskCode = System.Guid.NewGuid().ToString("N").Substring(0, 6);
realTaskInfo.storeCode = spaceInfo.storeCode;
realTaskInfo.spaceCode = spaceInfo.spaceCode;
realTaskInfo.materialType = spaceInfo.materialType;
realTaskInfo.materialCode = System.Guid.NewGuid().ToString("N").Substring(0, 6); ;
realTaskInfo.materialCode = materialCode;
realTaskInfo.planAmount = 1;
realTaskInfo.taskStatus = 1;
realTaskInfo.createTime = DateTime.Now;
bool result = _taskInfoService.AddTaskInfo(realTaskInfo);
#endregion
result = _taskInfoService.AddTaskInfo(realTaskInfo);
if (result)
{
PrintLogInfoMessage("入库任务创建成功");
RefreshInStoreTaskEvent?.Invoke(realTaskInfo);
result = true;
}
else
{
PrintLogInfoMessage("入库任务创建失败");
}
return result;
}
#region 轮询获取入库任务下发至PLC等待PLC执行反馈完成后再次下发
@ -157,7 +184,7 @@ namespace Aucma.Scada.Business
{
while (true)
{
PassDownShellTask();
PassDownFoamTask();
Thread.Sleep(1000);
}
});
@ -169,7 +196,7 @@ namespace Aucma.Scada.Business
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private void PassDownShellTask()
private void PassDownFoamTask()
{
RealTaskInfo taskInfo = GetAwaitSendTask(appConfig.foamStoreCode);
if (taskInfo != null)
@ -177,13 +204,15 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"下发泡后入库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}");
//taskHandle.SendShellTask_InStore(taskInfo);
Thread.Sleep(200);
if (taskHandle.SendShellTask_InStore(taskInfo))
if (taskHandle.SendFoamTask_InStore(taskInfo))
{
PrintLogInfoMessage($"泡后入库任务:{taskInfo.taskCode}下发成功等待PLC执行反馈");
taskInfo.taskStatus = 2;
_taskInfoService.UpdateTaskInfo(taskInfo);
RefreshInStoreTaskEvent?.Invoke(taskInfo);
//if (semaphore.Wait(TimeSpan.FromSeconds(20)))
//{
// // 收到反馈
@ -197,6 +226,8 @@ namespace Aucma.Scada.Business
semaphore.Wait(); //一直堵塞直到信号量释放
PrintLogInfoMessage($"泡后入库任务:{taskInfo.taskCode};执行完成");
RefreshInStoreTaskEvent?.Invoke(taskInfo);
}
else
{
@ -224,12 +255,6 @@ namespace Aucma.Scada.Business
{
taskInfo = _taskInfoService.GetTaskInfoByStoreCode(storeCode, 1);
//if (taskInfo != null)
//{
// taskInfo.taskStatus = 2;
// _taskInfoService.UpdateTaskInfo(taskInfo);
//}
}
catch (Exception ex)
{
@ -245,13 +270,12 @@ namespace Aucma.Scada.Business
private void FoamTaskFeedback(string taskCode)
{
Thread.Sleep(4000);
PrintLogInfoMessage("泡后执行完成,自动释放信号量");
InStoreFinish(taskCode);
semaphore.Release();
InStoreFinish(taskCode);
}
#endregion
@ -275,8 +299,20 @@ namespace Aucma.Scada.Business
{
//读取PLC获取货道信息存放数量、在途数量
spaceInfo.materialType = taskInfo.materialType;
spaceInfo.spaceStock = spaceInfo.spaceStock + 1;
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
#region 添加货道明细
BaseSpaceDetail spaceDetail = new BaseSpaceDetail();
spaceDetail.materialType = taskInfo.materialType;
spaceDetail.materialCode = taskInfo.materialCode;
spaceDetail.materialName = GetMaterialName(taskInfo.materialType);
spaceDetail.storeCode = spaceInfo.storeCode;
spaceDetail.spaceCode = spaceInfo.spaceCode;
spaceDetail.materialAmount = 1;
_baseSpaceDetailService.InsertSpaceDetail(spaceDetail);
#endregion
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, appConfig.foamStoreCode);
@ -330,5 +366,22 @@ namespace Aucma.Scada.Business
{
return _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode }, 1);
}
/// <summary>
/// 通过BOM获取物料名称
/// </summary>
/// <param name="materialType"></param>
/// <returns></returns>
public string GetMaterialName(string materialType)
{
string materialName = string.Empty;
var info = _baseBomInfoService.GetBomInfoByMaterialCode(materialType);
if (info != null)
{
materialName = info.materialName;
}
return materialName;
}
}
}

@ -60,7 +60,7 @@ namespace Aucma.Scada.Business
}
#region 泡后入库任务下发处理
public bool SendShellTask_InStore(RealTaskInfo taskInfo)
public bool SendFoamTask_InStore(RealTaskInfo taskInfo)
{
bool result = false;
try
@ -72,11 +72,11 @@ namespace Aucma.Scada.Business
if (_plc.IsConnected)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.in_shell_spaceCode, taskInfo.spaceCode);
_plc.writeStringByAddress(plcConfig.in_foam_spaceCode, taskInfo.spaceCode);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.in_shell_answer, 1);
_plc.writeInt32ByAddress(plcConfig.in_foam_answer, 1);
//写入任务号
_plc.writeStringByAddress(plcConfig.in_shell_task, taskInfo.taskCode);
_plc.writeStringByAddress(plcConfig.in_foam_task, taskInfo.taskCode);
//写入完成后读取应答字进行复位
ReadShellAnswer_InStore(taskInfo.taskCode);
@ -121,14 +121,14 @@ namespace Aucma.Scada.Business
do
{
//读取PLC应答字为2时上位机清空写入的入库内容
if (_plc.readInt32ByAddress(plcConfig.in_shell_answer) == 2)
if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 2)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.in_shell_spaceCode, string.Empty);
_plc.writeStringByAddress(plcConfig.in_foam_spaceCode, string.Empty);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.in_shell_answer, 0);
_plc.writeInt32ByAddress(plcConfig.in_foam_answer, 0);
//写入任务号
_plc.writeStringByAddress(plcConfig.in_shell_task, string.Empty);
_plc.writeStringByAddress(plcConfig.in_foam_task, string.Empty);
isFlag = false;
ReadShellFinish_InStore(taskCode);
@ -176,11 +176,11 @@ namespace Aucma.Scada.Business
do
{
//读取PLC入库任务完成
if (_plc.readInt32ByAddress(plcConfig.in_shell_finish) == 1)
if (_plc.readInt32ByAddress(plcConfig.in_foam_finish) == 1)
{
_plc.writeInt32ByAddress(plcConfig.in_shell_finish, 0);
_plc.writeInt32ByAddress(plcConfig.in_foam_finish, 0);
//string taskCode = _plc.readStringByAddress(plcConfig.out_shell_task, 10);
//string taskCode = _plc.readStringByAddress(plcConfig.out_foam_task, 10);
InStoreFinsihEvent?.Invoke(taskCode);

@ -40,8 +40,7 @@ namespace Aucma.Scada.Business
public void InitPlc()
{
//初始化Plc
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.shell_Plc_Ip, plcConfig.shell_Plc_Port, appConfig.shellStoreCode);
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.liner_Plc_Ip, plcConfig.liner_Plc_Port, appConfig.linerStoreCode);
plcPool.InitPlc("MelsecBinaryPlc", plcConfig.foam_Plc_Ip, plcConfig.foam_Plc_Port, appConfig.foamStoreCode);
}
/// <summary>

@ -58,6 +58,10 @@ namespace Aucma.Scada.Business
/// 货道明细
/// </summary>
private IBaseSpaceDetailService _spaceDetailService;
private IExecutePlanInfoService _executePlanInfoService;
private IProductPlanInfoService _productPlanInfoService;
#endregion
#region 委托事件
@ -84,6 +88,9 @@ namespace Aucma.Scada.Business
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public event RefreshLogMessage RefreshLogMessageEvent;
public delegate void RefreshAssemblyPlanInit();
public event RefreshAssemblyPlanInit RefreshAssemblyPlanInitEvent;
#endregion
private OutStoreBusiness()
@ -92,7 +99,8 @@ namespace Aucma.Scada.Business
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_bomInfoService = registerServices.GetService<IBaseBomInfoService>();
_spaceDetailService = registerServices.GetService<IBaseSpaceDetailService>();
_executePlanInfoService = registerServices.GetService<IExecutePlanInfoService>();
_productPlanInfoService = registerServices.GetService<IProductPlanInfoService>();
assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle;
taskHandleBusiness.OutStoreFinsihEvent += TaskFeedback;
StartPassDown();
@ -111,7 +119,7 @@ namespace Aucma.Scada.Business
if (planInfo != null)
{
string taskCode = DateTime.Now.ToString("HH:mm:ss");
var bomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, appConfig.shellMaterialType);
var bomInfo = _bomInfoService.GetChildenBomInfoByMaterialCode(planInfo.materialCode, appConfig.foamMaterialType);
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{
OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode);
@ -196,6 +204,10 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage("出库任务创建失败");
}
}
else
{
PrintLogInfoMessage("出库任务创建失败,货道明细为空");
}
}
catch (Exception ex)
{
@ -281,9 +293,8 @@ namespace Aucma.Scada.Business
/// <param name="e"></param>
private void PassDownTaskInfo()
{
string shellCode = string.Empty;
string linerCode = string.Empty;
string taskCode = string.Empty;
string executePlanCode = string.Empty;
int iFlag = 0;
completedTasks = 0;
@ -297,7 +308,8 @@ namespace Aucma.Scada.Business
foreach (var item in taskInfoList)
{
taskCode = item.taskCode;
if (taskHandleBusiness.SendShellTask_OutStore(item))
executePlanCode = item.planCode;
if (taskHandleBusiness.SendFoamTask_OutStore(item))
{
PrintLogInfoMessage($"下发泡后出库任务:{item.taskCode};仓库{item.storeCode};货道:{item.spaceCode}等待PLC执行反馈");
item.taskStatus = 2;
@ -308,30 +320,20 @@ namespace Aucma.Scada.Business
PrintLogInfoMessage($"泡后出库任务:{item.taskCode}下发失败请排除PLC连接");
continue;
}
shellCode = item.materialCode;
_taskInfoService.UpdateTaskInfo(item);
RefreshScanMateriaCodeEvent?.Invoke(item.materialCode, item.materialType, item.spaceName, item.storeCode);
}
if (iFlag == taskInfoList.Count)
{
_taskInfoService.UpdateRangeTaskInfo(taskInfoList);
//if (semaphore.Wait(TimeSpan.FromSeconds(20)))
//{
// // 收到反馈
// PrintLogInfoMessage("收到反馈,继续执行");
//}
//else
//{
// PrintLogInfoMessage("超时未反馈");
//}
semaphore.Wait(); //一直堵塞直到信号量释放
PrintLogInfoMessage($"出库任务:{taskCode};执行完成,绑定泡后条码:{shellCode};内胆条码:{linerCode}");
PrintLogInfoMessage($"出库任务:{taskCode};执行完成");
UpdatePlanInfo(executePlanCode);
}
}
else
@ -366,12 +368,6 @@ namespace Aucma.Scada.Business
RealTaskInfo linerInfo = _taskInfoService.GetTaskInfoByStoreCode(appConfig.linerStoreCode, 2);
if (linerInfo != null) taskInfos.Add(linerInfo);
}
//if(taskInfos.Count > 0)
//{
// taskInfos.ForEach(x => x.taskStatus = 2);
// _taskInfoService.UpdateRangeTaskInfo(taskInfos);
//}
}
catch (Exception ex)
{
@ -432,21 +428,27 @@ namespace Aucma.Scada.Business
var taskInfo = _taskInfoService.GetTaskInfoByTaskCode(taskCode, storeCode);
if (taskInfo != null)
{
//刷新界面
RefreshScanMateriaCodeEvent?.Invoke(string.Empty, string.Empty, string.Empty, taskInfo.storeCode);
var spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(taskInfo.storeCode, taskInfo.spaceCode);
if (spaceInfo != null)
{
//读取PLC获取货道信息存放数量、在途数量
//spaceInfo.materialType = taskInfo.materialType;
if (spaceInfo.spaceStock == 0)
{
spaceInfo.materialType = string.Empty;
}
_spaceInfoService.UpdateSpaceInfo(spaceInfo);
//读取PLC获取物料类型进行绑定
}
//清除任务信息
_taskInfoService.DeleteTaskInfo(taskCode, storeCode);
_spaceDetailService.DeleteSpaceDetailByMaterialCode(taskInfo.materialCode);
//刷新界面
RefreshScanMateriaCodeEvent?.Invoke(string.Empty, string.Empty, string.Empty, taskInfo.storeCode);
}
}
@ -456,13 +458,55 @@ namespace Aucma.Scada.Business
}
}
/// <summary>
/// 更新计划信息
/// </summary>
/// <param name="planCode"></param>
private void UpdatePlanInfo(string planCode)
{
try
{
var executeInfo = _executePlanInfoService.GetExecutePlanInfoByPlanCode(planCode);
if (executeInfo != null)
{
executeInfo.completeAmount += 1;
if (executeInfo.completeAmount == executeInfo.planAmount)
{
executeInfo.executeStatus = 3;
}
_executePlanInfoService.UpdateExecutePlanInfo(executeInfo);
var productInfo = _productPlanInfoService.GetProductPlanByPlanCode(executeInfo.productPlanCode);
if (productInfo != null)
{
productInfo.completeAmount += 1;
if (productInfo.completeAmount == productInfo.planAmount)
{
productInfo.endTime = DateTime.Now;
}
_productPlanInfoService.UpdateProductPlanInfo(productInfo);
}
}
RefreshAssemblyPlanInitEvent?.Invoke();
}
catch (Exception ex)
{
PrintLogErrorMessage("计划信息更新异常", ex);
}
}
/// <summary>
/// 获取出库任务
/// </summary>
/// <returns></returns>
public List<RealTaskInfo> GetOutStoreTask()
{
var taskInfos = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode, appConfig.linerStoreCode }, appConfig.outstoreTaskType);
var taskInfos = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode}, appConfig.outstoreTaskType);
return taskInfos;
}

@ -43,7 +43,7 @@ namespace Aucma.Scada.Business
private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
/// <summary>
/// 箱壳任务编号,PLC反馈后进行赋值
/// 泡后任务编号,PLC反馈后进行赋值
/// </summary>
private string shellTaskCode = string.Empty;
@ -69,12 +69,12 @@ namespace Aucma.Scada.Business
_plcDictionary = _pool.GetAll();
}
#region 箱壳出库任务下发处理
#region 泡后出库任务下发处理
/// <summary>
/// 箱壳出库任务下发
/// 泡后出库任务下发
/// </summary>
/// <param name="taskInfo"></param>
public bool SendShellTask_OutStore(RealTaskInfo taskInfo)
public bool SendFoamTask_OutStore(RealTaskInfo taskInfo)
{
bool result = false;
try
@ -86,13 +86,13 @@ namespace Aucma.Scada.Business
if (_plc.IsConnected)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.out_shell_spaceCode, taskInfo.spaceCode);
_plc.writeStringByAddress(plcConfig.out_foam_spaceCode, taskInfo.spaceCode);
//写入出库数量
_plc.writeInt32ByAddress(plcConfig.out_shell_amount, taskInfo.planAmount);
_plc.writeInt32ByAddress(plcConfig.out_foam_amount, taskInfo.planAmount);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.out_shell_answer, 1);
_plc.writeInt32ByAddress(plcConfig.out_foam_answer, 1);
//写入任务号
_plc.writeStringByAddress(plcConfig.out_shell_task, taskInfo.taskCode);
_plc.writeStringByAddress(plcConfig.out_foam_task, taskInfo.taskCode);
//写入完成后读取应答字进行复位
ReadShellAnswer_OutStore(taskInfo.taskCode);
@ -111,21 +111,21 @@ namespace Aucma.Scada.Business
}
catch (Exception ex)
{
logHelper.Error("箱壳出库任务下发异常", ex);
logHelper.Error("泡后出库任务下发异常", ex);
}
return result;
}
/// <summary>
/// 读取箱壳出库应答
/// 读取泡后出库应答
/// </summary>
private void ReadShellAnswer_OutStore(string taskCode)
{
lock (string.Empty)
{
bool isFlag = true;
IPlc _plc = _plcDictionary[appConfig.shellStoreCode];
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
try
{
Task.Run(() =>
@ -137,16 +137,16 @@ namespace Aucma.Scada.Business
do
{
//读取PLC应答字为2时上位机清空写入的出库内容
if (_plc.readInt32ByAddress(plcConfig.out_shell_answer) == 2)
if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 2)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.out_shell_spaceCode, string.Empty);
_plc.writeStringByAddress(plcConfig.out_foam_spaceCode, string.Empty);
//写入出库数量
_plc.writeInt32ByAddress(plcConfig.out_shell_amount, 0);
_plc.writeInt32ByAddress(plcConfig.out_foam_amount, 0);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.out_shell_answer, 0);
_plc.writeInt32ByAddress(plcConfig.out_foam_answer, 0);
//写入任务号
_plc.writeStringByAddress(plcConfig.out_shell_task, string.Empty);
_plc.writeStringByAddress(plcConfig.out_foam_task, string.Empty);
isFlag = false;
ReadShellFinish_OutStore(taskCode);
@ -157,31 +157,31 @@ namespace Aucma.Scada.Business
}
else
{
logHelper.Info($"仓库{appConfig.shellStoreCode}PLC未连接");
logHelper.Info($"仓库{appConfig.foamStoreCode}PLC未连接");
}
}
else
{
logHelper.Info($"PLC信息为空通过{appConfig.shellStoreCode}未获取到该仓库对应的PLC信息");
logHelper.Info($"PLC信息为空通过{appConfig.foamStoreCode}未获取到该仓库对应的PLC信息");
}
});
}
catch (Exception ex)
{
logHelper.Error("读取箱壳出库应答字异常", ex);
logHelper.Error("读取泡后出库应答字异常", ex);
}
}
}
/// <summary>
/// 读取箱壳出库完成
/// 读取泡后出库完成
/// </summary>
private void ReadShellFinish_OutStore(string taskCode)
{
lock (string.Empty)
{
bool isFlag = true;
IPlc _plc = _plcDictionary[appConfig.shellStoreCode];
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
shellTaskCode = taskCode;
try
{
@ -194,13 +194,13 @@ namespace Aucma.Scada.Business
do
{
//读取PLC出库任务完成
if (_plc.readInt32ByAddress(plcConfig.out_shell_finish) == 1)
if (_plc.readInt32ByAddress(plcConfig.out_foam_finish) == 1)
{
_plc.writeInt32ByAddress(plcConfig.out_shell_finish, 0);
_plc.writeInt32ByAddress(plcConfig.out_foam_finish, 0);
//string taskCode = _plc.readStringByAddress(plcConfig.out_shell_task, 10);
//string taskCode = _plc.readStringByAddress(plcConfig.out_foam_task, 10);
OutStoreFinsihEvent?.Invoke(appConfig.shellStoreCode, taskCode);
OutStoreFinsihEvent?.Invoke(appConfig.foamStoreCode, taskCode);
isFlag = false;
}
@ -210,181 +210,22 @@ namespace Aucma.Scada.Business
}
else
{
logHelper.Info($"仓库{appConfig.shellStoreCode}PLC未连接");
logHelper.Info($"仓库{appConfig.foamStoreCode}PLC未连接");
}
}
else
{
logHelper.Info($"PLC信息为空通过{appConfig.shellStoreCode}未获取到该仓库对应的PLC信息");
logHelper.Info($"PLC信息为空通过{appConfig.foamStoreCode}未获取到该仓库对应的PLC信息");
}
});
}
catch (Exception ex)
{
logHelper.Error("读取箱壳出库出库完成异常", ex);
logHelper.Error("读取泡后出库出库完成异常", ex);
}
}
}
#endregion
#region 内胆出库任务处理
/// <summary>
/// 内胆出库任务下发
/// </summary>
/// <param name="taskInfo"></param>
public bool SendLinerTask_OutStore(RealTaskInfo taskInfo)
{
bool result = false;
try
{
IPlc _plc = _plcDictionary[taskInfo.storeCode];
if (_plc != null)
{
if (_plc.IsConnected)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.out_liner_spaceCode, taskInfo.spaceCode);
//写入出库数量
_plc.writeInt32ByAddress(plcConfig.out_liner_amount, taskInfo.planAmount);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.out_liner_answer, 1);
//写入任务号
_plc.writeStringByAddress(plcConfig.out_liner_task, taskInfo.taskCode);
//写入完成后读取应答字进行复位
ReadLinerAnswer_OutStore(taskInfo.taskCode);
result = true;
}
else
{
logHelper.Info($"仓库{taskInfo.storeCode}PLC未连接");
}
}
else
{
logHelper.Info($"PLC信息为空通过{taskInfo.storeCode}未获取到该仓库对应的PLC信息");
}
}
catch (Exception ex)
{
logHelper.Error("内胆出库任务下发异常", ex);
}
return result;
}
/// <summary>
/// 读取内胆出库应答
/// </summary>
private void ReadLinerAnswer_OutStore(string taskCode)
{
lock (string.Empty)
{
bool isFlag = true;
IPlc _plc = _plcDictionary[appConfig.shellStoreCode];
linerTaskCode = taskCode;
try
{
Task.Run(() =>
{
if (_plc != null)
{
if (_plc.IsConnected)
{
do
{
//读取PLC应答字为2时上位机清空写入的出库内容
if (_plc.readInt32ByAddress(plcConfig.out_liner_answer) == 2)
{
//写入货道号
_plc.writeStringByAddress(plcConfig.out_liner_spaceCode, string.Empty);
//写入出库数量
_plc.writeInt32ByAddress(plcConfig.out_liner_amount, 0);
//写入应答字
_plc.writeInt32ByAddress(plcConfig.out_liner_answer, 0);
//写入任务号
_plc.writeStringByAddress(plcConfig.out_liner_task, string.Empty);
isFlag = false;
Thread.Sleep(5000);
ReadLinerFinish_OutStore(taskCode);
}
} while (isFlag);
}
else
{
logHelper.Info($"仓库{appConfig.linerStoreCode}PLC未连接");
}
}
else
{
logHelper.Info($"PLC信息为空通过{appConfig.linerStoreCode}未获取到该仓库对应的PLC信息");
}
});
}
catch (Exception ex)
{
logHelper.Error("读取内胆出库应答字异常", ex);
}
}
}
/// <summary>
/// 读取内胆出库完成
/// </summary>
private void ReadLinerFinish_OutStore(string taskCode)
{
lock (string.Empty)
{
try
{
Task.Run(() =>
{
bool isFlag = true;
IPlc _plc = _plcDictionary[appConfig.linerStoreCode];
if (_plc != null)
{
if (_plc.IsConnected)
{
do
{
//读取PLC出库任务完成
if (_plc.readInt32ByAddress(plcConfig.out_liner_finish) == 1)
{
_plc.writeInt32ByAddress(plcConfig.out_liner_finish, 0);
//string taskCode = _plc.readStringByAddress(plcConfig.out_liner_task, 10);
OutStoreFinsihEvent?.Invoke(appConfig.linerStoreCode, taskCode);
isFlag = false;
Thread.Sleep(5000);
}
} while (isFlag);
}
else
{
logHelper.Info($"仓库{appConfig.linerStoreCode}PLC未连接");
}
}
else
{
logHelper.Info($"PLC信息为空通过{appConfig.linerStoreCode}未获取到该仓库对应的PLC信息");
}
});
}
catch (Exception ex)
{
logHelper.Error("读取内胆出库完成异常", ex);
}
}
}
#endregion
}
}

@ -44,11 +44,10 @@ E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Sc
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.dll
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.CoreCompileInputs.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.Business.dll.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.Business.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.Business.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.Model.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\HighWayIot.Common.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\HighWayIot.Config.dll
@ -60,10 +59,12 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\D
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Microsoft.Extensions.DependencyInjection.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\System.Threading.Tasks.Extensions.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\SqlSugar.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Newtonsoft.Json.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\HslCommunication.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.Model.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\HighWayIot.Common.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\HighWayIot.Config.pdb
@ -77,9 +78,8 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\D
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\System.Threading.Tasks.Extensions.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Newtonsoft.Json.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.CoreCompileInputs.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\obj\Debug\Aucma.Scada.Business.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.Business\bin\Debug\Aucma.Scada.HikRobot.pdb

@ -1,17 +1,17 @@
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CoreCompileInputs.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Config.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Newtonsoft.Json.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Newtonsoft.Json.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Config.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Log4net.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\HighWayIot.Common.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\bin\Debug\Newtonsoft.Json.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CoreCompileInputs.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.HikRobot\obj\Debug\Aucma.Scada.HikRobot.pdb

@ -10,7 +10,7 @@ linerStoreCode=NDJCK-001
foamStoreCode=FPJCK-001
shellMaterialType=3
foamMaterialType=2
linerMaterialType=4

@ -3,6 +3,8 @@
箱壳PLC端口=6000
内胆PLCIP=127.0.0.1
内胆PLC端口=6000
泡后PLCIP=127.0.0.1
泡后PLC端口=6000
#箱壳入库地址
[shell_inStore_address]
入库货道号=D101
@ -29,3 +31,13 @@
出库应答字=M203
出库任务号=M204
出库完成=M205
[foam_inStore_address]
入库货道号=D101
入库应答字=D103
入库任务号=D104
入库完成=D105
[foam_outStore_address]
出库货道号=M101
出库应答字=M103
出库任务号=M104
出库完成=M105

@ -241,30 +241,12 @@ E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe
E:\桌面\澳柯玛MES项目\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.SuggestedBindingRedirects.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\OutStoreInfo\OutStoreInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\TaskInfo\TaskInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\RecordControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\App.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI_MarkupCompile.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI_MarkupCompile.lref
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Oracle.ManagedDataAccess.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.UI.exe.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.UI.exe
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.UI.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.Business.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.Model.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\CommonServiceLocator.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\GalaSoft.MvvmLight.dll
@ -278,12 +260,13 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\L
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\LiveCharts.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\LiveCharts.Wpf.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\MySql.Data.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Oracle.ManagedDataAccess.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\SqlSugar.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\System.Data.SQLite.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\System.Windows.Interactivity.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\HighWayIot.Plc.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.Abstractions.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Newtonsoft.Json.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\log4net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\System.Memory.dll
@ -294,6 +277,7 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\S
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\System.Buffers.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.Business.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.Business.dll.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.Model.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\HighWayIot.Common.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\HighWayIot.Config.pdb
@ -312,14 +296,37 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\L
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\LiveCharts.Wpf.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\HighWayIot.Plc.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.Abstractions.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Newtonsoft.Json.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.AssemblyReference.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.SuggestedBindingRedirects.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe.config
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceDetailWindow.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\SpaceInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\OutStoreInfo\OutStoreInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\TaskInfo\TaskInfoControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\RecordControl.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\App.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI_MarkupCompile.cache
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI_MarkupCompile.lref
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\App.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\AssemblyPlanControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\AssemblyPlan\PlanInfoEditWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InStoreInfo\InStoreInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\LogInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\MainWindow.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\InventoryInfoControl.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\LinerInventory.baml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\ShellInventory.baml
@ -336,10 +343,3 @@ E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\A
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.csproj.CopyComplete
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.exe
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Aucma.Scada.UI.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Microsoft.Extensions.DependencyInjection.xml
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\MvCodeReaderSDK.Net.dll
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\bin\Debug\Aucma.Scada.HikRobot.pdb
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.g.cs
E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\Page\InventoryInfo\BomFoamRearInventory.baml

@ -1,4 +1,18 @@

E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.i.cs
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\App.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\AssemblyPlanControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\PlanInfoEditWindow.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InStoreInfo\InStoreInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\LogInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\MainWindow.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\BomFoamRearInventory.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\InventoryInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\LinerInventory.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\ShellInventory.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\SpaceDetailWindow.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\InventoryInfo\SpaceInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\OutStoreInfo\OutStoreInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\TaskInfo\TaskInfoControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\RecordControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\templates\style\resourceStyle.xaml;;

@ -1,4 +1,4 @@

E:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\App.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\AssemblyPlanControl.xaml;;
FE:\桌面\澳柯玛MES项目\程序设计\Aucma.Scada\Aucma.Scada.UI\Page\AssemblyPlan\PlanInfoEditWindow.xaml;;

@ -1,62 +1,2 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}


@ -21,6 +21,7 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
private AppConfig appConfig = AppConfig.Instance;
private OutStoreBusiness outStoreBusiness = OutStoreBusiness.Instance;
public AssemblyPlanViewModel()
{
MoveUpCommand = new RelayCommand<object>(obj => MoveUp(obj));
@ -31,6 +32,7 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
PlanInfoEditCommand = new RelayCommand(PlanInfoEdit);
assemblyPlanBusiness.RefreshExecutePlanInfoEvent += RefreshDataGrid;
outStoreBusiness.RefreshAssemblyPlanInitEvent += RefreshPlanInfoDataGrid;
Init();
}
@ -254,6 +256,28 @@ namespace Aucma.Scada.UI.viewModel.AssemblyPlan
}
private void RefreshPlanInfoDataGrid()
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
var planInfos = assemblyPlanBusiness.GetEexecutePlanInfosByProductLineCode();
RefreshDataGrid(planInfos);
//加载正在执行的计划
planInfos = planInfos.Where(x => x.executeStatus == 2).ToList();
if (planInfos.Count > 0)
{
ExecutePlanInfo planInfo = planInfos.OrderBy(x => x.executeOrder).First();
RefreshPlanExecute(planInfo);
}
OrderCode = string.Empty;
PlanCode = string.Empty;
ProductModel = string.Empty;
}));
}
/// <summary>
/// 柱状体加载
/// </summary>

@ -200,24 +200,36 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// </summary>
public void Query()
{
var info = inStoreBusiness.GetInStoreTask();
if (info != null)
lock (string.Empty)
{
info.ForEach(x => RefreshInStoreTask(x));
}
if (materialTypeCombox == "箱壳")
{
materialTypeCombox = "X-001";
}
else if (materialTypeCombox == "内胆")
{
materialTypeCombox = "X-002";
}
else
{
materialTypeCombox = string.Empty;
#region 通过数据库获取数据进行刷新
var info = inStoreBusiness.GetInStoreTask();
if (info != null)
{
taskItems = new ObservableCollection<RealTaskInfo>();
//info.ForEach(x => RefreshInStoreTask(x));
try
{
foreach (var item in info)
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
item.materialType = inStoreBusiness.GetMaterialName(item.materialType);
taskItems.Add(item);
InstoreTask = taskItems;
}));
}
}
catch (Exception ex)
{
logHelper.Error("入库任务列表刷新异常", ex);
}
}
#endregion
InstoreTask = taskItems.Where(x => !string.IsNullOrEmpty(search) ? x.materialCode == search : 1 == 1);
}
InstoreTask = taskItems.Where(x => !string.IsNullOrEmpty(search) ? x.materialCode == search : 1 == 1 && !string.IsNullOrEmpty(materialTypeCombox) ? x.storeCode == materialTypeCombox : 1 == 1);
}
/// <summary>
@ -279,18 +291,7 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
/// <param name="taskInfo"></param>
private void RefreshInStoreTask(RealTaskInfo taskInfo)
{
try
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
taskItems.Add(taskInfo);
InstoreTask = taskItems;
}));
}
catch (Exception ex)
{
logHelper.Error("入库任务列表刷新异常", ex);
}
Query();
}
/// <summary>

@ -80,12 +80,12 @@ namespace HighWayIot.Config
}
/// <summary>
/// 箱壳物料类型编号
/// 泡后物料类型编号
/// </summary>
public string shellMaterialType
public string foamMaterialType
{
get { return iniHelper.IniReadValue("system", "shellMaterialType"); }
set { iniHelper.IniWriteValue("system", "shellMaterialType", value); }
get { return iniHelper.IniReadValue("system", "foamMaterialType"); }
set { iniHelper.IniWriteValue("system", "foamMaterialType", value); }
}
/// <summary>

@ -26,210 +26,109 @@ namespace HighWayIot.Config
}
#region PLC基础参数
/// <summary>
/// 箱壳PLCIP
/// 泡后PLC IP
/// </summary>
public string shell_Plc_Ip
public string foam_Plc_Ip
{
get { return iniHelper.IniReadValue("plcSystem", "箱壳PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "箱壳PLCIP", value); }
get { return iniHelper.IniReadValue("plcSystem", "泡后PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "泡后PLCIP", value); }
}
/// <summary>
/// 箱壳PLC端口
/// 泡后PLC端口
/// </summary>
public int shell_Plc_Port
public int foam_Plc_Port
{
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "箱壳PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "箱壳PLC端口", value.ToString()); }
}
/// <summary>
/// 内胆PLCIP
/// </summary>
public string liner_Plc_Ip
{
get { return iniHelper.IniReadValue("plcSystem", "内胆PLCIP"); }
set { iniHelper.IniWriteValue("plcSystem", "内胆PLCIP", value); }
}
/// <summary>
/// 内胆PLC端口
/// </summary>
public int liner_Plc_Port
{
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "内胆PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "内胆PLC端口", value.ToString()); }
get { return stringChange.ParseToInt(iniHelper.IniReadValue("plcSystem", "泡后PLC端口")); }
set { iniHelper.IniWriteValue("plcSystem", "泡后PLC端口", value.ToString()); }
}
#endregion
#region 箱壳入库地址
/// <summary>
/// 箱壳——入库货道号
/// </summary>
public string in_shell_spaceCode
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 箱壳——入库应答字
/// </summary>
public string in_shell_answer
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 箱壳——入库任务号
/// </summary>
public string in_shell_task
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库任务号"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库任务号", value); }
}
/// <summary>
/// 箱壳——入库完成
/// </summary>
public string in_shell_finish
{
get { return iniHelper.IniReadValue("shell_inStore_address", "入库完成"); }
set { iniHelper.IniWriteValue("shell_inStore_address", "入库完成", value); }
}
#endregion
#region 内胆入库地址
/// <summary>
/// 内胆——入库货道号
/// </summary>
public string in_liner_spaceCode
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 内胆——入库应答字
/// </summary>
public string in_liner_answer
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 内胆——入库任务号
/// </summary>
public string in_liner_task
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库任务号"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库任务号", value); }
}
/// <summary>
/// 内胆——入库完成
/// </summary>
public string in_liner_finish
{
get { return iniHelper.IniReadValue("liner_inStore_address", "入库完成"); }
set { iniHelper.IniWriteValue("liner_inStore_address", "入库完成", value); }
}
#endregion
#region 箱壳出库地址
/// <summary>
/// 箱壳——出库货道号
/// </summary>
public string out_shell_spaceCode
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库货道号", value); }
}
#region 泡后入库地址
/// <summary>
/// 箱壳——出库数量
/// 泡后——入库货道号
/// </summary>
public string out_shell_amount
public string in_foam_spaceCode
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库数量", value); }
get { return iniHelper.IniReadValue("foam_inStore_address", "入库货道号"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库货道号", value); }
}
/// <summary>
/// 箱壳——出库应答字
/// 泡后——入库应答字
/// </summary>
public string out_shell_answer
public string in_foam_answer
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库应答字", value); }
get { return iniHelper.IniReadValue("foam_inStore_address", "入库应答字"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库应答字", value); }
}
/// <summary>
/// 箱壳——出库任务号
/// 泡后——入库任务号
/// </summary>
public string out_shell_task
public string in_foam_task
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库任务号", value); }
get { return iniHelper.IniReadValue("foam_inStore_address", "入库任务号"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库任务号", value); }
}
/// <summary>
/// 箱壳——出库完成
/// 泡后——入库完成
/// </summary>
public string out_shell_finish
public string in_foam_finish
{
get { return iniHelper.IniReadValue("shell_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("shell_outStore_address", "出库完成", value); }
get { return iniHelper.IniReadValue("foam_inStore_address", "入库完成"); }
set { iniHelper.IniWriteValue("foam_inStore_address", "入库完成", value); }
}
#endregion
#region 内胆出库地址
#region 泡后出库地址
/// <summary>
/// 内胆——出库货道号
/// 泡后——出库货道号
/// </summary>
public string out_liner_spaceCode
public string out_foam_spaceCode
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库货道号", value); }
get { return iniHelper.IniReadValue("foam_outStore_address", "出库货道号"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库货道号", value); }
}
/// <summary>
/// 内胆——出库数量
/// 泡后——出库数量
/// </summary>
public string out_liner_amount
public string out_foam_amount
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库数量", value); }
get { return iniHelper.IniReadValue("foam_outStore_address", "出库数量"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库数量", value); }
}
/// <summary>
/// 内胆——出库应答字
/// 泡后——出库应答字
/// </summary>
public string out_liner_answer
public string out_foam_answer
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库应答字", value); }
get { return iniHelper.IniReadValue("foam_outStore_address", "出库应答字"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库应答字", value); }
}
/// <summary>
/// 内胆——出库任务号
/// 泡后——出库任务号
/// </summary>
public string out_liner_task
public string out_foam_task
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库任务号", value); }
get { return iniHelper.IniReadValue("foam_outStore_address", "出库任务号"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库任务号", value); }
}
/// <summary>
/// 内胆——出库完成
/// 泡后——出库完成
/// </summary>
public string out_liner_finish
public string out_foam_finish
{
get { return iniHelper.IniReadValue("liner_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("liner_outStore_address", "出库完成", value); }
get { return iniHelper.IniReadValue("foam_outStore_address", "出库完成"); }
set { iniHelper.IniWriteValue("foam_outStore_address", "出库完成", value); }
}
#endregion
}

@ -282,13 +282,11 @@ namespace HighWayIot.Plc.Impl
return true;
}
log.PlcLog(String.Format("通过PLC地址{0}写入int32类型数据{1}失败!!!", address, value));
this.IsConnected = false;
return false;
}
catch (Exception ex)
{
log.Error(String.Format("通过PLC地址{0}写入int32类型数据异常", address), ex);
this.IsConnected = false;
return false;
}
}

@ -14,5 +14,12 @@ namespace HighWayIot.Repository.service
/// <param name="materialType"></param>
/// <returns></returns>
BaseBomInfo GetChildenBomInfoByMaterialCode(string materialCode, string materialType);
/// <summary>
/// 根据物料编号获取BOM信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
BaseBomInfo GetBomInfoByMaterialCode(string materialCode);
}
}

@ -44,6 +44,25 @@ namespace HighWayIot.Repository.service.Impl
return bomInfo;
}
/// <summary>
/// 根据物料编号获取BOM信息
/// </summary>
/// <param name="materialCode"></param>
/// <returns></returns>
public BaseBomInfo GetBomInfoByMaterialCode(string materialCode)
{
BaseBomInfo bomInfo = null;
try
{
bomInfo = _bomInfoRepository.GetFirst(x => x.materialCode == materialCode);
}
catch (Exception ex)
{
logHelper.Error("根据物料编号获取BOM信息异常", ex);
}
return bomInfo;
}
private List<BaseBomInfo> GetChildenByParentId(string parentId, List<BaseBomInfo> result = null)
{
if (result == null)

@ -35,11 +35,11 @@ namespace HighWayIot.Repository.service.Impl
if (spaceInfos.Count == 0) //没有指定该类型物料的货道信息,需获取空白货道信息进行分配
{
spaceInfos = GetEmptySpaceInfo();
spaceInfos = GetEmptySpaceInfo(store);
}
logHelper.Info($"根据仓库{store};物料:{materialType};获取到的货道信息:{jsonChange.ModeToJson(spaceInfos)}");
spaceInfo = inStoreFilter(spaceInfos);
if(spaceInfo != null)
if (spaceInfo != null)
{
logHelper.Info($"仓库{store};物料:{materialType};匹配的入库货道信息:{jsonChange.ModeToJson(spaceInfo)}");
@ -81,13 +81,13 @@ namespace HighWayIot.Repository.service.Impl
/// 获取空货道:未分配物料型号的空白货道
/// </summary>
/// <returns></returns>
private List<BaseSpaceInfo> GetEmptySpaceInfo()
private List<BaseSpaceInfo> GetEmptySpaceInfo(string store)
{
List<BaseSpaceInfo> spaceInfos = null;
try
{
Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.materialType == null && x.spaceCapacity != x.spaceStock);
exp = exp.And(x => x.materialType == null && x.storeCode == store && x.spaceCapacity != x.spaceStock);
spaceInfos = _mesRepository.GetList(exp);
}
catch (Exception ex)

Loading…
Cancel
Save