This commit is contained in:
帅凯 贾
2023-08-30 17:23:23 +08:00
parent 07985264fa
commit 07d01e0cd0
10 changed files with 525 additions and 322 deletions

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace Epost.DAL
{
public class OrdersQueueDAL
public class OrdersQueueDAL
{
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
#region
@ -27,7 +27,7 @@ namespace Epost.DAL
model.Location,
model.Matchid,
model.Lightcolor);
LogHelper.WriteLogInfo("进入拣货队列========="+sql);
LogHelper.WriteLogInfo("进入拣货队列=========" + sql);
long x = db.InsertSql(sql);
if (x > 0)
return true;
@ -43,18 +43,18 @@ namespace Epost.DAL
}
#endregion
#region
public DataTable getQueuesOrderbyState(string state="0")
public DataTable getQueuesOrderbyState(string state = "0")
{
string sql = string.Format("select * from OrdersQueue where state ='{0}'",
state);
// LogHelper.WriteLogInfo("获取正在绑定的信息" + sql);
// LogHelper.WriteLogInfo("获取正在绑定的信息" + sql);
return db.GetsqlForDT(sql);
}
#endregion
#region queue信息
public DataTable getQueuesOrderbyState(string block,string area,string state)
public DataTable getQueuesOrderbyState(string block, string area, string state)
{
string sql = string.Format("select * from OrdersQueue where (state ='{0}' or state='0') and taskblock='{1}' and taskarea='{2}' ",
state,
@ -75,12 +75,12 @@ namespace Epost.DAL
#endregion
#region
public DataTable getOrderqueueByAddr(string addr,string ip)
public DataTable getOrderqueueByAddr(string addr, string ip)
{
string sql =string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
string sql = string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
addr,
ip);
LogHelper.WriteLogInfo("获取=="+sql);
LogHelper.WriteLogInfo("获取==" + sql);
return db.GetsqlForDT(sql);
}
@ -89,7 +89,12 @@ namespace Epost.DAL
#region
public DataTable getQueueOrderState(OrdersQueueModel model)
{
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state<>2 and state<>3 order by sort",
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(model.Orderid))
{
strwhere += " and orderid='" + model.Orderid + "'";
}
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state<>2 and state<>3 " + strwhere + " order by sort",
model.Taskblock,
model.Taskarea);
return db.GetsqlForDT(sql);
@ -107,10 +112,10 @@ namespace Epost.DAL
return false;
}
public bool DeleteOrderQueue(string matchid,string CancelTime)
public bool DeleteOrderQueue(string matchid, string CancelTime)
{
string sql = string.Format("delete from OrdersQueue where matchid='{0}' and Addtime='{1}'",
matchid,CancelTime);
matchid, CancelTime);
long x = db.DeleteSql(sql);
if (x > 0)
return true;
@ -122,7 +127,7 @@ namespace Epost.DAL
#region
public DataTable getQueueState(OrdersQueueModel model)
{
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state=1",
string sql = string.Format("select * from OrdersQueue where state=1 and Taskblock='{0}' and Taskarea='{1}'",
model.Taskblock,
model.Taskarea);
return db.GetsqlForDT(sql);
@ -130,7 +135,7 @@ namespace Epost.DAL
}
#endregion
#region
public DataTable getQueueState(string usercode,string matchid,string block,string area)
public DataTable getQueueState(string usercode, string matchid, string block, string area)
{
string sql = string.Format("select * from ordersqueue where UserCode='{0}' and matchid='{1}' and Taskblock='{2}' and TaskArea='{3}' and state in(0,1)",
usercode,
@ -142,14 +147,14 @@ namespace Epost.DAL
}
#endregion
#region sku
public DataTable getQueueSKU(OrdersQueueModel model)
public DataTable getQueueSKU(OrdersQueueModel model)
{
string sql = string.Format("select sku from OrdersQueue where taskblock = '{0}' and taskarea = '{1}' and UserCode = '{2}'",
model.Taskblock,
model.Taskarea,
model.UserCode);
DataTable dt= db.GetsqlForDT(sql);
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
@ -175,7 +180,7 @@ namespace Epost.DAL
public bool updateOrderQueue(string block, string area)
{
string sql = string.Format("update ordersqueue set state = 0 where state=1 and taskblock='{0}' and TaskArea='{1}'",
block,area);
block, area);
LogHelper.WriteLogInfo("换箱、拆箱后恢复作业" + sql);
long x = db.UpdateSql(sql);
if (x > 0)
@ -211,11 +216,11 @@ namespace Epost.DAL
#endregion
#region sku是否正在作业
public DataTable GetOrderQueue(string block,string area,string state)
public DataTable GetOrderQueue(string block, string area, string state)
{
string sql = string.Format("select * from OrdersQueue where state <>'{0}' and taskblock='{1}' and taskarea='{2}'",
state,
block,area);
block, area);
LogHelper.WriteLogInfo("获取sku是否正在作业" + sql);
return db.GetsqlForDT(sql);
@ -230,7 +235,7 @@ namespace Epost.DAL
model.State);
long x= db.UpdateSql(sql);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
@ -238,10 +243,10 @@ namespace Epost.DAL
#endregion
#region
public bool UpdateQueueState(string id,string state)
public bool UpdateQueueState(string id, string state)
{
string sql = string.Format("update OrdersQueue set state='{0}' where id ='{1}'",
state,id);
state, id);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
@ -250,7 +255,7 @@ namespace Epost.DAL
#endregion
#region
public bool UpdateBoxCode(string id,string boxcode)
public bool UpdateBoxCode(string id, string boxcode)
{
string sql = string.Format("update OrdersQueue set state=3,boxcode='{0}' where id ='{1}'",
boxcode,
@ -269,11 +274,11 @@ namespace Epost.DAL
model.Taskarea,
model.Orderid,
model.State);
long x= db.UpdateSql(sql);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
#endregion
@ -284,18 +289,21 @@ namespace Epost.DAL
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(model.Taskblock))
{
strwhere = "and taskblock='"+model.Taskblock+"'";
strwhere = "and taskblock='" + model.Taskblock + "'";
}
if (!string.IsNullOrEmpty(model.Taskarea))
{
strwhere += "and Taskarea='" + model.Taskarea + "'";
}
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 and orderid='{1}' and usercode='{2}'" + strwhere,
model.State,
model.Orderid,model.UserCode
if (!string.IsNullOrEmpty(model.Orderid))
{
strwhere += "and Orderid='" + model.Orderid + "'";
}
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 " + strwhere,
model.State
);
LogHelper.WriteLogInfo("修改作业区段"+sql);
LogHelper.WriteLogInfo("修改作业区段" + sql);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
@ -304,7 +312,7 @@ namespace Epost.DAL
}
#endregion
#region
public bool UpdateQueueState()
{
@ -353,11 +361,11 @@ namespace Epost.DAL
#region queue
public bool DelQueueOrder(string sku,string block)
public bool DelQueueOrder(string sku, string block)
{
string sql = string.Format("delete from OrdersQueue where sku='{0}' and taskblock='{1}' and state<>3",
sku,block);
LogHelper.WriteLogInfo("删除queue"+sql);
sku, block);
LogHelper.WriteLogInfo("删除queue" + sql);
long x = db.DeleteSql(sql);
if (x > 0)
return true;
@ -379,7 +387,7 @@ namespace Epost.DAL
}
else
{
return 1;
return 1;
}
@ -387,7 +395,7 @@ namespace Epost.DAL
#endregion
#region queue
public bool DeleteQueue(string block,string area)
public bool DeleteQueue(string block, string area)
{
string sql = string.Format("delete from OrdersQueue where taskblock='{0}' and taskarea='{1}'",
block, area);