2023-01-13 15:30:20 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Epost.Common;
|
|
|
|
|
using Epost.DAL.Cache;
|
|
|
|
|
using Epost.DAL.Enum;
|
|
|
|
|
using Epost.Model;
|
2023-12-05 14:35:20 +08:00
|
|
|
|
using Epost.Model.resource;
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
namespace Epost.BLL
|
|
|
|
|
{
|
|
|
|
|
|
2023-12-05 14:35:20 +08:00
|
|
|
|
public class OrderControlBLL
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
|
|
|
|
OrderBLL orderbll = new OrderBLL();
|
|
|
|
|
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
|
|
|
|
CommandBLL comBLL = new CommandBLL();
|
|
|
|
|
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
|
|
|
|
ScanModelCacheDAL scanCacheDAL = new ScanModelCacheDAL();
|
|
|
|
|
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
|
|
|
|
|
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
|
|
|
|
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
|
|
|
|
BoxQueueBLL queueboxBLL = new BoxQueueBLL();
|
2023-12-05 14:35:20 +08:00
|
|
|
|
SkuInfoBLL skuBLL = new SkuInfoBLL();
|
2023-01-13 15:30:20 +08:00
|
|
|
|
ShowMesCacheDAL msgCache = new ShowMesCacheDAL();
|
|
|
|
|
LocationCacheDAL locCache = new LocationCacheDAL();
|
|
|
|
|
BoxCodeCacheDAL boxcache = new BoxCodeCacheDAL();
|
2024-01-04 15:30:23 +08:00
|
|
|
|
ErrorLogBLL logBLL = new ErrorLogBLL();
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
|
|
|
|
private static object lockobj = new object();
|
2023-01-13 15:30:20 +08:00
|
|
|
|
private static object lockJobDown = new object();
|
|
|
|
|
private static object showmes = new object();
|
|
|
|
|
public static bool OrisShow = false;
|
|
|
|
|
|
|
|
|
|
#region 设备控制
|
|
|
|
|
|
|
|
|
|
#region 初始化
|
|
|
|
|
public ResultModel ClearALL()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool t = addrBLL.UpdateState();
|
|
|
|
|
LogHelper.WriteLogInfo("初始化@@@@@@@@@@@@!----V20220705-1---");
|
|
|
|
|
JobCache.ClearJobList();
|
|
|
|
|
downCacheDAL.ClearJobDownList();
|
|
|
|
|
locCache.ClearScanList();
|
|
|
|
|
queueBLL.UpdateQueueState();
|
2023-12-05 14:35:20 +08:00
|
|
|
|
// queueboxBLL.UpdateQueueState();
|
2023-01-13 15:30:20 +08:00
|
|
|
|
orderbll.UpOrderstate();
|
|
|
|
|
UserCacheDAL.ClearUserCodeList();
|
|
|
|
|
boxcache.ClearBoxList();
|
|
|
|
|
ResultModel resultModel = comBLL.Initialization_M();
|
2024-01-04 15:30:23 +08:00
|
|
|
|
// GetOrderQueue(); //加载任务显示器信息
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LogHelper.WriteLogInfo("初始化@@@@@@@@@@@@!----V20200727-1---");
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resultModel;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("初始化异常" + ex.ToString());
|
|
|
|
|
ResultModel resultModel = new ResultModel();
|
|
|
|
|
resultModel.result = "-1";
|
|
|
|
|
resultModel.msg = "初始化异常";
|
|
|
|
|
return resultModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 开始作业
|
|
|
|
|
public void StartWork()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!OrisShow)
|
|
|
|
|
{
|
|
|
|
|
OrisShow = true;
|
|
|
|
|
//【多少个大区多少个线程】
|
|
|
|
|
List<AddressstorageModel> Arealist = addrBLL.GetAreaList();
|
|
|
|
|
if (Arealist.Any())
|
|
|
|
|
{
|
|
|
|
|
foreach (AddressstorageModel item in Arealist)
|
|
|
|
|
{
|
|
|
|
|
string block = item.block + "-" + item.area;
|
|
|
|
|
Thread timerThread = new Thread(new ParameterizedThreadStart(GetWorkList));
|
|
|
|
|
timerThread.Start(block);
|
|
|
|
|
|
|
|
|
|
Thread timerThreadBack = new Thread(new ParameterizedThreadStart(BackWorkList));
|
|
|
|
|
timerThreadBack.Start(block);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取订单信息
|
|
|
|
|
private void GetWorkList(object block)
|
|
|
|
|
{
|
|
|
|
|
string job = "";
|
|
|
|
|
job = "lockDisplayJob" + block;
|
|
|
|
|
object cJob = (object)job;
|
|
|
|
|
lock (cJob)
|
|
|
|
|
{
|
|
|
|
|
while (OrisShow)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DisplayJob_M(block.ToString());
|
|
|
|
|
Thread.Sleep(120);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":程序异常!\r\n" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取订单信息
|
|
|
|
|
private void BackWorkList(object block)
|
|
|
|
|
{
|
|
|
|
|
string cm = "";
|
|
|
|
|
cm = "lockJobDown" + block;
|
|
|
|
|
object c = (Object)cm;
|
|
|
|
|
lock (c)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
while (OrisShow)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Job_Down(block.ToString());
|
|
|
|
|
Thread.Sleep(120);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":程序异常!\r\n" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 设备检测
|
|
|
|
|
public ResultModel TestStart()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
ResultModel result = comBLL.GetAllLabelList_M();
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 停止检测
|
|
|
|
|
public void TestEnd()
|
|
|
|
|
{
|
|
|
|
|
comBLL.clearALL_M();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 结束作业
|
|
|
|
|
public void EndWork()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("结束作业!");
|
|
|
|
|
OrisShow = false;
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
comBLL.CloseALL_M();
|
|
|
|
|
|
|
|
|
|
JobCache.ClearJobList();
|
|
|
|
|
downCacheDAL.ClearJobDownList();
|
|
|
|
|
scanCacheDAL.ClearScanList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("结束作业异常" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 查询波次通道列表
|
|
|
|
|
public void GetOrderQueue()
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = queueBLL.getQueueOrderStateList();
|
|
|
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
|
|
{
|
|
|
|
|
if (item["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
|
|
|
|
{
|
|
|
|
|
Mes_Echo(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
showSummaryMes(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 标签拍下
|
|
|
|
|
public ResultModel Job_Down(string tblock)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
lock (lockJobDown)
|
|
|
|
|
{
|
|
|
|
|
string[] nlist = tblock.Split('-');
|
|
|
|
|
string nblock = nlist[0];
|
|
|
|
|
string narea = nlist[1];
|
|
|
|
|
ResultModel resmodel = new ResultModel();
|
|
|
|
|
resmodel.result = "0";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
List<ResultMessageModel> downList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Status == "0" && m.Block == nblock && m.Area == narea);
|
|
|
|
|
List<JobModel> jobList = JobCache.GetPlanJobList().FindAll(p => p.Block == nblock && p.Area == narea);
|
|
|
|
|
// LogHelper.WriteLogInfo("****************************"+ downList.Count);
|
|
|
|
|
if (downList != null && downList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (ResultMessageModel data in downList.ToArray())
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("完成绑定箱号开始作业==============");
|
|
|
|
|
Work_JobDown(data, jobList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resmodel;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
resmodel.result = "-1";
|
|
|
|
|
resmodel.msg = "标签拍下异常";
|
|
|
|
|
LogHelper.WriteLogInfo("标签拍下异常:" + ex.Message);
|
|
|
|
|
return resmodel;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//作业中
|
|
|
|
|
public void Work_JobDown(ResultMessageModel data, List<JobModel> jobList)
|
|
|
|
|
{
|
|
|
|
|
lock (lockJobDown)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
switch (data.Command)
|
|
|
|
|
{
|
|
|
|
|
case "QUERY_SPECIAL_STATUS":
|
|
|
|
|
BindJobList(data);
|
|
|
|
|
// BindJobByLocation(data);
|
|
|
|
|
break;
|
|
|
|
|
case "JOB_DONE":
|
|
|
|
|
JobDown_M(data, jobList);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("Work_JobDown标签拍下异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//绑箱中
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 设备拍下处理
|
|
|
|
|
public void JobDown_M(ResultMessageModel data, List<JobModel> jobList)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//获取标签所在区
|
|
|
|
|
OrdersQueueModel qmodel = new OrdersQueueModel();
|
|
|
|
|
string area = data.Area;
|
|
|
|
|
string block = data.Block;
|
|
|
|
|
string way = data.Way;
|
|
|
|
|
string type = data.Type;
|
|
|
|
|
string orderid = string.Empty;
|
|
|
|
|
string skulist = string.Empty;
|
|
|
|
|
qmodel.Taskarea = area;
|
|
|
|
|
qmodel.Taskblock = block;
|
|
|
|
|
List<JobModel> endjoblist = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 1 || m.State == 0));
|
|
|
|
|
List<JobModel> job = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 1 || m.State == 0) && m.Address == data.Address && m.ControlIP == data.IP);
|
|
|
|
|
List<JobModel> finjob = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 3) && m.Address == data.Address && m.ControlIP == data.IP);
|
|
|
|
|
|
|
|
|
|
if (finjob.Any())
|
|
|
|
|
{
|
|
|
|
|
JobModel finmodel = finjob.FirstOrDefault();
|
|
|
|
|
qmodel.UserCode = finmodel.UserCode;
|
|
|
|
|
qmodel.Sku = finmodel.Sku;
|
|
|
|
|
qmodel.Matchid = finmodel.Matchid;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
|
|
|
|
|
if (queueDT != null && queueDT.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
skulist = queueDT.Rows[0]["sku"].ToString();
|
|
|
|
|
LogHelper.WriteLogInfo("=======" + qmodel.UserCode + "=====" + area + "区===sku=" + skulist);
|
|
|
|
|
}
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
|
|
|
|
{
|
|
|
|
|
List<JobModel> rejob = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Sku == queueDT.Rows[0]["sku"].ToString());
|
|
|
|
|
if (rejob.Any())
|
|
|
|
|
{
|
|
|
|
|
JobModel model = rejob.FirstOrDefault();
|
|
|
|
|
comBLL.ClearArea_M(rejob);
|
|
|
|
|
//熄灭通道灯
|
|
|
|
|
comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
|
|
|
|
// comBLL.UNLOCK_M(rejob);
|
|
|
|
|
#region 修改任务队列状态
|
|
|
|
|
OrdersQueueModel qumodel = new OrdersQueueModel();
|
|
|
|
|
qumodel.State = 3;
|
|
|
|
|
qumodel.Taskblock = block;
|
|
|
|
|
qumodel.Taskarea = area;
|
|
|
|
|
qumodel.Sku = model.Sku;
|
|
|
|
|
qumodel.Matchid = model.Matchid;
|
|
|
|
|
qumodel.UserCode = model.UserCode;
|
|
|
|
|
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
#region 清除当前区已做完的sku
|
|
|
|
|
JobCache.UpdateJobModelList(rejob, EcommendType.Execute);
|
|
|
|
|
#endregion
|
2023-12-05 14:35:20 +08:00
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
else if (data.Result == "4")//■按键拍下
|
|
|
|
|
{
|
|
|
|
|
data.Parameter = "0";
|
2023-12-05 14:35:20 +08:00
|
|
|
|
jobdown_start(data, job, block, area, jobList);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("JOB_DOWN开始~~~~~~~~~~~~~~~~");
|
|
|
|
|
if (type != "2" && type != "8")//非显示器拍下
|
|
|
|
|
{
|
|
|
|
|
jobdown_start(data, job, block, area, jobList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 标签拍下
|
|
|
|
|
|
|
|
|
|
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
|
2023-12-05 14:35:20 +08:00
|
|
|
|
{
|
|
|
|
|
//int truequantity = 0;
|
|
|
|
|
//int checkquantity = 0;
|
|
|
|
|
//string scanstr = data.Parameter;
|
|
|
|
|
//if (!string.IsNullOrEmpty(scanstr))
|
|
|
|
|
//{
|
|
|
|
|
// truequantity = Convert.ToInt32(scanstr);
|
|
|
|
|
//}
|
|
|
|
|
//if (job.Any())
|
|
|
|
|
//{
|
|
|
|
|
// List<JobModel> downlist = new List<JobModel>();
|
|
|
|
|
// JobModel model = job.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
// //List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation);
|
|
|
|
|
// //if (manyList.Any())//合并显示数据
|
|
|
|
|
// //{
|
|
|
|
|
|
|
|
|
|
// // downlist.AddRange(manyList);
|
|
|
|
|
// // LogHelper.WriteLogInfo("合并显示数据=========="+ manyList .Count+ "==================");
|
|
|
|
|
// //}
|
|
|
|
|
// //else
|
|
|
|
|
// //{
|
|
|
|
|
// downlist.Add(model);
|
|
|
|
|
// // }
|
|
|
|
|
// //修改订单状态
|
|
|
|
|
// orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
|
|
|
|
// LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
|
|
|
|
// bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku);
|
|
|
|
|
// model.State = 3;
|
|
|
|
|
// if (skuInish)
|
|
|
|
|
// {
|
|
|
|
|
// LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
|
|
|
|
// //删除sku缓存信息
|
|
|
|
|
// List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SPECIAL_STATUS" && p.Area == area);
|
|
|
|
|
// downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
|
|
|
|
|
// //熄灭通道灯
|
|
|
|
|
// comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
|
|
|
|
|
|
|
|
|
// #region 熄灭当前区显示屏
|
|
|
|
|
// List<JobModel> offList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3 && m.Sku == model.Sku);
|
|
|
|
|
// if (offList.Any())
|
|
|
|
|
// {
|
|
|
|
|
// comBLL.LED_OFF_CLEAR(offList);
|
|
|
|
|
// }
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// #region 修改任务队列状态
|
|
|
|
|
// OrdersQueueModel qumodel = new OrdersQueueModel();
|
|
|
|
|
// qumodel.State = 3;
|
|
|
|
|
// qumodel.Taskblock = block;
|
|
|
|
|
// qumodel.Taskarea = area;
|
|
|
|
|
// qumodel.Sku = model.Sku;
|
|
|
|
|
// qumodel.Matchid = model.Matchid;
|
|
|
|
|
// qumodel.UserCode = model.UserCode;
|
|
|
|
|
// queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// #region 刷新波次信息
|
|
|
|
|
// showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid);
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// Thread.Sleep(30);
|
|
|
|
|
// #region 整条通道当前用户所有任务分播结束
|
|
|
|
|
// bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
|
|
|
|
|
// if (blockfinish)
|
|
|
|
|
// {
|
|
|
|
|
// #region 点亮显示器
|
|
|
|
|
// ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
// show.Title = "当前波次分播完成";
|
|
|
|
|
// show.Contents = "拍下熄灭所有设备\r请扫描继续作业";
|
|
|
|
|
// show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
|
|
|
|
// show.Qty = "0";
|
|
|
|
|
// show.Type = 8;
|
|
|
|
|
// show.Block = block;
|
|
|
|
|
// show.Islock = false;
|
|
|
|
|
// show.IsTwinkle = 1;
|
|
|
|
|
// show.No = "01";
|
|
|
|
|
// comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid);
|
|
|
|
|
// if (allfinish)//判断整个波次是否已完成
|
|
|
|
|
// { //更新state状态为已完成
|
|
|
|
|
// orderbll.UpdateStateByCar(model.Matchid);
|
|
|
|
|
// }
|
|
|
|
|
// //删除波次信息
|
|
|
|
|
// List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block);
|
|
|
|
|
// UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// #region 区内sku播完回传
|
|
|
|
|
// // orderbll.UpdateStateByCar(model.Matchid, "", model.Sku);
|
|
|
|
|
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// #region 清除当前区已做完的sku
|
|
|
|
|
// JobCache.UpdateJobModelList(offList, EcommendType.Execute);
|
|
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#region 标签控制M系列
|
|
|
|
|
public void DisplayJob_M(string tblock)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
lock (lockobj)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string[] nlist = tblock.Split('-');
|
|
|
|
|
string nblock = nlist[0];
|
|
|
|
|
string narea = nlist[1];
|
|
|
|
|
List<LabelParamModel> list = new List<LabelParamModel>();
|
|
|
|
|
OrdersQueueModel model = new OrdersQueueModel(); ;
|
|
|
|
|
model.Taskarea = narea;
|
|
|
|
|
model.Taskblock = nblock;
|
|
|
|
|
|
|
|
|
|
#region 开始作业
|
|
|
|
|
DataTable queueDT = queueBLL.getQueueOrderState(model);
|
|
|
|
|
if (queueDT != null && queueDT.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//当前区没有作业
|
|
|
|
|
if (queueDT.Rows[0]["state"].ToString() == "0")
|
|
|
|
|
{
|
|
|
|
|
displayOrder(queueDT, nblock, narea, list, model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#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())
|
|
|
|
|
{
|
|
|
|
|
model.State = 1;
|
|
|
|
|
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].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();
|
|
|
|
|
|
|
|
|
|
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
|
|
|
|
#region 点亮任务标签
|
|
|
|
|
foreach (JobModel item in nowJoblist.ToArray())
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
#region 点亮灯带格口
|
|
|
|
|
//先熄灭
|
2024-01-04 15:30:23 +08:00
|
|
|
|
//comBLL.Ledonoff_dengdai("0", "");
|
|
|
|
|
//Thread.Sleep(100);
|
|
|
|
|
//comBLL.display_dengdai(item.Tolocation, "2");
|
|
|
|
|
comBLL.LED_OFF_CLEAR(item.ControlIP);
|
2023-12-05 14:35:20 +08:00
|
|
|
|
Thread.Sleep(100);
|
2024-01-04 15:30:23 +08:00
|
|
|
|
LabelParamModel lamodel = new LabelParamModel();
|
|
|
|
|
lamodel.Address = item.Address;
|
|
|
|
|
lamodel.ControlIP = item.ControlIP;
|
|
|
|
|
lamodel.Parameter = "40000001";
|
|
|
|
|
comBLL.LED_ON_M(lamodel);
|
2023-12-05 14:35:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
item.State = 3;
|
|
|
|
|
item.DisplayTime = DateTime.Now;
|
|
|
|
|
#region 更新订单状态
|
2024-01-04 15:30:23 +08:00
|
|
|
|
orderbll.UpdateOrderState_Car(item.Matchid, item.FromTolocation, "3");
|
2023-12-05 14:35:20 +08:00
|
|
|
|
model.State = 3;
|
|
|
|
|
bool allfinish = orderbll.IsFinishWorkByCar(1, item.Matchid);
|
|
|
|
|
if (allfinish)//判断整个波次是否已完成
|
|
|
|
|
{ //更新state状态为已完成
|
2024-01-04 15:30:23 +08:00
|
|
|
|
// orderbll.UpdateStateByCar(item.Matchid);
|
|
|
|
|
// comBLL.Ledonoff_dengdai("0", "");
|
2023-12-05 14:35:20 +08:00
|
|
|
|
//删除波次信息
|
|
|
|
|
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList();
|
|
|
|
|
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//无任务
|
|
|
|
|
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
|
|
|
|
model.State = 3;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2023-12-05 14:35:20 +08:00
|
|
|
|
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
2023-12-05 14:35:20 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
|
|
|
|
foreach (JobModel item in isJobList)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 处理扫描条码
|
|
|
|
|
public ResultModel BindJobList(ResultMessageModel data)
|
|
|
|
|
{
|
|
|
|
|
ResultModel res = new ResultModel();
|
|
|
|
|
res.result = "0";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string sblock = data.Block;
|
|
|
|
|
string scanStr = data.Parameter.Trim();
|
|
|
|
|
string sarea = data.Area;
|
|
|
|
|
string name = string.Empty;
|
|
|
|
|
string matchid = string.Empty;
|
|
|
|
|
#region 提示请扫描波次号
|
|
|
|
|
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);//
|
2024-01-04 15:30:23 +08:00
|
|
|
|
bool isnum = true;//ConvertHexHelper.IsNum(scanStr.Substring(0, 1));//判断扫描首字母是否是数字
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
if (!ulist.Any())
|
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
if (scanStr.Substring(0, 1) == "S"&&scanStr.Length==3) //扫描分播墙号
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
|
|
|
|
UserCodeModel umodel = new UserCodeModel();
|
2023-12-05 14:35:20 +08:00
|
|
|
|
umodel.Matchid = data.Parameter;//分播墙号
|
|
|
|
|
matchid = data.Parameter;
|
2023-01-13 15:30:20 +08:00
|
|
|
|
umodel.Block = sblock;
|
|
|
|
|
umodel.Area = sarea;
|
|
|
|
|
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
|
2023-12-05 14:35:20 +08:00
|
|
|
|
LogHelper.WriteLogInfo("扫描播种墙号" + data.Parameter);
|
2024-01-04 15:30:23 +08:00
|
|
|
|
logBLL.SaveShowMesError("请扫描物料开始分播", "请扫描物料开始分播");
|
2023-12-05 14:35:20 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo(scanStr + "请扫描正确的播种墙号");
|
2024-01-04 15:30:23 +08:00
|
|
|
|
logBLL.SaveShowMesError("请扫描正确的播种墙号", "请扫描正确的播种墙号");
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
}
|
2023-12-05 14:35:20 +08:00
|
|
|
|
else
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);
|
|
|
|
|
if (ulist.Any())
|
|
|
|
|
{ matchid = ulist.FirstOrDefault().Matchid; }
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2023-12-05 14:35:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
if (data.Type == "6")//播种扫描枪
|
|
|
|
|
{
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2023-12-05 14:35:20 +08:00
|
|
|
|
xifenBind(ulist, scanStr, data, matchid, isnum);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2023-12-05 14:35:20 +08:00
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2023-12-05 14:35:20 +08:00
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
res.result = "-1";
|
|
|
|
|
res.msg = "绑定任务异常";
|
|
|
|
|
LogHelper.WriteLogInfo("绑定任务异常:" + ex.Message);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 中分
|
|
|
|
|
|
|
|
|
|
public void zhongfenBind(List<UserCodeModel> ulist, string scanStr, ResultMessageModel data)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//if (ulist.Any())
|
|
|
|
|
//{
|
|
|
|
|
// UserCodeModel usermodel = ulist.FirstOrDefault();
|
|
|
|
|
//if (string.IsNullOrEmpty(usermodel.ZfCode) && scanStr.Substring(0, 1) != "U")//
|
|
|
|
|
//{
|
|
|
|
|
// #region 提示先扫描工号
|
|
|
|
|
// ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
// show.Title = "请先扫描工号!";
|
|
|
|
|
// show.Contents = "";
|
|
|
|
|
// show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
// show.Block = sblock;
|
|
|
|
|
// show.Type =2;
|
|
|
|
|
// show.Area = sarea;
|
|
|
|
|
// show.Islock = true;
|
|
|
|
|
// comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
// downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
// #endregion
|
|
|
|
|
//}
|
|
|
|
|
//else {
|
|
|
|
|
|
|
|
|
|
if (scanStr.Substring(0, 1) == "U")
|
|
|
|
|
{
|
|
|
|
|
#region 扫描工号
|
|
|
|
|
if (ulist.Any())
|
|
|
|
|
{
|
|
|
|
|
UserCodeModel umodel = ulist.FirstOrDefault();
|
|
|
|
|
umodel.ZfCode = scanStr;
|
|
|
|
|
#region 扫描工号
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "请扫描sku开始作业!";
|
|
|
|
|
show.Contents = "";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = data.Block;
|
|
|
|
|
show.Area = data.Area;
|
|
|
|
|
show.Type = 2;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#region 中分扫描sku
|
|
|
|
|
|
|
|
|
|
DataTable sinfodt = skuBLL.GetSkuInfoList(data.Parameter);
|
|
|
|
|
//string location = string.Empty;
|
|
|
|
|
if (sinfodt != null && sinfodt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
scanStr = sinfodt.Rows[0]["sku"].ToString();
|
|
|
|
|
// location = data.Parameter;// sinfodt.Rows[0]["tolocation"].ToString();
|
|
|
|
|
}
|
|
|
|
|
LogHelper.WriteLogInfo("中分" + data.Parameter + "===SKU" + scanStr);
|
|
|
|
|
List<AddressstorageModel> Arealist = addrBLL.GetAreaList();
|
|
|
|
|
if (Arealist.Any())
|
|
|
|
|
{
|
|
|
|
|
foreach (AddressstorageModel item in Arealist)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
DataTable skudt = orderbll.GetSumList("", scanStr, item.block, item.area);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
if (skudt != null && skudt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//规格
|
|
|
|
|
int discount = Convert.ToInt32(skudt.Rows[0]["discount"].ToString());
|
|
|
|
|
//整件总数
|
|
|
|
|
int SumCkQuantity = 0;//= Convert.ToInt32(skudt.Rows[0]["SumCkQuantity"].ToString());
|
|
|
|
|
//散件总数
|
|
|
|
|
int SumQuantity = Convert.ToInt32(skudt.Rows[0]["SumQuantity"].ToString());
|
|
|
|
|
//if (discount != 1)
|
|
|
|
|
//{
|
|
|
|
|
// if (SumQuantity >= discount)
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
// SumCkQuantity = SumQuantity / discount;
|
|
|
|
|
// SumQuantity = SumQuantity % discount;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = skudt.Rows[0]["goodsname"].ToString();
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = item.block;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
show.Contents = data.Parameter + "(" + scanStr + ")\r";// + "规格:" + discount;
|
|
|
|
|
show.Qty = SumQuantity.ToString();
|
|
|
|
|
show.Wholeqty = SumCkQuantity;
|
|
|
|
|
show.Unit = "件";
|
|
|
|
|
show.Wholeunit = "箱";
|
|
|
|
|
show.Type = 2;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "SKU" + scanStr + "无任务!";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = item.block;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
show.Contents = "请扫描其他商品!";
|
|
|
|
|
show.Type = 2;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 细分播种
|
|
|
|
|
public void xifenBind(List<UserCodeModel> ulist, string scanStr, ResultMessageModel data, string matchid, bool isnum)
|
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
if (ulist.Any())
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
UserCodeModel umodel = ulist.FirstOrDefault();
|
|
|
|
|
if (scanStr.Substring(0, 1) == "U")
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
#region 扫描工号
|
2023-01-13 15:30:20 +08:00
|
|
|
|
umodel.UserCode = scanStr;
|
2024-01-04 15:30:23 +08:00
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
2024-01-04 15:30:23 +08:00
|
|
|
|
else if (scanStr.Substring(0, 1) == "S" && scanStr.Length == 3) //扫描分播墙号
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
umodel.Matchid = scanStr;
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
2024-01-04 15:30:23 +08:00
|
|
|
|
else
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
#region 扫描商品
|
|
|
|
|
List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
|
|
|
|
|
if (hangList.Any())
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
#region 挂起
|
|
|
|
|
LogHelper.WriteLogInfo("挂起" + data.Parameter + "-------通道" + data.Block);
|
|
|
|
|
LabelParamModel FORMATEModel = new LabelParamModel();
|
|
|
|
|
FORMATEModel.ControlIP = data.IP;
|
|
|
|
|
comBLL.FORMATE_JOB_DATA(FORMATEModel);
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
DataTable qdt = queueBLL.getQueuesOrderbyState(data.Block, data.Area, "1");
|
|
|
|
|
if (qdt != null && qdt.Rows.Count > 0)
|
2023-01-13 15:30:20 +08:00
|
|
|
|
{
|
2024-01-04 15:30:23 +08:00
|
|
|
|
scanStr = qdt.Rows[0]["sku"].ToString();
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
// data.Parameter = scanStr;
|
|
|
|
|
Hangup_SKU(scanStr, data.Block, data.Area);
|
|
|
|
|
//删除sku对应缓存
|
|
|
|
|
List<ResultMessageModel> sdown = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == scanStr || p.Parameter == qdt.Rows[0]["location"].ToString());
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute);
|
|
|
|
|
}
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(hangList, EdownCommend.Execute);
|
|
|
|
|
//刷新波次
|
|
|
|
|
GetMatchOrder();
|
|
|
|
|
#endregion
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
}
|
|
|
|
|
else if (isnum)//sku
|
|
|
|
|
{
|
2024-01-15 17:37:47 +08:00
|
|
|
|
if (data.Parameter.Length <= 2)
|
|
|
|
|
{
|
|
|
|
|
#region 扫描小格口号
|
2025-01-13 13:47:28 +08:00
|
|
|
|
DataTable quedt = queueBLL.getQueueList();
|
2024-01-15 17:37:47 +08:00
|
|
|
|
if (quedt != null && quedt.Rows.Count > 0)
|
|
|
|
|
{
|
2025-01-13 13:47:28 +08:00
|
|
|
|
LogHelper.WriteLogInfo(quedt.Rows[0]["sku"].ToString() + "绑定小格口" + data.Parameter);
|
2024-01-15 17:37:47 +08:00
|
|
|
|
//更新订单记录
|
2025-01-13 13:47:28 +08:00
|
|
|
|
orderbll.UpdateSkuLoc(quedt.Rows[0]["sku"].ToString(), data.Parameter);
|
2024-01-15 17:37:47 +08:00
|
|
|
|
}
|
2025-01-13 13:47:28 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2024-01-15 17:37:47 +08:00
|
|
|
|
LogHelper.WriteLogInfo("没有可绑定物料" + data.Parameter);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
}
|
2025-01-13 13:47:28 +08:00
|
|
|
|
else if (data.Parameter.Length > 2 && data.Parameter.Length <= 5)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("扫描满箱");
|
|
|
|
|
FinshLoc(data.Parameter);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-01-15 17:37:47 +08:00
|
|
|
|
#region 扫描SKU
|
|
|
|
|
//根据扫描商品内码获取商品码
|
|
|
|
|
data.ScanCode = data.Parameter;
|
|
|
|
|
DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "3");
|
|
|
|
|
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Address == data.Address && m.Parameter == scanStr && m.Parameter != "888888" && m.Block == data.Block && m.Area == data.Area);
|
|
|
|
|
|
|
|
|
|
if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0))
|
|
|
|
|
{
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block);
|
|
|
|
|
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
OrdersQueueModel qmodel = new OrdersQueueModel();
|
2024-01-04 15:30:23 +08:00
|
|
|
|
qmodel.Sku = scanStr;
|
|
|
|
|
qmodel.Taskblock = data.Block;
|
|
|
|
|
qmodel.Taskarea = data.Area;
|
|
|
|
|
qmodel.UserCode = umodel.UserCode;
|
|
|
|
|
qmodel.Matchid = umodel.Matchid;
|
|
|
|
|
qmodel.Location = scanStr;
|
|
|
|
|
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
queueBLL.insertQueueOrders(qmodel);
|
2024-01-15 17:37:47 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logBLL.SaveShowMesError("扫描:" + scanStr + "无任务!", "扫描:" + scanStr + "无任务!");
|
|
|
|
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
2024-01-15 17:37:47 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
|
|
|
|
|
|
2024-01-04 15:30:23 +08:00
|
|
|
|
}
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-13 13:47:28 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 满箱打印标签
|
|
|
|
|
public bool FinshLoc(string loc)
|
|
|
|
|
{
|
|
|
|
|
bool isfin = orderbll.getSmallLocList(loc);
|
|
|
|
|
if (isfin)
|
|
|
|
|
{
|
|
|
|
|
DataTable locdt= addrBLL.GetALLList(" and location='"+loc+"'");
|
|
|
|
|
string type = string.Empty;
|
|
|
|
|
if (locdt != null && locdt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
type = locdt.Rows[0]["addresstype"].ToString();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//生成唯一箱号条码
|
|
|
|
|
string boxcode = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString() + loc;
|
|
|
|
|
LogHelper.WriteLogInfo(boxcode.ToString());
|
|
|
|
|
bool bo = orderbll.CreateBoxInfo(boxcode, loc, type);
|
|
|
|
|
return bo;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
logBLL.SaveShowMesError("小格口未完全绑定", "小格口未完全绑定,请绑定后再释放!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-13 15:30:20 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 复核显示
|
|
|
|
|
public void Mes_Echo(string scanStr, string sblock, string sarea, int type, ResultMessageModel data = null, string location = "", string matchid = "", bool islock = true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DataTable sudt = orderbll.GetSumList_Echo("", scanStr, sblock);
|
|
|
|
|
if (type == 2)
|
|
|
|
|
{
|
|
|
|
|
sudt = orderbll.GetSumList_Echo("", scanStr, sblock, sarea);
|
|
|
|
|
}
|
|
|
|
|
//查询当前区任务队列
|
|
|
|
|
DataTable qdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "1");
|
|
|
|
|
if (sudt != null && sudt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
matchid = sudt.Rows[0]["matchid"].ToString();
|
|
|
|
|
string sku = string.Empty;
|
|
|
|
|
string qty = string.Empty;
|
|
|
|
|
string color = string.Empty;
|
|
|
|
|
if (qdt != null && qdt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
sku = qdt.Rows[0]["sku"].ToString();
|
|
|
|
|
qty = sudt.Rows[0]["SumQuantity"].ToString();
|
|
|
|
|
color = qdt.Rows[0]["LightColor"].ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//规格
|
|
|
|
|
int discount = Convert.ToInt32(sudt.Rows[0]["discount"].ToString());
|
|
|
|
|
//整件总数
|
|
|
|
|
int SumCkQuantity = 0;// Convert.ToInt32(sudt.Rows[0]["SumCkQuantity"].ToString());
|
|
|
|
|
//散件总数
|
|
|
|
|
int SumQuantity = Convert.ToInt32(sudt.Rows[0]["SumQuantity"].ToString());
|
|
|
|
|
//if (discount != 1)
|
|
|
|
|
//{
|
|
|
|
|
// if (SumQuantity >= discount)
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
// SumCkQuantity = SumQuantity / discount;
|
|
|
|
|
// SumQuantity = SumQuantity % discount;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = sudt.Rows[0]["goodsname"].ToString();
|
|
|
|
|
string mes = "复核显示";
|
|
|
|
|
islock = false;
|
|
|
|
|
|
|
|
|
|
if (qdt != null && qdt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r');
|
|
|
|
|
}
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
|
|
|
|
|
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes;
|
2023-01-13 15:30:20 +08:00
|
|
|
|
sku = data.Parameter;
|
|
|
|
|
}
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
|
|
|
|
show.Qty = SumQuantity.ToString();
|
|
|
|
|
show.Wholeqty = SumCkQuantity;
|
|
|
|
|
show.Unit = "件";
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Wholeunit = "箱";
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Area = sarea;
|
|
|
|
|
show.Islock = islock;
|
|
|
|
|
show.Location = "check";
|
|
|
|
|
//ShowMesModel megmodel = new ShowMesModel();
|
|
|
|
|
//megmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString();
|
|
|
|
|
//megmodel.Sku = sku;
|
|
|
|
|
//megmodel.Area = sarea;
|
|
|
|
|
//megmodel.Block = sblock;
|
|
|
|
|
//megmodel.Matchid = matchid;
|
|
|
|
|
|
|
|
|
|
// msgCache.UpdateMsgModelList(new List<ShowMesModel> { megmodel }, EmsgCommend.Create);
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
data.Status = "1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//查询当前区任务队列
|
|
|
|
|
DataTable finshqdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "3");
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
//根据sku获取商品名称
|
|
|
|
|
string goodsname = orderbll.GetGoodsname(location);
|
|
|
|
|
show.Title = goodsname + "分播完成";
|
|
|
|
|
show.Contents = scanStr + "\r请扫描继续作业";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Qty = "0";
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Area = sarea;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 显示波次信息
|
|
|
|
|
public void ShowMatchMessage(string scanStr, string sblock)
|
|
|
|
|
{
|
|
|
|
|
DataTable areadt = orderbll.GetAreaByMatch(scanStr, sblock);
|
|
|
|
|
if (areadt != null && areadt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (DataRow item in areadt.Rows)
|
|
|
|
|
{
|
|
|
|
|
UserCodeModel umodel = new UserCodeModel();
|
|
|
|
|
umodel.Matchid = scanStr;
|
|
|
|
|
umodel.Block = item["block"].ToString();
|
|
|
|
|
umodel.Area = item["area"].ToString();
|
|
|
|
|
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
|
|
|
|
|
|
|
|
|
|
//提示扫工号
|
|
|
|
|
ShowMessageModel_M xshow = new ShowMessageModel_M();
|
|
|
|
|
xshow.Title = "请扫描工号/SKU开始作业";
|
|
|
|
|
xshow.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
xshow.Block = item["block"].ToString();
|
|
|
|
|
xshow.Area = item["area"].ToString();
|
|
|
|
|
// xshow.Area = sarea;
|
|
|
|
|
xshow.Type = 8;
|
|
|
|
|
xshow.Islock = true;
|
|
|
|
|
comBLL.ShowBoxMessage_M(xshow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DataTable sumlist = orderbll.GetMatchSumList(scanStr, sblock);
|
|
|
|
|
if (sumlist != null && sumlist.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "波次号:" + scanStr;
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Type = 2;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
// string qty = ConvertHexHelper.ConvertString(sumlist.Rows[0]["incompleteCount"].ToString(), 10, 16); //拣货数量
|
|
|
|
|
show.Qty = sumlist.Rows[0]["incompleteCount"].ToString();
|
|
|
|
|
show.Location = sumlist.Rows[0]["completeCount"].ToString();
|
|
|
|
|
show.Contents = "SKU总数:" + sumlist.Rows[0]["completeCount"].ToString() + "\rSKU待播数:" + sumlist.Rows[0]["incompleteCount"].ToString();
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
|
|
|
|
|
// downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 订单显示器中分提示
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 订单显示器中分提示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="scanStr"></param>
|
|
|
|
|
/// <param name="sblock"></param>
|
|
|
|
|
/// <param name="sarea"></param>
|
|
|
|
|
/// <param name="type">type=1查询整个通道block的汇总数量,type=2查询当前通道下某 一区area的汇总数量</param>
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
public void showSummaryMes(string scanStr, string sblock, string sarea, int type, ResultMessageModel data = null, string location = "", string matchid = "", bool islock = true)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
lock (showmes)
|
|
|
|
|
{
|
|
|
|
|
bool bo = orderbll.isTask(sblock, sarea);
|
|
|
|
|
string msg = string.Empty;
|
|
|
|
|
if (!bo)
|
|
|
|
|
{
|
|
|
|
|
msg = "当前商品无任务\r请送至下一区";
|
|
|
|
|
}
|
|
|
|
|
DataTable sudt = orderbll.GetSumList("", scanStr, sblock);
|
|
|
|
|
if (type == 2)
|
|
|
|
|
{
|
|
|
|
|
sudt = orderbll.GetSumList("", scanStr, sblock, sarea);
|
|
|
|
|
}
|
|
|
|
|
//查询当前区任务队列
|
|
|
|
|
DataTable qdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sudt != null && sudt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
matchid = sudt.Rows[0]["matchid"].ToString();
|
|
|
|
|
string showqty = string.Empty;
|
|
|
|
|
string showsku = string.Empty;
|
|
|
|
|
List<ShowMesModel> msglist = msgCache.GetMsgList().FindAll(p => p.Block == sblock && p.Area == sarea && p.Matchid == matchid && p.Sku == scanStr);
|
|
|
|
|
if (msglist.Any())
|
|
|
|
|
{
|
|
|
|
|
ShowMesModel showmodel = msglist.FirstOrDefault();
|
|
|
|
|
showqty = showmodel.Qty;
|
|
|
|
|
showsku = showmodel.Sku;
|
|
|
|
|
}
|
|
|
|
|
//////qdt.Rows[0]["sku"].ToString() 为null data.ScanCode
|
|
|
|
|
|
|
|
|
|
string sku = string.Empty;
|
|
|
|
|
string qty = string.Empty;
|
|
|
|
|
string color = string.Empty;
|
|
|
|
|
if (qdt != null && qdt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
sku = qdt.Rows[0]["sku"].ToString();
|
|
|
|
|
qty = sudt.Rows[0]["SumQuantity"].ToString();
|
|
|
|
|
color = qdt.Rows[0]["LightColor"].ToString();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//规格
|
|
|
|
|
int discount = Convert.ToInt32(sudt.Rows[0]["discount"].ToString());
|
|
|
|
|
//整件总数
|
|
|
|
|
int SumCkQuantity = 0; //Convert.ToInt32(sudt.Rows[0]["SumCkQuantity"].ToString());
|
2023-12-05 14:35:20 +08:00
|
|
|
|
//散件总数
|
2023-01-13 15:30:20 +08:00
|
|
|
|
int SumQuantity = Convert.ToInt32(sudt.Rows[0]["SumQuantity"].ToString());
|
|
|
|
|
//if (discount != 1)
|
|
|
|
|
//{
|
|
|
|
|
// if (SumQuantity >= discount)
|
|
|
|
|
// {
|
|
|
|
|
// SumCkQuantity = SumQuantity / discount;
|
|
|
|
|
// SumQuantity = SumQuantity % discount;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = sudt.Rows[0]["goodsname"].ToString();
|
|
|
|
|
string mes = "拣货任务";
|
|
|
|
|
|
|
|
|
|
if (qdt != null && qdt.Rows.Count > 0)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r');
|
2023-01-13 15:30:20 +08:00
|
|
|
|
}
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
2023-12-05 14:35:20 +08:00
|
|
|
|
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes;// sudt.Rows[0]["goodscode"].ToString().Replace(';', '\r');
|
2023-01-13 15:30:20 +08:00
|
|
|
|
sku = data.Parameter;
|
|
|
|
|
}
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
|
|
|
|
show.Qty = SumQuantity.ToString();
|
|
|
|
|
|
|
|
|
|
show.Wholeqty = SumCkQuantity;
|
|
|
|
|
show.Unit = "件";
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Wholeunit = "箱";
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Area = sarea;
|
|
|
|
|
show.Islock = islock;
|
|
|
|
|
ShowMesModel megmodel = new ShowMesModel();
|
|
|
|
|
megmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString();
|
|
|
|
|
megmodel.Sku = sku;
|
|
|
|
|
megmodel.Area = sarea;
|
|
|
|
|
megmodel.Block = sblock;
|
|
|
|
|
megmodel.Matchid = matchid;
|
|
|
|
|
|
|
|
|
|
msgCache.UpdateMsgModelList(new List<ShowMesModel> { megmodel }, EmsgCommend.Create);
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
data.Status = "1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//查询当前区任务队列
|
|
|
|
|
DataTable finshqdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "3");
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
//根据sku获取商品名称
|
|
|
|
|
string goodsname = orderbll.GetGoodsname(location);
|
|
|
|
|
show.Title = goodsname + "分播完成";
|
|
|
|
|
show.Contents = scanStr + "\r请扫描继续作业";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
|
|
|
|
show.Qty = "0";
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Area = sarea;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("刷新显示器异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 刷新波次信息
|
|
|
|
|
public void ShowMatchMes(string scanStr, string sblock)
|
|
|
|
|
{
|
|
|
|
|
DataTable sumlist = orderbll.GetMatchSumList(scanStr, sblock);
|
|
|
|
|
if (sumlist != null && sumlist.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "波次号:" + scanStr;
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = sblock;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
// string qty = ConvertHexHelper.ConvertString(sumlist.Rows[0]["incompleteCount"].ToString(), 10, 16); //拣货数量
|
|
|
|
|
show.Qty = sumlist.Rows[0]["incompleteCount"].ToString();
|
|
|
|
|
show.Location = sumlist.Rows[0]["completeCount"].ToString();
|
|
|
|
|
show.Contents = "SKU总数:" + sumlist.Rows[0]["completeCount"].ToString() + "\rSKU待播数:" + sumlist.Rows[0]["incompleteCount"].ToString();
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region SKU挂起/缺货
|
|
|
|
|
public void Hangup_SKU(string sku, string block, string area, ResultMessageModel data = null)
|
|
|
|
|
{
|
|
|
|
|
List<LabelParamModel> list = new List<LabelParamModel>();
|
|
|
|
|
//查询当前通道sku是否有任务
|
|
|
|
|
DataTable dt = orderbll.getOrderListBysku(block, sku);
|
|
|
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
// 将当前通道所有sku正在亮的设备熄灭
|
|
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
|
|
{
|
|
|
|
|
if (item["oprationstate"].ToString() == "1")
|
|
|
|
|
{
|
|
|
|
|
LabelParamModel lamodel = new LabelParamModel();
|
|
|
|
|
lamodel.Address = item["address"].ToString(); ;
|
|
|
|
|
lamodel.ControlIP = item["ControlIP"].ToString();
|
|
|
|
|
lamodel.Command = "REMOVE_JOB";
|
|
|
|
|
lamodel.Parameter = "01";
|
|
|
|
|
list.Add(lamodel);
|
|
|
|
|
orderbll.UpOrderStateBybat(item["batchid"].ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (list != null && list.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("挂起list——" + sku + "——————————————————:" + list.Count);
|
|
|
|
|
comBLL.DISPLAY_JOBALL(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除缓存中sku记录
|
|
|
|
|
List<JobModel> jobList = JobCache.GetPlanJobList();
|
|
|
|
|
List<JobModel> relist = jobList.FindAll(m => m.Sku == sku && m.Block == block);
|
|
|
|
|
JobModel model = new JobModel();
|
|
|
|
|
if (relist.Any())
|
|
|
|
|
{
|
|
|
|
|
model = relist.FirstOrDefault();
|
|
|
|
|
JobCache.UpdateJobModelList(relist, EcommendType.Complete);
|
|
|
|
|
//删除Orderqueue中sku的记录
|
|
|
|
|
bool bo = queueBLL.DelQueueOrder(sku, block);
|
|
|
|
|
LogHelper.WriteLogInfo("删除queue返回" + bo);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "挂起商品:" + sku + "错误!";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = block;
|
|
|
|
|
show.Area = area;
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
//downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == sku && p.Block == block);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 查询波次通道列表
|
|
|
|
|
public void GetMatchOrder()
|
|
|
|
|
{
|
|
|
|
|
DataTable dt = orderbll.GetMatchOrder();
|
|
|
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (DataRow item in dt.Rows)
|
|
|
|
|
{
|
|
|
|
|
ShowMatchMessage(item["matchid"].ToString(), item["workblock"].ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|