This commit is contained in:
jl
2025-06-05 15:11:19 +08:00
parent 285bae186b
commit 8c1493f76e
17 changed files with 351 additions and 273 deletions

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Epost.DAL.Enum.LightColor;
namespace Epost.BLL
{
@ -154,7 +155,7 @@ namespace Epost.BLL
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> job = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && 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())
@ -165,46 +166,26 @@ namespace Epost.BLL
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);
}
//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);
//}
if (type == "8")// 订单显示器熄灭回显设备
{
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");
if (rejob.Any())
{
LogHelper.WriteLogInfo("显示器拍下=="+rejob.Count);
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.Uid == "09" + "-" + data.Address)//完成灯拍下
{
LogHelper.WriteLogInfo(data.Address+"end拍下");
}
else if (data.Result == "4")//■按键拍下
{
data.Parameter = "0";
jobdown_start(data, job, block, area, jobList);
jobdown_start(data, job, block, area, jobList, 2);
}
else
{
@ -220,7 +201,7 @@ namespace Epost.BLL
#region
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList,int type=1)
{
int truequantity = 0;
int checkquantity = 0;
@ -248,8 +229,9 @@ namespace Epost.BLL
//修改订单状态
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku,"", model.Matchid);
bool skuInish = orderbll.IsSkuFinishWork(model.Sku,model.Matchid);
model.State = 3;
if (skuInish)
{
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
@ -265,17 +247,15 @@ namespace Epost.BLL
{
comBLL.LED_OFF_CLEAR(offList);
}
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "分播完成";
show.Contents = "请扫描继续作业";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
show.Type = 8;
show.Block = block;
show.Area = area;
show.Islock = false;
show.IsTwinkle = 1;
comBLL.ShowBoxMessage_M(show);
LabelParamModel lamodel = new LabelParamModel();
lamodel.Address = data.Address;
lamodel.ControlIP = data.IP.ToString();
lamodel.Command = "DISPLAY_JOB";
lamodel.Type = "N";
lamodel.Uid = "09" + "-" + data.Address;
lamodel.Mode =model.ColorCode + "3";
lamodel.Quantity = " end";
comBLL.DISPLAY_JOB(lamodel);
#endregion
#region
@ -287,49 +267,8 @@ namespace Epost.BLL
qumodel.Matchid = model.Matchid;
qumodel.UserCode = model.UserCode;
queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion
Thread.Sleep(30);
#region
//bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
//if (blockfinish)
//{
// #region 点亮显示器
// 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;
// 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播完回传
bool skubo = orderbll.IsSkuFinishWork(model.Sku, model.Matchid);
if (skubo)
{
LogHelper.WriteLogInfo(model.Sku + "Sku播种完成" + model.Matchid);
orderbll.UpdateStateByCar(model.Matchid, model.Sku);
}
#endregion
#endregion
Thread.Sleep(30);
#region sku
JobCache.UpdateJobModelList(offList, EcommendType.Execute);
@ -337,6 +276,21 @@ namespace Epost.BLL
}
bool shopfinish = orderbll.IsFinishWork(1, block, "", area,"", model.ShopID, model.Matchid);
if (shopfinish)
{
LogHelper.WriteLogInfo("门店拣选完成换箱" + model.ShopID);
orderbll.ChangeBox(model, 2);
}
else {
#region
if (type == 2)
{
LogHelper.WriteLogInfo("开始换箱" + model.ShopID);
orderbll.ChangeBox(model);
}
#endregion
}
}