This commit is contained in:
@ -212,8 +212,11 @@ namespace Epost.BLL
|
||||
{
|
||||
try
|
||||
{
|
||||
List<JobModel> jobList = JobCache.GetPlanJobList().FindAll(x => x.OrderID == orderid);
|
||||
ResultModel resultModel = comBLL.Forcedend(orderid);
|
||||
|
||||
|
||||
JobCache.UpdateJobModelList(jobList, EcommendType.Execute);
|
||||
return resultModel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -416,8 +419,8 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||
List<JobModel> rjob = job.FindAll(m => m.Block == data.Block && m.State == 3);
|
||||
JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
|
||||
List<JobModel> finList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3);
|
||||
JobCache.UpdateJobModelList(finList, EcommendType.Execute);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -457,35 +460,41 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||
LogHelper.WriteLogInfo("标记------" + data.Address + "------" + model.Sku + "----" + model.State + "");
|
||||
bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", model.OrderID);
|
||||
LogHelper.WriteLogInfo("拍下------" + data.Address + "------" + model.OrderID + "----" + model.State + "");
|
||||
//bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", model.OrderID);
|
||||
bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", "");
|
||||
if (skuInish)
|
||||
{
|
||||
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||
//LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Block, data.Area, "0");
|
||||
|
||||
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
||||
LogHelper.WriteLogInfo("通道拣货完成--------------");
|
||||
//删除sku缓存信息
|
||||
//List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Area == data.Area && m.Sku == model.Sku);
|
||||
//JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
|
||||
|
||||
bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
|
||||
if (allfinish)
|
||||
//bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
|
||||
//if (allfinish)
|
||||
//{
|
||||
#region 修改任务队列状态
|
||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
qumodel.State = 3;
|
||||
qumodel.Taskblock = block;
|
||||
qumodel.Taskarea = area;
|
||||
//qumodel.Orderid = model.OrderID;
|
||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
#endregion
|
||||
|
||||
//修改订单状态
|
||||
dal.UpdateState(model.Area, model.Block);
|
||||
|
||||
bool WorkArea = dal.IsFinishWorkArea("", "", "99", "", "", "");
|
||||
if (skuInish)
|
||||
{
|
||||
#region 修改任务队列状态
|
||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
qumodel.State = 3;
|
||||
qumodel.Taskblock = block;
|
||||
qumodel.Taskarea = area;
|
||||
qumodel.Orderid = model.OrderID;
|
||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
#endregion
|
||||
|
||||
//修改订单状态
|
||||
dal.UpdateStateByCar(model.OrderID);
|
||||
|
||||
comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Area, "0");
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@ -522,24 +531,37 @@ namespace Epost.BLL
|
||||
//当前区没有作业
|
||||
if (queueDT.Rows[0]["state"].ToString() == "0")
|
||||
{
|
||||
displayOrder(queueDT, nblock, narea, list, model);
|
||||
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
|
||||
model.State = 1;
|
||||
//orderbll.GetOrderList(queueDT.Rows[0]["Orderid"].ToString(), nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
//orderbll.GetOrderList("", nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
DataTable orderdt = orderbll.GetOrderList("", narea, nblock);
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
{
|
||||
orderbll.GetOrderList("", nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable orderdt = orderbll.GetOrderList(narea, nblock);
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
DataTable QueueDt = queueBLL.getQueueState(model);
|
||||
if (QueueDt == null || QueueDt.Rows.Count <= 0)
|
||||
{
|
||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||
qmodel.Taskblock = nblock;
|
||||
qmodel.Taskarea = narea;
|
||||
qmodel.UserCode = "";
|
||||
qmodel.Orderid = orderdt.Rows[0]["orderid"].ToString();
|
||||
DataTable orderdt = orderbll.GetOrderList("", narea, nblock);
|
||||
if (orderdt != null && orderdt.Rows.Count > 0)
|
||||
{
|
||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||
qmodel.Taskblock = nblock;
|
||||
qmodel.Taskarea = narea;
|
||||
qmodel.UserCode = "";
|
||||
//qmodel.Orderid = orderdt.Rows[0]["orderid"].ToString();
|
||||
|
||||
queueBLL.insertQueueOrders(qmodel);
|
||||
queueBLL.insertQueueOrders(qmodel);
|
||||
}
|
||||
}
|
||||
}
|
||||
displayOrder(queueDT, nblock, narea, list, model);
|
||||
#endregion
|
||||
|
||||
}
|
||||
@ -558,29 +580,28 @@ namespace Epost.BLL
|
||||
#region 点亮设备
|
||||
public void displayOrder(DataTable queueDT, string nblock, string narea, List<LabelParamModel> list, OrdersQueueModel model)
|
||||
{
|
||||
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
|
||||
#region 点亮任务
|
||||
List<JobModel> jobList = JobCache.GetPlanJobList();
|
||||
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
//获取当前区任务并加入缓存
|
||||
if (!isJobList.Any())
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
model.State = 1;
|
||||
orderbll.GetOrderList(queueDT.Rows[0]["Orderid"].ToString(), nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
////获取当前区任务并加入缓存
|
||||
//if (!isJobList.Any())
|
||||
//{
|
||||
|
||||
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====");
|
||||
#region 点亮任务标s签
|
||||
foreach (JobModel item in nowJoblist.ToArray())
|
||||
{
|
||||
if (item.State == 0)
|
||||
List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
|
||||
if (!isshowList.Any())
|
||||
{
|
||||
|
||||
|
||||
#region
|
||||
#region 判断同一订单、同一货位多条数据 合并显示
|
||||
//List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
int quantity = item.Quantity;
|
||||
@ -599,10 +620,6 @@ namespace Epost.BLL
|
||||
//}
|
||||
#endregion
|
||||
|
||||
//if (item.Tolocation.Contains("-"))
|
||||
//{
|
||||
// var aryloc = item.Tolocation.Split('-');
|
||||
//}
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
string address = item.Address.ToString();
|
||||
lamodel.Address = address;
|
||||
@ -611,12 +628,12 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
lamodel.Title = item.genericname;
|
||||
lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\t" + item.Spec + "\r" + item.GoodsName + "\r批号 " + item.batchno + "\t" + item.manufactname.Substring(0, 4) + "";
|
||||
lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\t" + item.Spec + "\r" + item.GoodsName + "\r批号" + item.batchno + "\t" + item.manufactname.Substring(0, 4) + "";
|
||||
var aryloc = item.Tolocation.Split('-');
|
||||
lamodel.Loc = "" + aryloc[0].ToString() + "-" + aryloc[1].ToString() + "";
|
||||
lamodel.W_quantity = aryloc[2].ToString();
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Unit = "盒";
|
||||
lamodel.Unit = item.Unit;
|
||||
lamodel.PicChoose = "";
|
||||
#region 看似听似
|
||||
if (item.looklisten == "18")
|
||||
@ -678,13 +695,29 @@ namespace Epost.BLL
|
||||
|
||||
list.Add(lamodel);
|
||||
|
||||
#region 点亮通道灯
|
||||
List<JobModel> isJobListss = jobList.FindAll(p => p.Area == narea && p.Block == nblock && p.State == 1);
|
||||
if (!isJobListss.Any())
|
||||
{
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "F");
|
||||
}
|
||||
|
||||
|
||||
List<JobModel> isJobLists = jobList.FindAll(p => p.Area == narea && p.State == 1);
|
||||
if (!isJobLists.Any())
|
||||
{
|
||||
comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Taskarea, "F");
|
||||
}
|
||||
#endregion
|
||||
|
||||
item.State = 1;
|
||||
item.DisplayTime = DateTime.Now;
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
if (list != null && list.Count > 0)
|
||||
@ -693,21 +726,14 @@ namespace Epost.BLL
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
//else
|
||||
//{//无任务
|
||||
// LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
// model.State = 3;
|
||||
// queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
//}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
||||
var finishList = jobList.FindAll(p => p.State == 0);
|
||||
if (!finishList.Any())
|
||||
{
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
|
Reference in New Issue
Block a user