This commit is contained in:
@ -128,74 +128,74 @@ namespace Epost.BLL
|
||||
//if (!isJobList.Any())
|
||||
//{
|
||||
model.State = 1;
|
||||
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString(), queueDT.Rows[0]["lightcolor"].ToString());
|
||||
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
||||
#region 点亮任务标签
|
||||
foreach (JobModel item in nowJoblist.ToArray())
|
||||
{
|
||||
|
||||
//#region 回显设备锁定
|
||||
//if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
||||
//{
|
||||
|
||||
// LabelParamModel locklamodel = new LabelParamModel();
|
||||
// locklamodel.Address = item.Address.ToString();
|
||||
// locklamodel.ControlIP = item.ControlIP.ToString();
|
||||
// locklamodel.Command = "LOCK";
|
||||
// locklamodel.Parameter = "11111000";
|
||||
// locklamodel.Type = "N";
|
||||
// list.Add(locklamodel);
|
||||
|
||||
//}
|
||||
//#endregion
|
||||
// else
|
||||
//{
|
||||
//判断设备当前有没有被点亮
|
||||
List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
|
||||
if (!isshowList.Any())
|
||||
#region 回显设备锁定
|
||||
if (item.ColorCode == EnumHelper.EMToDescriptionString(LightColor.Color.Pink))
|
||||
{
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation && m.Address == item.Address);
|
||||
int quantity = item.Quantity;
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
lamodel.Address = item.Address.ToString();
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
#region 同一个货位的数据合并显示
|
||||
if (manyJoblist.Count > 1)
|
||||
{
|
||||
quantity = 0;
|
||||
if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
{
|
||||
foreach (JobModel mitem in manyJoblist)
|
||||
{
|
||||
quantity += mitem.Quantity;
|
||||
mitem.State = 1;
|
||||
mitem.ManyState = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
lamodel.Type = "N";
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Uid = "U" + item.ID;
|
||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
||||
list.Add(lamodel);
|
||||
//}
|
||||
item.State = 1;
|
||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
||||
item.DisplayTime = DateTime.Now;
|
||||
LabelParamModel locklamodel = new LabelParamModel();
|
||||
locklamodel.Address = item.Address.ToString();
|
||||
locklamodel.ControlIP = item.ControlIP.ToString();
|
||||
locklamodel.Command = "LOCK";
|
||||
locklamodel.Parameter = "11111000";
|
||||
locklamodel.Type = "N";
|
||||
locklamodel.Uid = "L" + item.Address;
|
||||
list.Add(locklamodel);
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//判断设备当前有没有被点亮
|
||||
List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
|
||||
if (!isshowList.Any())
|
||||
{
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation && m.Address == item.Address);
|
||||
int quantity = item.Quantity;
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
lamodel.Address = item.Address.ToString();
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
#region 同一个货位的数据合并显示
|
||||
if (manyJoblist.Count > 1)
|
||||
{
|
||||
quantity = 0;
|
||||
if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
{
|
||||
foreach (JobModel mitem in manyJoblist)
|
||||
{
|
||||
quantity += mitem.Quantity;
|
||||
mitem.State = 1;
|
||||
mitem.ManyState = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
lamodel.Type = "N";
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Uid = "U" + item.ID;
|
||||
lamodel.Mode =item.ColorCode + "0";
|
||||
list.Add(lamodel);
|
||||
//}
|
||||
item.State = 1;
|
||||
|
||||
item.DisplayTime = DateTime.Now;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
// comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
@ -203,11 +203,12 @@ namespace Epost.BLL
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
Reference in New Issue
Block a user