This commit is contained in:
@ -99,12 +99,14 @@
|
||||
<Compile Include="EntityBase.cs" />
|
||||
<Compile Include="ErrorLogBLL.cs" />
|
||||
<Compile Include="HistoryXmlBLL.cs" />
|
||||
<Compile Include="InboundOrdersBLL.cs" />
|
||||
<Compile Include="Light.cs" />
|
||||
<Compile Include="LogXmlBLL.cs" />
|
||||
<Compile Include="MenuInfoBLL.cs" />
|
||||
<Compile Include="ModelConvertHelper.cs" />
|
||||
<Compile Include="OrderBLL.cs" />
|
||||
<Compile Include="OrderControlBLL.cs" />
|
||||
<Compile Include="PalletinfoBLL.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RoleInfoBLL.cs" />
|
||||
<Compile Include="ShopBLL.cs" />
|
||||
@ -112,6 +114,7 @@
|
||||
<Compile Include="StorageLocationBLL.cs" />
|
||||
<Compile Include="OrdersQueueBLL.cs" />
|
||||
<Compile Include="StoreBLL.cs" />
|
||||
<Compile Include="Sys_operate_logBLL.cs" />
|
||||
<Compile Include="UserBLL.cs" />
|
||||
<Compile Include="WmsBLL.cs" />
|
||||
<Compile Include="WmsTaskBLL.cs" />
|
||||
|
47
Epost.BLL/InboundOrdersBLL.cs
Normal file
47
Epost.BLL/InboundOrdersBLL.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class InboundOrdersBLL
|
||||
{
|
||||
InboundOrdersDAL dal = new InboundOrdersDAL();
|
||||
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<InboundOrdersModel> GetOrdersListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetOrdersListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询订单是否已存在
|
||||
public DataTable GetOrdersList(string wmsDocNo)
|
||||
{
|
||||
return dal.GetOrdersList(wmsDocNo);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertOrder(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return dal.InsertOrders(dt, diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -73,19 +73,18 @@ namespace Epost.BLL
|
||||
{
|
||||
OrisShow = true;
|
||||
workbll.UpdateWorkModel(WorkEcommendType.Create);
|
||||
//【多少个大区多少个线程】
|
||||
List<AddressstorageModel> Arealist = addrBLL.GetshelfidList();
|
||||
if (Arealist.Any())
|
||||
{
|
||||
////【多少个大区多少个线程】
|
||||
//List<AddressstorageModel> Arealist = addrBLL.GetshelfidList();
|
||||
//if (Arealist.Any())
|
||||
//{
|
||||
Work_JobDownThread downthread = new Work_JobDownThread();
|
||||
downthread.tblock = "01|01";
|
||||
Work_DisplayJobThread jobthread = new Work_DisplayJobThread();
|
||||
jobthread.tblock = "01|01";
|
||||
Work_ScanThread scantherad = new Work_ScanThread();
|
||||
scantherad.tblock = "01|01";
|
||||
foreach (AddressstorageModel item in Arealist)
|
||||
{
|
||||
string block = item.block + "|" + item.shelfid;
|
||||
|
||||
//foreach (AddressstorageModel item in Arealist)
|
||||
//{
|
||||
string block = "01|01";
|
||||
jobthread = new Work_DisplayJobThread();
|
||||
jobthread.id = block;
|
||||
jobthread.tblock = block;
|
||||
@ -101,15 +100,10 @@ namespace Epost.BLL
|
||||
Thread thread = new Thread(new ThreadStart(downthread.Work));
|
||||
thread.Start();
|
||||
|
||||
scantherad = new Work_ScanThread();
|
||||
scantherad.id = block;
|
||||
scantherad.tblock = block;
|
||||
scantherad.OrisShow = OrisShow;
|
||||
Thread scanthread = new Thread(new ThreadStart(scantherad.ScanList));
|
||||
scanthread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
40
Epost.BLL/PalletinfoBLL.cs
Normal file
40
Epost.BLL/PalletinfoBLL.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class PalletinfoBLL
|
||||
{
|
||||
|
||||
PalletinfoDAL dal = new PalletinfoDAL();
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<PalletinfoModel> GetPalletListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetPalletListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加订单
|
||||
public bool InsertPallet(DataTable dt, Dictionary<string, string> diclist)
|
||||
{
|
||||
return dal.InsertPallet(dt, diclist);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
62
Epost.BLL/Sys_operate_logBLL.cs
Normal file
62
Epost.BLL/Sys_operate_logBLL.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using Epost.DAL;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class Sys_operate_logBLL
|
||||
{
|
||||
|
||||
|
||||
Sys_operate_logDAL dal = new Sys_operate_logDAL();
|
||||
|
||||
#region 分页获取订单表列表
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public List<Sys_operate_logModel> GetLogListByPage(string strWhere, string orderby, int pageSize, int pageIndex, out int recordCount)
|
||||
{
|
||||
int startIndex = 0;
|
||||
int endIndex = 0;
|
||||
if (pageIndex <= 0)
|
||||
pageIndex = 1;
|
||||
//计算查询的开始行数与结束行数
|
||||
startIndex = (pageIndex - 1) * pageSize + 1;
|
||||
endIndex = pageIndex * pageSize;
|
||||
return dal.GetLogListByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取日志列表
|
||||
public List<Sys_operate_logModel> GetLogDetail(int mid)
|
||||
{
|
||||
return dal.GetLogDetail(mid);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 添加日志
|
||||
public bool InsertLog(string title, string method, string operate_url, string operate_param, string json_result, int status, string error_msg, DateTime addtime)
|
||||
{
|
||||
Sys_operate_logModel logmodel = new Sys_operate_logModel();
|
||||
logmodel.title = title;
|
||||
logmodel.method = method;
|
||||
logmodel.operate_url = operate_url;
|
||||
logmodel.operate_param = operate_param;
|
||||
logmodel.json_result = json_result;
|
||||
logmodel.status = status;
|
||||
logmodel.error_msg = error_msg;
|
||||
logmodel.addtime = addtime;
|
||||
return dal.InsertLogDetail(logmodel);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ using Epost.DAL.Enum;
|
||||
using Epost.Model;
|
||||
using Epost.Model.resource;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@ -75,170 +76,33 @@ namespace Epost.BLL
|
||||
public void DisplayJob_M(string tblock)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
string[] nlist = tblock.Split('|');
|
||||
string nblock = nlist[0];
|
||||
string shelfid = nlist[1];
|
||||
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
|
||||
foreach (AddressstorageModel item in Arealist)
|
||||
{
|
||||
OrdersQueueModel model = new OrdersQueueModel(); ;
|
||||
model.Taskarea = item.area;
|
||||
model.Taskblock = nblock;
|
||||
#region 开始作业
|
||||
DataTable queueDT = queueBLL.getQueueOrderState(model);
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
//当前区没有作业
|
||||
if (queueDT.Rows[0]["state"].ToString() == "0")
|
||||
{
|
||||
#region 点亮显示器
|
||||
ShowMessageModel_M showmodel = new ShowMessageModel_M();
|
||||
showmodel.Area = shelfid;
|
||||
showmodel.Block = nblock;
|
||||
showmodel.Color = queueDT.Rows[0]["lightcolor"].ToString();//EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||
showmodel.Contents = queueDT.Rows[0]["sku"].ToString();
|
||||
showmodel.Title = queueDT.Rows[0]["Shopid"].ToString();
|
||||
showmodel.Islock = true;
|
||||
|
||||
showmodel.IsTwinkle = 0;
|
||||
showmodel.Type = 8;
|
||||
DataTable sudt = orderbll.GetSumList("", queueDT.Rows[0]["sku"].ToString(), nblock);
|
||||
if (sudt != null && sudt.Rows.Count > 0)
|
||||
{
|
||||
showmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString();
|
||||
}
|
||||
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
|
||||
#endregion
|
||||
displayOrder(queueDT, nblock, item.area, model);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 点亮设备
|
||||
public void displayOrder(DataTable queueDT, string nblock, string narea, OrdersQueueModel model)
|
||||
{
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
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())
|
||||
try
|
||||
{
|
||||
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())
|
||||
{
|
||||
|
||||
#region 回显设备锁定
|
||||
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
||||
{
|
||||
#region 开始作业
|
||||
//查询是否有空闲的agv
|
||||
//查询待执行的任务
|
||||
//更新任务状态为执行中
|
||||
|
||||
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> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
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)
|
||||
//{
|
||||
// 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;
|
||||
}
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加到点亮的list————————:" + list.Count);
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
||||
var finishList = jobList.FindAll(p => p.State == 0);
|
||||
if (!finishList.Any())
|
||||
{
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
||||
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||
foreach (JobModel item in isJobList)
|
||||
{
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user