change- 入库逻辑修改,完成信号改为监测在途数

foamRearStore
liuwf 9 months ago
parent 868f7f30a7
commit f165ada25f

Binary file not shown.

@ -57,7 +57,7 @@ namespace Aucma.Scada.Business
/// 下传执行计划
/// </summary>
/// <param name="planInfo"></param>
public delegate void NextPassExecutePlanInfo(ExecutePlanInfo planInfo);
public delegate void NextPassExecutePlanInfo(ExecutePlanInfo planInfo,BaseSpaceInfo spaceInfo = null);
public event NextPassExecutePlanInfo NextPassExecutePlanInfoEvent;
#endregion
@ -121,7 +121,7 @@ namespace Aucma.Scada.Business
/// </summary>
/// <param name="productPlanCode"></param>
/// <param name="transmitAmount"></param>
public bool PlanTransmitByProductPlan(string productPlanCode, int transmitAmount)
public bool PlanTransmitByProductPlan(string productPlanCode, int transmitAmount,BaseSpaceInfo spaceInfo = null)
{
bool result = false;
try
@ -147,7 +147,7 @@ namespace Aucma.Scada.Business
GetEexecutePlanInfosByProductLineCode();
// 直接下达 2023-12-20
ExecutePlanInfo_NextPass(executePlanInfo.executePlanCode, "");
ExecutePlanInfo_NextPass(executePlanInfo.executePlanCode, "",spaceInfo);
}
}
}
@ -233,7 +233,7 @@ namespace Aucma.Scada.Business
/// 下传计划
/// </summary>
/// <param name="planCode"></param>
public ExecutePlanInfo ExecutePlanInfo_NextPass(string planCode, string nowPlanCode)
public ExecutePlanInfo ExecutePlanInfo_NextPass(string planCode, string nowPlanCode,BaseSpaceInfo spaceInfo = null)
{
ExecutePlanInfo planInfo = null;
try
@ -254,7 +254,7 @@ namespace Aucma.Scada.Business
if (planInfo != null)
{
//传给出库
NextPassExecutePlanInfoEvent?.Invoke(planInfo);
NextPassExecutePlanInfoEvent?.Invoke(planInfo,spaceInfo);
planInfo.executeStatus = 2;
planInfo.beginTime = DateTime.Now;

@ -120,15 +120,21 @@ namespace Aucma.Scada.Business
MvCodeHelper.RefreshLogMessageEvent += PrintLogInfoMessage;
StartPassDown();
//Task.Run(() =>
//{
// Thread.Sleep(6000);
// Thread.Sleep(3000);
// for (int i = 1; i < 2; i++)
// {
// InStore("B24010181060282920010");
// // 8302501181 8302500586 9
// InStore("B2401018302500586001" + i);
// Thread.Sleep(1000);
// }
//});
// InStore("B2401018302501181001" + 1);
// Thread.Sleep(1000);
// InStore("B2401018302500889001" + 1);
// });
}
#region delete 2024-01-04出库时堵塞入库 ,不需要堵塞整个库
@ -344,7 +350,8 @@ namespace Aucma.Scada.Business
}
else
{
PrintLogInfoMessage("未获取到需要下发的泡后入库任务");
logHelper.Info("未获取到需要下发的泡后入库任务");
// PrintLogInfoMessage("未获取到需要下发的泡后入库任务");
}
}
catch (Exception ex)
@ -436,11 +443,11 @@ namespace Aucma.Scada.Business
RecordInstore recordInstore = new RecordInstore();
recordInstore.storeCode = taskInfo.storeCode;
recordInstore.spaceCode = taskInfo.spaceCode;
recordInstore.materialCode = taskInfo.materialCode;
recordInstore.materialType = taskInfo.materialType;
recordInstore.materialCode = taskInfo.materialCode;
recordInstore.materialType = taskInfo.materialType;
recordInstore.materialName = GetMaterialName(taskInfo.materialType);
recordInstore.inStoreAmount = 1;
recordInstore.inStoreTime = DateTime.Now;
recordInstore.inStoreTime = DateTime.Now;
recordInstore.barcodeCode = taskInfo.materialCode;
_recordInStoreService.InsertRecordInStore(recordInstore);
#endregion
@ -575,7 +582,7 @@ namespace Aucma.Scada.Business
}
catch (Exception ex)
{
PrintLogErrorMessage("货道信息读取异常", ex);
PrintLogErrorMessage("货道信息plc读取异常", ex);
}
return result;

@ -1,10 +1,12 @@
using Aucma.Scada.Model.domain;
using HighWayIot.Common;
using HighWayIot.Config;
using HighWayIot.Log4net;
using HighWayIot.Plc;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@ -39,6 +41,13 @@ namespace Aucma.Scada.Business
private RegisterServices registerServices = RegisterServices.Instance;
private JsonChange json = JsonChange.Instance;
/// <summary>
/// 已下传的任务信息
/// </summary>
private List<RealTaskInfo> foamRearTaskInfos ;
/// <summary>
/// 实时任务
/// </summary>
@ -48,7 +57,7 @@ namespace Aucma.Scada.Business
#region 私有变量
private Dictionary<string, IPlc> _plcDictionary = new Dictionary<string, IPlc>();
private Dictionary<string, int> foamRearKeyValuePairs = new Dictionary<string, int>();
/// <summary>
/// 泡后任务编号,PLC反馈后进行赋值
/// </summary>
@ -78,11 +87,52 @@ namespace Aucma.Scada.Business
{
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
_plcDictionary = _pool.GetAll();
List<RealTaskInfo> taskList = _taskInfoService.GetTaskInfosForInstore(appConfig.foamStoreCode, appConfig.instoreTaskType, 2);
RealReadFinish();
// 程序启动查询数据库
foamRearTaskInfos = _taskInfoService.GetTaskInfosForInstore(appConfig.foamStoreCode, appConfig.instoreTaskType, 2);
foamRearTaskInfos = new List<RealTaskInfo>();
RealReadPlcSpace();
SendHeart();
// RealReadFinish(); change-入库完成信号改回监测在途数
// test();
}
//public void test()
//{
// Task.Run(() =>
// {
// while (true)
// {
// List<RealTaskInfo> taskList = _taskInfoService.GetTaskInfosByStoreCode(new string[] { appConfig.foamStoreCode }, appConfig.instoreTaskType);
// Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} ======》 打印数据:{json.ModeToJson(taskList)}");
// //Thread.Sleep(500);
// }
// });
//}
/// <summary>
/// 心跳
/// </summary>
private void SendHeart()
{
Task.Run(() =>
{
Thread.Sleep(3000);
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
#region 判断入库是否完成
if (_plc != null)
{
while (true)
{
_plc.writeInt32ByAddress("D7020",1);
Thread.Sleep(1000);
_plc.writeInt32ByAddress("D7020", 0);
Thread.Sleep(1000);
}
}
});
}
#region 判断入库是否完成 delete20240224-入库完成信号改回监测在途数
/// <summary>
/// 实时读取入库完成信号
/// </summary>
@ -126,7 +176,9 @@ namespace Aucma.Scada.Business
/// <param name="taskInfo"></param>
/// <returns></returns>
public void JudgeIsFinish(RealTaskInfo taskInfo,IPlc _plc,SpaceAddress spaceAddress)
{
{
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(spaceAddress.inStoreFinish, 1);
//读取入库完成反馈信号
if (_plc.readInt32ByAddress(spaceAddress.inStoreFinish) == 1)
{
@ -134,10 +186,82 @@ namespace Aucma.Scada.Business
InStoreFinsihEvent(taskInfo.taskCode);
}
}
#endregion
#endregion
#region 监测PLC在途数量变化完成入库任务
#region 泡后入库任务下发处理
public int SendFoamTask_InStore(RealTaskInfo taskInfo)
private void RealReadPlcSpace()
{
Thread.Sleep(5000);
Task.Run(() =>
{
while (true)
{
RealReadShellPlcSpace();
Thread.Sleep(500);
}
});
}
/// <summary>
/// 读取箱壳已下发任务的货道信息读取后将货道编号及在途数量写入Dictionary进行比较在途数减少则入库完成
/// </summary>
private void RealReadShellPlcSpace()
{
if (foamRearTaskInfos != null && foamRearTaskInfos.Count>0)
{
List<string> spaceCodes = foamRearTaskInfos.Select(x => x.spaceCode).Distinct().ToList();
for (int i = 0; i < spaceCodes.Count; i++)
{
string spaceCode = spaceCodes[i];
BaseSpaceInfo spaceInfo = new BaseSpaceInfo() { storeCode = appConfig.foamStoreCode, spaceCode = spaceCode };
spaceInfo = ReadSpaceInfoByPlc(spaceInfo);
if (foamRearKeyValuePairs.ContainsKey(spaceInfo.spaceCode))
{
foamRearKeyValuePairs.TryGetValue(spaceInfo.spaceCode, out int value);
//判断前次读取的数据和当前数据,如果前次数据大于当前数据则代表入库完成,然后筛选任务中对应货道的首个任务进行完成
//如果前次数据不大于当前数据则更新字典中存放的数据
if (value > spaceInfo.onRouteAmount)
{
//筛选任务
var list = foamRearTaskInfos.Where(x => x.spaceCode == spaceInfo.spaceCode).ToList();
if (list.Count > 0)
{
RealTaskInfo taskInfo = list.OrderBy(x => x.createTime).First();
InStoreFinsihEvent?.Invoke(taskInfo.taskCode);
foamRearTaskInfos.Remove(taskInfo);
}
foamRearKeyValuePairs.Remove(spaceInfo.spaceCode);
}
else
{
foamRearKeyValuePairs[spaceInfo.spaceCode] = spaceInfo.onRouteAmount;
}
}
else
{
foamRearKeyValuePairs.Add(spaceInfo.spaceCode, spaceInfo.onRouteAmount);
}
}
}
}
#endregion
#region 泡后入库任务下发处理
public int SendFoamTask_InStore(RealTaskInfo taskInfo)
{
int result = 0;
try
@ -147,7 +271,9 @@ namespace Aucma.Scada.Business
if (_plc != null)
{
if (_plc.IsConnected)
{
{
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 1);
if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 1)
{
logHelper.Info("泡后入库应答字为1货道号:" + plcConfig.in_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1)));
@ -207,6 +333,8 @@ namespace Aucma.Scada.Business
{
do
{
// 测试方法模拟plc正式启用删除
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 2);
//读取PLC应答字为2时上位机清空写入的入库内容
if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 2)
{
@ -217,7 +345,7 @@ namespace Aucma.Scada.Business
// _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 0);
isFlag = false;
foamRearTaskInfos.Add(taskInfo);
InStoreAnswerEvent?.Invoke(appConfig.foamStoreCode, taskInfo.taskCode);
}
@ -255,12 +383,11 @@ namespace Aucma.Scada.Business
if (_plc != null)
{
if (_plc.IsConnected)
{
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
}
}
return spaceInfo;

@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static Aucma.Scada.Business.OutStoreTaskHandle;
namespace Aucma.Scada.Business
@ -125,7 +126,7 @@ namespace Aucma.Scada.Business
/// 接收下达的组装计划根据BOM获取需要出库的泡后、内胆物料信息
/// </summary>
/// <param name="planInfo"></param>
private void PlanHandle(ExecutePlanInfo planInfo)
private void PlanHandle(ExecutePlanInfo planInfo,BaseSpaceInfo spaceInfo = null)
{
lock (string.Empty)
{
@ -143,7 +144,7 @@ namespace Aucma.Scada.Business
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{
string taskCode = System.Guid.NewGuid().ToString("N").Substring(0, 10);
OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode);
OutStore(appConfig.foamStoreCode, bomInfo, planInfo.executePlanCode, taskCode,spaceInfo);
Thread.Sleep(500);
}
}
@ -157,7 +158,7 @@ namespace Aucma.Scada.Business
/// <param name="storeCode"></param>
/// <param name="bomInfo"></param>
/// <param name="planCode"></param>
private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode)
private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode,BaseSpaceInfo spaceInfo = null)
{
try
{
@ -165,7 +166,10 @@ namespace Aucma.Scada.Business
#region Delete By wenjy 2023-10-30 11:41:00 取消通过数据库获取货道数量、在途量改为通过PLC获取货道信息
//BaseSpaceInfo spaceInfo = _spaceInfoService.OutStoreGetSpaceInfoByMaterialCode(storeCode, bomInfo.materialCode);
#endregion
BaseSpaceInfo spaceInfo = GetSpaceInfoByMaterialType(storeCode, bomInfo.materialCode);
if(spaceInfo == null)
{
spaceInfo = GetSpaceInfoByMaterialType(storeCode, bomInfo.materialCode);
}
if (spaceInfo != null)
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
@ -208,6 +212,7 @@ namespace Aucma.Scada.Business
{
#region 出库任务赋值
RealTaskInfo realTaskInfo = new RealTaskInfo();
// 执行计划编号
realTaskInfo.planCode = planCode;
realTaskInfo.taskType = 2;
realTaskInfo.taskCode = taksCode;
@ -249,6 +254,7 @@ namespace Aucma.Scada.Business
return result;
}
/// <summary>
/// 根据创建时间获取第一个货道明细
/// </summary>
@ -337,14 +343,14 @@ namespace Aucma.Scada.Business
if (taskInfo != null)
{
PrintLogInfoMessage($"下发泡后出库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}");
// PrintLogInfoMessage($"下发泡后出库任务:{taskInfo.taskCode};仓库{taskInfo.storeCode};货道:{taskInfo.spaceCode}");
int result = taskHandleBusiness.SendFoamTask_OutStore(taskInfo);
if (result==1)
{
PrintLogInfoMessage($"泡后出库任务:{taskInfo.taskCode}下发成功等待PLC执行反馈");
PrintLogInfoMessage($"出库任务:{taskInfo.taskCode}下发成功等待PLC执行反馈");
semaphore.Wait();//一直堵塞直到信号量释放
PrintLogInfoMessage($"泡后出库任务:{taskInfo.taskCode};开始执行");
PrintLogInfoMessage($"出库任务:{taskInfo.taskCode};开始执行");
taskInfo.taskStatus = 2;
_taskInfoService.UpdateTaskInfo(taskInfo);
@ -616,7 +622,19 @@ namespace Aucma.Scada.Business
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo.spaceStock > 0)
{
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1);
#region 创建mes执行任务关联生产计划
var productPlanInfo = _productPlanInfoService.GetProductPlanInfosByMaterialCode(spaceInfo.materialType);
if(productPlanInfo != null)
{
result = assemblyPlanBusiness.PlanTransmitByProductPlan(productPlanInfo.planCode, 1,spaceInfo);
}
#endregion
else
{
// 不关联生产计划
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1);
}
}
else
{
@ -630,6 +648,56 @@ namespace Aucma.Scada.Business
return result;
}
/// <summary>
/// 整道出
/// </summary>
/// <param name="storeCode"></param>
/// <param name="spaceCode"></param>
/// <returns></returns>
public bool OutAllBySpaceCode(string storeCode, string spaceCode)
{
bool result = false;
try
{
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo.spaceStock > 0)
{
#region 创建mes执行任务关联生产计划
var productPlanInfo = _productPlanInfoService.GetProductPlanInfosByMaterialCode(spaceInfo.materialType);
if (productPlanInfo != null)
{
result = assemblyPlanBusiness.PlanTransmitByProductPlan(productPlanInfo.planCode, spaceInfo.spaceStock);
}
#endregion
else
{
for(int i = 1; i < spaceInfo.spaceStock; i++)
{
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N").Substring(0, 10), System.Guid.NewGuid().ToString("N").Substring(0, 10), 1);
if (!result)
{
return false;
}
}
}
}
else
{
PrintLogInfoMessage($"仓库:{storeCode};货道:{spaceCode};出库失败:库存不足");
}
}
catch (Exception ex)
{
logHelper.Error("根据货道出一个异常", ex);
}
return result;
}
/// <summary>
/// 日志输出,界面刷新同时记录文件
/// </summary>

@ -145,6 +145,7 @@ namespace Aucma.Scada.Business
#endregion
#region 泡后出库任务下发处理
/// <summary>
/// 泡后出库任务下发

@ -14,6 +14,7 @@ namespace Aucma.Core.Scanner
{
public class MvCodeHelper
{
private static LogHelper logHelper = LogHelper.Instance;
private static AppConfig appConfig = AppConfig.Instance;
public static bool m_bGrabbing = true;
#region 委托事件
@ -40,19 +41,27 @@ namespace Aucma.Core.Scanner
/// <returns></returns>
public static bool ConnectionStatus(string ip)
{
// 遍历所有已打开相机
foreach (KeyValuePair<MvCodeReader, string> hashmap in m_cMyDevices)
try
{
if (ip.Equals(hashmap.Value))
// 遍历所有已打开相机
foreach (KeyValuePair<MvCodeReader, string> hashmap in m_cMyDevices)
{
return true;
if (ip.Equals(hashmap.Value))
{
return true;
}
}
// 没有连接上,重新获取并创建设备
Task.Run(() =>
{
DeviceListAcq();
});
}
// 没有连接上,重新获取并创建设备
Task.Run(() =>
catch (Exception ex)
{
DeviceListAcq();
});
logHelper.Error(ex.Message.ToString());
}
return false;
}
#endregion
@ -65,21 +74,26 @@ namespace Aucma.Core.Scanner
{
try
{
RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法");
// RefreshLogMessageEvent?.Invoke("获取扫码器设备列表,进入DeviceListAcq()方法");
// 扫码器ip
string scannerIp = appConfig.foamHikRobotIp;
if (string.IsNullOrEmpty(scannerIp)) return;
System.GC.Collect();
m_stDeviceList.nDeviceNum = 0;
// 获取设备列表
int nRet = MvCodeReader.MV_CODEREADER_EnumDevices_NET(ref m_stDeviceList, MvCodeReader.MV_CODEREADER_GIGE_DEVICE);
if (0 != nRet)
{
logHelper.Info("获取扫码器列表失败,扫码器错误码:" + nRet);
RefreshLogMessageEvent?.Invoke("获取扫码器列表失败,扫码器错误码:" + nRet);
return;
}
if (0 == m_stDeviceList.nDeviceNum)
{
RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
// RefreshLogMessageEvent?.Invoke("获取扫码器数量为0请检查扫码器连接:");
return;
}
@ -96,14 +110,14 @@ namespace Aucma.Core.Scanner
// 获取ip
string ip = ((stGigEDeviceInfo.nCurrentIp & 0xff000000) >> 24) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x00ff0000) >> 16) + "." + ((stGigEDeviceInfo.nCurrentIp & 0x0000ff00) >> 8) + "." + (stGigEDeviceInfo.nCurrentIp & 0x000000ff);
// Console.WriteLine($"打印扫码设备信息,下标:{i}IP{ip}");
Console.Write("扫码器设备[" + i + "],ip:" + ip);
// 创建第i个设备
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
// 只连接配置的扫码器
if (!scannerIp.Equals(ip)) continue;
// 创建第i个设备
stDevInfo = (MvCodeReader.MV_CODEREADER_DEVICE_INFO)Marshal.PtrToStructure(m_stDeviceList.pDeviceInfo[i], typeof(MvCodeReader.MV_CODEREADER_DEVICE_INFO));
nRet = m_cMyDevice.MV_CODEREADER_CreateHandle_NET(ref stDevInfo);//创建设备
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip);
// Console.WriteLine("创建第" + i + "个扫码器设备失败,ip:" + ip);
return;
}
// 打开设备
@ -111,15 +125,15 @@ namespace Aucma.Core.Scanner
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
m_cMyDevice.MV_CODEREADER_DestroyHandle_NET();
Console.WriteLine("Device open fail!");
// Console.WriteLine("Device open fail!");
return;
}
RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip);
// RefreshLogMessageEvent?.Invoke("创建并打开第" + i + "个扫码器设备成功,ip:" + ip);
//设置触发模式
nRet = m_cMyDevice.MV_CODEREADER_SetEnumValue_NET("TriggerMode", (uint)MvCodeReader.MV_CODEREADER_TRIGGER_MODE.MV_CODEREADER_TRIGGER_MODE_ON);
if (MvCodeReader.MV_CODEREADER_OK != nRet)
{
Console.WriteLine("设置触发模式失败");
// Console.WriteLine("设置触发模式失败");
return;
}
//添加到集合
@ -129,7 +143,7 @@ namespace Aucma.Core.Scanner
}
catch (Exception ex)
{
Console.WriteLine("获取和创建设备异常:" + ex);
logHelper.Error("获取和创建扫码器设备异常:" + ex.Message.ToString());
}
}
#endregion
@ -178,10 +192,11 @@ namespace Aucma.Core.Scanner
Array.Copy(stBcrResult.stBcrInfoEx2[i].chCode, buffer, 22);
}
string strCode = Encoding.GetEncoding("UTF-8").GetString(buffer).Trim().TrimEnd('\0');
RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
// RefreshLogMessageEvent?.Invoke("相机ip:" + hashmap.Value + " Get CodeNum: " + "CodeNum[" + i.ToString() + "], CodeString[" + strCode + "]");
if (!string.IsNullOrEmpty(strCode))
{
// 获取到条码处理业务
logHelper.Info("扫码器扫描到条码:"+strCode);
// 获取到条码处理业务
RefreshMaterialCodeStrEvent?.Invoke(strCode);
}

@ -56,14 +56,19 @@
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
<Grid>
<Grid.ColumnDefinitions>
<!--<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="白班" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>
</Grid.ColumnDefinitions>-->
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding ShiftStr}" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Row="1" Text="{Binding CurrentDateTime}" FontSize="20" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<!--<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>-->
</Grid>
</StackPanel>
</Grid>

@ -248,9 +248,9 @@
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="20">
<lvc:Axis FontSize="20" MinValue="0">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
<lvc:Separator Step="10" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
@ -364,9 +364,9 @@
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="20">
<lvc:Axis FontSize="20" MinValue="0">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
<lvc:Separator Step="10" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.AssemblyPlan"
xmlns:local1="clr-namespace:Aucma.Scada.UI.Converter.AssemblyPlan"
mc:Ignorable="d"
Title="MES生产计划" Height="650" Width="900" Name="window" WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei" Background="#1152AC"
Title="MES生产计划" Height="650" Width="1000" Name="window" WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei" Background="#1152AC"
ResizeMode="NoResize" >
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
@ -146,9 +146,10 @@
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding planCode}" Header="计划编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding orderCode}" Header="工单编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialName}" Header="产品型号" Width="2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding planAmount}" Header="计划数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding completeAmount}" Header="完成数量" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialCode}" Header="产品编码" Width="1.3*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialName}" Header="产品型号" Width="2.3*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding planAmount}" Header="计划数量" Width="0.8*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding completeAmount}" Header="完成数量" Width="0.8*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding beginTime,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="开始时间" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>

@ -162,9 +162,9 @@
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15">
<lvc:Axis FontSize="15" MinValue="0">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
<lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>

@ -92,18 +92,19 @@
<Border.Effect>
<DropShadowEffect Color="#1254AB" ShadowDepth="0" BlurRadius="5" Opacity="0.5" Direction="0"></DropShadowEffect>
</Border.Effect>
<ItemsControl Grid.Column="0" ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" >
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl Grid.Column="0" ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" >
<ItemsControl.ItemsPanel>
<!--布局-->
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"></WrapPanel>
<WrapPanel Orientation="Horizontal"></WrapPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--控件模板-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Control x:Name="ctrl" Width="450" Height="200" ></Control>
<Control x:Name="ctrl" Width="550" Height="200" ></Control>
<DataTemplate.Triggers>
<!--根据不同类型选择不同模板-->
<DataTrigger Binding="{Binding spaceType}" Value="1">
@ -116,7 +117,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<!--<RowDefinition Height="2*"/>-->
<RowDefinition Height="*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
@ -156,6 +157,7 @@
<Border Grid.Row="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<!--<RowDefinition/>
<RowDefinition/>-->
@ -163,6 +165,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<!--<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
@ -170,13 +173,19 @@
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Grid.Row="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号1" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="产品编码" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="0" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.SubmitCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding Text, ElementName=spaceCodeText}" Background="Transparent">
<TextBlock Text="{Binding materialType}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="产品名称" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding typeNameA}" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<!--<Border Grid.Column="0" Grid.Row="1" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="型号2" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
@ -206,6 +215,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="状态" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
@ -243,6 +253,11 @@
<TextBlock Text="出一个" Foreground="Green" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="7" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.OutAllCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{StaticResource BUTTON_AGREE}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="整道出" Foreground="Green" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
</Grid>
</Border>
</Grid>
@ -258,6 +273,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
<Border Grid.Column="1" BorderBrush="#1254AB" BorderThickness="2" Margin="5">
@ -281,8 +297,8 @@
Foreground="#FFFFFF" >
<!--resourceStyle 399行修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding spaceCode}" Header="货道编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialCode}" Header="物料编号" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding spaceCode}" Header="货道编号" Width="0.5*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialCode}" Header="物料编号" Width="1.2*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding materialName}" Header="物料名称" Width="*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding materialType}" Header="物料类型" Width="1*" IsReadOnly="True"/>-->
</DataGrid.Columns>

@ -116,8 +116,8 @@
<TextBlock Text="选择型号: " FontSize="20" Foreground="#FFFFFF" />
<RadioButton Content="型号1" GroupName="Direction" IsChecked="{Binding IsSelectedOptionA, Mode=TwoWay}" />
<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
<RadioButton Content="型号3" GroupName="Direction" IsChecked="{Binding IsSelectedOptionC, Mode=TwoWay}" Margin="10 0 0 0"/>
<!--<RadioButton Content="型号2" GroupName="Direction" IsChecked="{Binding IsSelectedOptionB, Mode=TwoWay}" Margin="10 0 0 0"/>
<RadioButton Content="型号3" GroupName="Direction" IsChecked="{Binding IsSelectedOptionC, Mode=TwoWay}" Margin="10 0 0 0"/>-->
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">

@ -25,4 +25,4 @@ outstoreTaskType=2
#泡后扫码器IP
foamHikRobotIp=169.254.100.169
searchItems=SC232%SC233%SC234%150%%%
searchItems=SC232%SC233%SC234%310%%%%

@ -1,6 +1,6 @@
[plcSystem]
ナンコ<EFBFBD>LCIP=127.0.0.1
ナンコ<EFBFBD>LCカヒソレ=6000
ナンコ<EFBFBD>LCIP=10.10.92.40
ナンコ<EFBFBD>LCカヒソレ=2015
[foam_inStore_address]
Èë¿â»õµÀºÅ=D7000

@ -1,45 +1,45 @@
#泡后库货道信息 #是否已满=D7221 #货道状态=D7231 仓库状态=D7300 #设备状态字,0未启动状态,1已自动运行,2维修调试状态,禁止启动
[FPJCK-001_PH_001]
[PHK-001_PH_001]
在库数量=D7201
在途数量=D7211
入库完成=D7021
出库完成=D7240
[FPJCK-001_PH_002]
[PHK-001_PH_002]
在库数量=D7202
在途数量=D7212
入库完成=D7022
出库完成=D7240
[FPJCK-001_PH_003]
[PHK-001_PH_003]
在库数量=D7203
在途数量=D7213
入库完成=D7023
出库完成=D7240
[FPJCK-001_PH_004]
[PHK-001_PH_004]
在库数量=D7204
在途数量=D7214
入库完成=D7024
出库完成=D7240
[FPJCK-001_PH_005]
[PHK-001_PH_005]
在库数量=D7205
在途数量=D7215
入库完成=D7025
出库完成=D7240
[FPJCK-001_PH_006]
[PHK-001_PH_006]
在库数量=D7206
在途数量=D7216
入库完成=D7026
出库完成=D7240
[FPJCK-001_PH_007]
[PHK-001_PH_007]
在库数量=D7207
在途数量=D7217
入库完成=D7027
出库完成=D7240
[FPJCK-001_PH_008]
[PHK-001_PH_008]
在库数量=D7208
在途数量=D7218
入库完成=D7028
出库完成=D7240
[FPJCK-001_PH_009]
[PHK-001_PH_009]
在库数量=D7209
在途数量=D7219
入库完成=D7029

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "84F515A86A4846FC82B9B47C7EDB54DC973761E8F2F843D1C81762A668D8806E"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1296D2EF215B5C9FF53838D5B9FC5A2B6B1D38722C6D080F11FEFF784D1288AA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -41,7 +41,7 @@ namespace Aucma.Scada.UI {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 82 "..\..\MainWindow.xaml"
#line 87 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button instoreInfo;
@ -49,7 +49,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 83 "..\..\MainWindow.xaml"
#line 88 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button outstoreInfo;
@ -57,7 +57,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 84 "..\..\MainWindow.xaml"
#line 89 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button taskInfo;
@ -65,7 +65,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 85 "..\..\MainWindow.xaml"
#line 90 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button inventoryInfo;
@ -73,7 +73,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 86 "..\..\MainWindow.xaml"
#line 91 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button assemblyPlan;
@ -81,7 +81,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 90 "..\..\MainWindow.xaml"
#line 95 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Minimized;
@ -89,7 +89,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 91 "..\..\MainWindow.xaml"
#line 96 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Exit;
@ -97,7 +97,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 97 "..\..\MainWindow.xaml"
#line 102 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush MesDbStatus;
@ -105,7 +105,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 100 "..\..\MainWindow.xaml"
#line 105 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock MesDbStateTxt;
@ -113,7 +113,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 103 "..\..\MainWindow.xaml"
#line 108 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush PlcStatus;
@ -121,7 +121,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 106 "..\..\MainWindow.xaml"
#line 111 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PLCState;
@ -129,7 +129,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 110 "..\..\MainWindow.xaml"
#line 115 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush Scanner1Status;
@ -137,7 +137,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 113 "..\..\MainWindow.xaml"
#line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock Scanner1;

@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "84F515A86A4846FC82B9B47C7EDB54DC973761E8F2F843D1C81762A668D8806E"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1296D2EF215B5C9FF53838D5B9FC5A2B6B1D38722C6D080F11FEFF784D1288AA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -41,7 +41,7 @@ namespace Aucma.Scada.UI {
public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 82 "..\..\MainWindow.xaml"
#line 87 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button instoreInfo;
@ -49,7 +49,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 83 "..\..\MainWindow.xaml"
#line 88 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button outstoreInfo;
@ -57,7 +57,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 84 "..\..\MainWindow.xaml"
#line 89 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button taskInfo;
@ -65,7 +65,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 85 "..\..\MainWindow.xaml"
#line 90 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button inventoryInfo;
@ -73,7 +73,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 86 "..\..\MainWindow.xaml"
#line 91 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button assemblyPlan;
@ -81,7 +81,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 90 "..\..\MainWindow.xaml"
#line 95 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Minimized;
@ -89,7 +89,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 91 "..\..\MainWindow.xaml"
#line 96 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button Exit;
@ -97,7 +97,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 97 "..\..\MainWindow.xaml"
#line 102 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush MesDbStatus;
@ -105,7 +105,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 100 "..\..\MainWindow.xaml"
#line 105 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock MesDbStateTxt;
@ -113,7 +113,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 103 "..\..\MainWindow.xaml"
#line 108 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush PlcStatus;
@ -121,7 +121,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 106 "..\..\MainWindow.xaml"
#line 111 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PLCState;
@ -129,7 +129,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 110 "..\..\MainWindow.xaml"
#line 115 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Media.ImageBrush Scanner1Status;
@ -137,7 +137,7 @@ namespace Aucma.Scada.UI {
#line hidden
#line 113 "..\..\MainWindow.xaml"
#line 118 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock Scanner1;

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81BB58658FBF245B46897C7FED6C2717ED87387144DEA479AC0C7218AF0B119C"
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B4DB7DC5AC844B473794BE5AD1EA1C85167140643555D4BEB710FCAB6D553509"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81BB58658FBF245B46897C7FED6C2717ED87387144DEA479AC0C7218AF0B119C"
#pragma checksum "..\..\..\..\Page\AssemblyPlan\AssemblyPlanControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B4DB7DC5AC844B473794BE5AD1EA1C85167140643555D4BEB710FCAB6D553509"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B659539AE4E067497E0D82C0BD50A089445DAE70FC3F9B0813DCDEA948D7AC79"
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A8BCABA5CBE8F206A8C3B8531F1994EAA59CB846EA6698F761A3BEFADAC62040"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B659539AE4E067497E0D82C0BD50A089445DAE70FC3F9B0813DCDEA948D7AC79"
#pragma checksum "..\..\..\..\Page\AssemblyPlan\PlanInfoEditWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "A8BCABA5CBE8F206A8C3B8531F1994EAA59CB846EA6698F761A3BEFADAC62040"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7012E740612AEB51281394C4CADCE95451CE8202499FB91074E1297E31AD081D"
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27725EFE70A99F62EE757B45F2A95B25B711DC8F9DE032F083EE71DCD4D1E6DA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7012E740612AEB51281394C4CADCE95451CE8202499FB91074E1297E31AD081D"
#pragma checksum "..\..\..\..\Page\InStoreInfo\InStoreInfoControl.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27725EFE70A99F62EE757B45F2A95B25B711DC8F9DE032F083EE71DCD4D1E6DA"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43D95CFBDF80A87CAE8F4743F718368517E5C4F5064091D0BED61F628153B897"
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "051C148C286C0C6F0D9F7368DD7DD9D694A4480FCEB90FF0E65EB555235E1435"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43D95CFBDF80A87CAE8F4743F718368517E5C4F5064091D0BED61F628153B897"
#pragma checksum "..\..\..\..\Page\InventoryInfo\BomFoamRearInventory.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "051C148C286C0C6F0D9F7368DD7DD9D694A4480FCEB90FF0E65EB555235E1435"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E46B7692378AE323FA368BD3CA7165488E519DC145B1B4257FFA345E50ED22CB"
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "29806FD6F0358C6BE2BE294B297ED745F04A4F4E68973B3EEFC6268C197059E9"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E46B7692378AE323FA368BD3CA7165488E519DC145B1B4257FFA345E50ED22CB"
#pragma checksum "..\..\..\..\Page\InventoryInfo\SelectType.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "29806FD6F0358C6BE2BE294B297ED745F04A4F4E68973B3EEFC6268C197059E9"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。

@ -4,6 +4,7 @@ using Aucma.Scada.UI.Page.InventoryInfo;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using HighWayIot.Config;
using HighWayIot.Plc;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -30,6 +31,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private AppConfig appConfig = AppConfig.Instance;
private AssemblyPlanBusiness assemblyPlanBusiness = AssemblyPlanBusiness.Instance;
public BoxFoamRearInventoryViewModel()
{
@ -50,6 +53,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
SpaceDetailCommand = new RelayCommand<object>(obj => SpaceDetail(obj));
OutOnlyOneCommand = new RelayCommand<object>(obj => OutOnlyOne(obj));
OutAllCommand = new RelayCommand<object>(obj => OutAll(obj));
#endregion
outStoreBusiness.RefreshStoreStockEvent += Query;
@ -141,6 +146,12 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
/// 出一个
/// </summary>
public RelayCommand<object> OutOnlyOneCommand { get; set; }
/// <summary>
/// 整条道出
/// </summary>
public RelayCommand<object> OutAllCommand { get; set; }
#endregion
/// <summary>
@ -158,7 +169,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
App.Current.Dispatcher.Invoke((Action)(() =>
{
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.foamStoreCode);
var info = inventoryInfoBusiness.GetSpaceInfos(appConfig.foamStoreCode).OrderBy(x=>x.objId);
if (info != null)
{
if (spaceItems.Count > 0)
@ -169,6 +180,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
foreach (var item in info)
{
spaceItems.Add(item);
}
Shapes = spaceItems;
}
@ -286,6 +298,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
}
}
/// <summary>
/// 手动出一个
/// </summary>
@ -293,6 +306,8 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
private void OutOnlyOne(object obj)
{
string info = obj as string;
bool result = outStoreBusiness.OutOnlyOneBySpaceCode(appConfig.foamStoreCode, info);
if (result)
{
@ -304,6 +319,59 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
MessageBox.Show("出库任务创建失败");
}
}
/// <summary>
/// 整条道出
/// </summary>
/// <param name="obj"></param>
private void OutAll(object obj)
{
string info = obj as string;
bool result = outStoreBusiness.OutAllBySpaceCode(appConfig.foamStoreCode, info);
if (result)
{
Query();
MessageBoxTimeoutA((IntPtr)0, $"出库任务创建成功3秒后关闭提示", "提示", 0, 0, 3000);
}
else
{
MessageBox.Show("出库任务创建失败");
}
}
///// <summary>
///// 手动出一个
///// </summary>
///// <param name="obj"></param>
//private void OutOnlyOne(object obj)
//{
// string info = obj as string;
// bool result = outStoreBusiness.OutOnlyOneBySpaceCode(appConfig.foamStoreCode, info);
// if (result)
// {
// Query();
// MessageBoxTimeoutA((IntPtr)0, $"出库任务创建成功3秒后关闭提示", "提示", 0, 0, 3000);
// }
// else
// {
// MessageBox.Show("出库任务创建失败");
// }
//}
///// <summary>
///// 整条道出
///// </summary>
///// <param name="obj"></param>
//private void OutAll(object obj)
//{
//}
}
}

@ -21,7 +21,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
{
InventoryOnClickCommand = new RelayCommand<object>(obj => InventoryOnClick(obj));
InventoryControl = shellInventory;
InventoryControl = boxFoamRearInventory;
}
#region 参数定义

@ -293,7 +293,7 @@ namespace Aucma.Scada.UI.viewModel.InventoryInfo
{
if (!string.IsNullOrEmpty(searchText))
{
var infos = baseMaterialInfoService.getAllInfos().Where(x=>x.MaterialName.Contains(searchText));
var infos = baseMaterialInfoService.getAllInfos().Where(x=>x.MaterialName.Contains(searchText) || x.MaterialCode.Contains(searchText));
MaterialDataGrid.Clear();
Application.Current.Dispatcher.Invoke(() =>
{

@ -14,6 +14,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Windows.Threading;
namespace Aucma.Scada.UI.viewModel
{
@ -32,6 +33,14 @@ namespace Aucma.Scada.UI.viewModel
public MainViewModel()
{
// 创建一个DispatcherTimer对象
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(1);
timer.Tick += Timer_Tick;
timer.Start();
ControlOnClickCommand = new RelayCommand<object>(obj => ControlOnClick(obj));
OpenSystemKeyboardCommand = new RelayCommand(OpenSystemKeyboard);
@ -445,6 +454,39 @@ namespace Aucma.Scada.UI.viewModel
}
#endregion
public string _currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
public string CurrentDateTime
{
get => _currentDateTime;
set { _currentDateTime = value; RaisePropertyChanged(nameof(CurrentDateTime)); }
}
public string _shiftStr = string.Empty;
public string ShiftStr
{
get => _shiftStr;
set { _shiftStr = value; RaisePropertyChanged(nameof(ShiftStr)); }
}
private void Timer_Tick(object sender, EventArgs e)
{
DateTime now = DateTime.Now;
// 判断当前是否是白班时间段
if (now.Hour >= 8 && now.Hour < 20)
{
ShiftStr = $"白班 08点-20点";
}
else
{
ShiftStr = $"夜班 20点-08点";
}
CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
}

@ -37,5 +37,14 @@ namespace HighWayIot.Repository.service
/// <param name="productPlanInfo"></param>
/// <returns></returns>
bool UpdateProductPlanInfo(ProductPlanInfo productPlanInfo);
/// <summary>
/// 通过物料编码找到生产计划
/// </summary>
/// <param name="productLineCode"></param>
/// <returns></returns>
ProductPlanInfo GetProductPlanInfosByMaterialCode(string materialCode);
}
}

@ -117,5 +117,33 @@ namespace HighWayIot.Repository.service.Impl
}
return result;
}
/// <summary>
/// 通过物料编码和工位找到生产计划
/// </summary>
/// <param name="productLineCode"></param>
/// <returns></returns>
public ProductPlanInfo GetProductPlanInfosByMaterialCode(string materialCode)
{
ProductPlanInfo planInfo = null;
try
{
Expression<Func<ProductPlanInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.materialCode == materialCode && x.productLineCode=="1006");
planInfo = _mesRepository.GetFirst(exp);
logHelper.Info($"根据物料编码{materialCode};获取到的计划信息:{jsonChange.ModeToJson(planInfo)}");
}
catch (Exception ex)
{
logHelper.Error("通过计划编号获取计划信息异常", ex);
}
return planInfo;
}
}
}

Loading…
Cancel
Save