2023-04-21 17:29:50 +08:00
|
|
|
|
using Epost.Common;
|
|
|
|
|
using Epost.DAL.Cache;
|
|
|
|
|
using Epost.DAL.Enum;
|
|
|
|
|
using Epost.Model;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Epost.BLL
|
|
|
|
|
{
|
|
|
|
|
public class Work_JobDownThread
|
|
|
|
|
{
|
|
|
|
|
public string tblock, id;
|
|
|
|
|
public bool OrisShow = false;
|
|
|
|
|
OrderBLL orderbll = new OrderBLL();
|
|
|
|
|
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
|
|
|
|
CommandBLL comBLL = new CommandBLL();
|
|
|
|
|
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
|
|
|
|
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
|
|
|
|
|
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
|
|
|
|
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
|
|
|
|
SkuInfoBLL skuBLL = new SkuInfoBLL();
|
|
|
|
|
ShowMesCacheDAL msgCache = new ShowMesCacheDAL();
|
|
|
|
|
private static object lockJobDown = new object();
|
|
|
|
|
private static object showmes = new object();
|
|
|
|
|
|
|
|
|
|
WorkIngCacheDAL workbll = new WorkIngCacheDAL();
|
|
|
|
|
public void Work()
|
|
|
|
|
{
|
|
|
|
|
BackWorkList(tblock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取订单信息
|
|
|
|
|
private void BackWorkList(object block)
|
|
|
|
|
{
|
|
|
|
|
|
2024-09-02 16:42:28 +08:00
|
|
|
|
string cm = "";
|
|
|
|
|
cm = "lockJobDown" + block;
|
|
|
|
|
object c = (Object)cm;
|
|
|
|
|
lock (c)
|
|
|
|
|
{
|
2023-04-21 17:29:50 +08:00
|
|
|
|
while (OrisShow)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string workstate = workbll.GetWorkState();
|
|
|
|
|
if (!string.IsNullOrEmpty(workstate))
|
|
|
|
|
{
|
|
|
|
|
OrisShow = true;
|
|
|
|
|
Job_Down(block.ToString());
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
OrisShow = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":程序异常!\r\n" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
#region 标签拍下
|
|
|
|
|
public void Job_Down(string tblock)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2024-09-02 16:42:28 +08:00
|
|
|
|
string[] nlist = tblock.Split('|');
|
2023-04-21 17:29:50 +08:00
|
|
|
|
string nblock = nlist[0];
|
|
|
|
|
string shelfid = nlist[1];
|
|
|
|
|
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
|
|
|
|
|
foreach (AddressstorageModel item in Arealist)
|
|
|
|
|
{
|
2024-09-02 16:42:28 +08:00
|
|
|
|
List<ResultMessageModel> downList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Status == "0" && m.Block == nblock && m.Area == item.area&&m.Command== "JOB_DONE");
|
2023-04-21 17:29:50 +08:00
|
|
|
|
List<JobModel> jobList = JobCache.GetPlanJobList().FindAll(p => p.Block == nblock && p.Area == item.area);
|
|
|
|
|
|
|
|
|
|
if (downList != null && downList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (ResultMessageModel data in downList.ToArray())
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("完成绑定箱号开始作业==============");
|
|
|
|
|
Work_JobDown(data, jobList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("标签拍下异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//作业中
|
|
|
|
|
public void Work_JobDown(ResultMessageModel data, List<JobModel> jobList)
|
|
|
|
|
{
|
|
|
|
|
lock (lockJobDown)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
switch (data.Command)
|
|
|
|
|
{
|
2024-09-02 16:42:28 +08:00
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
case "JOB_DONE":
|
|
|
|
|
JobDown_M(data, jobList);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.WriteLogInfo("Work_JobDown标签拍下异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//绑箱中
|
|
|
|
|
|
|
|
|
|
#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);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-27 15:44:15 +08:00
|
|
|
|
if (type == "8")// 订单显示器熄灭回显设备
|
2023-04-21 17:29:50 +08:00
|
|
|
|
{
|
2024-11-27 15:44:15 +08:00
|
|
|
|
LogHelper.WriteLogInfo("显示器拍下");
|
|
|
|
|
List<JobModel> rejob = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Sku == queueDT.Rows[0]["sku"].ToString()&&m.ColorCode=="1");
|
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
if (rejob.Any())
|
|
|
|
|
{
|
2024-11-27 15:44:15 +08:00
|
|
|
|
LogHelper.WriteLogInfo("显示器拍下=="+rejob.Count);
|
2023-04-21 17:29:50 +08:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
else if (data.Result == "4")//■按键拍下
|
|
|
|
|
{
|
|
|
|
|
data.Parameter = "0";
|
|
|
|
|
jobdown_start(data, job, block, area, jobList);
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
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);
|
2024-11-29 11:19:47 +08:00
|
|
|
|
bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku,"", model.Matchid);
|
2023-04-21 17:29:50 +08:00
|
|
|
|
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);
|
|
|
|
|
}
|
2024-09-02 16:42:28 +08:00
|
|
|
|
|
|
|
|
|
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
|
|
|
show.Title = "分播完成";
|
|
|
|
|
show.Contents = "请扫描继续作业";
|
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
|
|
|
|
show.Type = 8;
|
|
|
|
|
show.Block = block;
|
2024-11-27 15:44:15 +08:00
|
|
|
|
show.Area = area;
|
2024-09-02 16:42:28 +08:00
|
|
|
|
show.Islock = false;
|
|
|
|
|
show.IsTwinkle = 1;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
2023-04-21 17:29:50 +08:00
|
|
|
|
#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 刷新波次信息
|
2024-11-08 11:54:40 +08:00
|
|
|
|
// showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid);
|
2023-04-21 17:29:50 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(30);
|
|
|
|
|
#region 整条通道当前用户所有任务分播结束
|
|
|
|
|
bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
|
|
|
|
|
if (blockfinish)
|
|
|
|
|
{
|
|
|
|
|
#region 点亮显示器
|
2024-09-02 16:42:28 +08:00
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
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;
|
2024-09-02 16:42:28 +08:00
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
2024-12-12 10:34:24 +08:00
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
|
|
|
|
|
#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)
|
|
|
|
|
{
|
|
|
|
|
DataTable skudt = orderbll.GetSumList("", scanStr, item.block, item.area);
|
|
|
|
|
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();
|
2024-12-09 13:16:59 +08:00
|
|
|
|
show.Title = "SKU" + scanStr + "未完纳!";
|
2023-04-21 17:29:50 +08:00
|
|
|
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
|
|
|
show.Block = item.block;
|
|
|
|
|
show.Islock = true;
|
|
|
|
|
show.Contents = "请扫描其他商品!";
|
|
|
|
|
show.Type = 2;
|
|
|
|
|
comBLL.ShowBoxMessage_M(show);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-12-12 10:34:24 +08:00
|
|
|
|
|
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
|
|
|
|
|
#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());
|
|
|
|
|
//散件总数
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r');
|
|
|
|
|
}
|
|
|
|
|
if (data != null)
|
|
|
|
|
{
|
|
|
|
|
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes;// sudt.Rows[0]["goodscode"].ToString().Replace(';', '\r');
|
|
|
|
|
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
|
|
|
|
|
|
2024-12-12 10:34:24 +08:00
|
|
|
|
|
2023-04-21 17:29:50 +08:00
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
}
|
|
|
|
|
}
|