This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user