This commit is contained in:
jl
2024-12-12 10:34:24 +08:00
parent af2bdf2adc
commit bad533bcc1
8 changed files with 178 additions and 564 deletions

View File

@ -90,7 +90,7 @@ namespace Epost.DAL
string sql = string.Empty;
if (!string.IsNullOrEmpty(area))
{
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_ordershis where sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sku,
block, area);
@ -98,7 +98,7 @@ namespace Epost.DAL
}
else
{
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_ordershis where sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
sku,
block);
@ -189,17 +189,17 @@ namespace Epost.DAL
strwhere += " and matchid = '" + matchid + "'";
}
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where state = 0 and oprationstate =3 and sku='{0}' and block='{1}' " + strwhere + " group by sku ,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode,goodsname",
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_ordershis where sku='{0}' and oprationstate<>3 and block='{1}' " + strwhere +" group by sku, Discount,goodsname,unit,wholeunit,matchid ,goodscode",
sku,
block);
LogHelper.WriteLogInfo("获取订单信息-中分" + sql);
LogHelper.WriteLogInfo("获取回显订单信息-中分" + sql);
return db.GetsqlForDT(sql);
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("获取订单信息-中分异常:" + ex.Message, LogHelper.Log_Type.ERROR);
LogHelper.WriteLogInfo("获取回显订单信息-中分异常:" + ex.Message, LogHelper.Log_Type.ERROR);
return null;
}
}
@ -646,7 +646,7 @@ namespace Epost.DAL
// }
// truequantity = trueqty + 1;
// }
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ",
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}',state=3 where matchid='{2}' and id='{4}' ",
DateTime.Now.ToString(),
truequantity,
matchid,
@ -1245,15 +1245,28 @@ namespace Epost.DAL
#region sku对应的所有任务
public DataTable getOrderListBysku(string block, string sku,string area)
public DataTable getOrderListBysku(string block, string sku,string area, string matchid)
{
string sql = string.Format("select * from v_orders where block = '{0}' and area='{1}' and sku ='{2}' order by layer,slist ",
string sql = string.Format("select * from v_orders where block = '{0}' and area='{1}' and sku ='{2}'and matchid ='{3}' order by layer,slist ",
block,area,
sku);
sku,matchid);
LogHelper.WriteLogInfo("查询sku对应的所有任务:" + sql);
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
#region sku对应的所有任务
public DataTable getOrderHisListBysku(string block, string sku, string area,string matchid)
{
string sql = string.Format("select * from v_ordershis where block = '{0}' and area='{1}' and sku ='{2}' and matchid ='{3}' order by layer,slist ",
block, area,
sku,matchid);
LogHelper.WriteLogInfo("查询sku对应的所有回显任务:" + sql);
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
#region 退