This commit is contained in:
@ -9,13 +9,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class AddressstorageDAL
|
||||
public class AddressstorageDAL
|
||||
{
|
||||
//DB db = new DB();
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
|
||||
#region 查询设备所在区
|
||||
public DataTable getBlock(string address,string type,string controlip)
|
||||
public DataTable getBlock(string address, string type, string controlip)
|
||||
{
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(type))
|
||||
@ -40,13 +40,13 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据地址查询货位信息
|
||||
public DataTable getLocationList(string address,string controlIP)
|
||||
public DataTable getLocationList(string address, string controlIP)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage as addr left join controller as con on con.ID=addr.controlid where type=4 and address = '{0}' and ControlIP='{1}'",
|
||||
address,
|
||||
controlIP
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ namespace Epost.DAL
|
||||
{
|
||||
string sql = string.Format(" select * from v_address where location = '{0}'",
|
||||
location
|
||||
|
||||
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -92,16 +92,16 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据地址、通道查询信息
|
||||
public DataTable getAddressListByway(string location, string block, string area,string way)
|
||||
public DataTable getAddressListByway(string location, string block, string area, string way)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage where location = '{0}' and block='{1}' and area='{2}' and way='{3}'",
|
||||
location,
|
||||
block,
|
||||
area,way
|
||||
area, way
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ namespace Epost.DAL
|
||||
public DataTable getControlList()
|
||||
{
|
||||
string sql = string.Format("select * from Controller");
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
@ -158,32 +158,36 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
strwhere = " and area='"+area+"'";
|
||||
strwhere += " and area='" + area + "'";
|
||||
}
|
||||
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' and block='{0}' " + strwhere,
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
strwhere += " and block='" + block + "'";
|
||||
}
|
||||
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' " + strwhere,
|
||||
block,
|
||||
|
||||
|
||||
type);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址"+sql);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址---通道灯" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
{
|
||||
|
||||
|
||||
string sql = string.Format(" select * from V_Address where location in (select min(location) from V_Address group by address) and block = '{0}' and area = '{1}' and type ='{2}'",
|
||||
block,
|
||||
area,type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
area, type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -195,7 +199,7 @@ namespace Epost.DAL
|
||||
string sql = string.Format("select * from V_Address where block='{0}' and area='{1}' and type in(2,4)",
|
||||
block,
|
||||
area);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -206,7 +210,7 @@ namespace Epost.DAL
|
||||
public DataTable GetScanList()
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6");
|
||||
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -223,9 +227,9 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取扫描枪地址
|
||||
public DataTable GetScanListByArea(string block,string area)
|
||||
public DataTable GetScanListByArea(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='"+block+"' and area = '"+area+"'");
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='" + block + "' and area = '" + area + "'");
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
@ -253,7 +257,7 @@ namespace Epost.DAL
|
||||
#region 获取所有小区
|
||||
public DataTable GetAreaList()
|
||||
{
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
@ -274,13 +278,13 @@ namespace Epost.DAL
|
||||
#region 获取所有通道
|
||||
public DataTable GetWayList()
|
||||
{
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页获取数据列表
|
||||
|
||||
|
||||
public List<AddressstorageModel> GetCityListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
@ -304,7 +308,7 @@ namespace Epost.DAL
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Addressstorage AS T ");
|
||||
@ -333,12 +337,12 @@ namespace Epost.DAL
|
||||
|
||||
//---
|
||||
#region 获取每个小区对应的每个大区(根据小区从小到大排序对应的大区)
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
{
|
||||
//string sql = string.Format("select cast(area as Int) as 'Area_area',block from Addressstorage group by block,area order by 'Area_area',block");
|
||||
string sql = string.Format("select cast(way as Int) as 'Area_area',area from Addressstorage where type in(1,2) group by way,area order by Area_area,area");
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sql));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
@ -428,7 +432,7 @@ namespace Epost.DAL
|
||||
#region 根据条件删除货位
|
||||
public bool Locational_Binding_Save(string one, string two, string three, string four, string five, string six)
|
||||
{
|
||||
|
||||
|
||||
#region one
|
||||
string sql1 = "update Addressstorage ";
|
||||
try
|
||||
@ -576,7 +580,7 @@ namespace Epost.DAL
|
||||
//}
|
||||
strSql.Append(" ) TT");
|
||||
string sq = strSql.Append(" WHERE TT.Row between {0} and {1}").ToString();
|
||||
string sq1= string.Format(sq, startIndex, endIndex);
|
||||
string sq1 = string.Format(sq, startIndex, endIndex);
|
||||
string sq3 = string.Format(sq, 0, 100000);
|
||||
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sq1.ToString()));
|
||||
@ -639,7 +643,7 @@ namespace Epost.DAL
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@ -662,7 +666,7 @@ namespace Epost.DAL
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置所有的设备都为1
|
||||
@ -812,7 +816,7 @@ namespace Epost.DAL
|
||||
#region 根据订单获取要熄灭的标签
|
||||
public DataTable GetForcedendAddress(string orderid)
|
||||
{
|
||||
string sql = string.Format("select * from v_orders where orderid='20416' and oprationstate!=3");
|
||||
string sql = string.Format("select distinct ControlIP,address from v_orders where orderid='" + orderid + "' and oprationstate!=3");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate <>3 and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -60,7 +60,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -78,13 +78,16 @@ namespace Epost.DAL
|
||||
}
|
||||
}
|
||||
|
||||
public DataTable GetOrderList(string area, string block)
|
||||
public DataTable GetOrderList(string Orderid, string area, string block)
|
||||
{
|
||||
try
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
|
||||
string sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate <>3 and block = '{0}' and area='{1}' " + strwhere + "",
|
||||
if (!string.IsNullOrEmpty(Orderid))
|
||||
{
|
||||
strwhere += " and orderid='" + Orderid + "'";
|
||||
}
|
||||
string sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate=0 and block = '{0}' and area='{1}' " + strwhere + "",
|
||||
|
||||
block, area);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -504,7 +507,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and id='{2}'",
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and id='{2}'",
|
||||
DateTime.Now.ToString(),
|
||||
orderid,
|
||||
|
||||
@ -512,7 +515,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and sku='{2}'",
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and sku='{2}'",
|
||||
DateTime.Now.ToString(),
|
||||
orderid,
|
||||
sku);
|
||||
@ -691,6 +694,55 @@ namespace Epost.DAL
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public bool UpdateWorkState(string orderid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (uplock)
|
||||
{
|
||||
int oprationstate = 3;
|
||||
// string sql = string.Format("select quantity,truequantity from orders where matchid='{0}' and sku = '{1}' and batchid='{2}'",
|
||||
// matchid,
|
||||
// sku,
|
||||
// batchid);
|
||||
|
||||
//DataTable dt= db.GetsqlForDT(sql);
|
||||
// if (dt!=null&&dt.Rows.Count > 0)
|
||||
// {
|
||||
// int trueqty =Convert.ToInt32( dt.Rows[0]["truequantity"].ToString());
|
||||
// int quantity =Convert.ToInt32( dt.Rows[0]["quantity"].ToString());
|
||||
|
||||
// if (trueqty + 1 == quantity)
|
||||
// {
|
||||
// oprationstate = 3;
|
||||
// }
|
||||
// truequantity = trueqty + 1;
|
||||
// }
|
||||
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity=quantity where orderid='{2}' and id='{4}' ",
|
||||
DateTime.Now.ToString(),
|
||||
truequantity,
|
||||
orderid,
|
||||
oprationstate,
|
||||
id,
|
||||
// checkquantity,
|
||||
usercode
|
||||
);
|
||||
long x = db.UpdateSql(upsql);
|
||||
LogHelper.WriteLogInfo("修改当前标签拣货状态:" + upsql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("修改当前标签拣货状态异常:" + ex.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -768,6 +820,36 @@ namespace Epost.DAL
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public bool UpdateState(string area, string block = "", string sku = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
strwhere = " and block='" + block + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(sku))
|
||||
{
|
||||
strwhere += " and sku='" + sku + "'";
|
||||
}
|
||||
|
||||
string upsql = string.Format("update v_orders set state=3 where area ='" + area + "' " + strwhere);
|
||||
LogHelper.WriteLogInfo("修改通道拣货状态:" + upsql);
|
||||
long x = db.UpdateSql(upsql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("修改当前小车拣货状态:" + ex.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -1105,6 +1187,59 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region
|
||||
public bool IsFinishWorkArea(string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
|
||||
{
|
||||
string strwheres = "";
|
||||
if (!string.IsNullOrEmpty(usercode))
|
||||
{
|
||||
strwheres = " and sku in(select sku from ordersqueue where usercode = '" + usercode + "')";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(sku))
|
||||
{
|
||||
|
||||
strwheres += " and sku ='" + sku + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
|
||||
strwheres += " and block ='" + block + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
|
||||
strwheres += " and area ='" + area + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(orderid))
|
||||
{
|
||||
strwheres += " and orderid ='" + orderid + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(shopid))
|
||||
{
|
||||
strwheres += " and shopid ='" + shopid + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(orderid))
|
||||
{
|
||||
strwheres += " and orderid ='" + orderid + "'";
|
||||
}
|
||||
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 " + strwheres;
|
||||
|
||||
LogHelper.WriteLogInfo("判断阴凉区是否为已完成" + sql);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断阴凉区是否为已完成true");
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断阴凉区是否为已完成false");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询下一区段区号
|
||||
public int getOrderarea(string usercode, string block, string area)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user