This commit is contained in:
jl
2025-06-05 15:11:19 +08:00
parent 285bae186b
commit 8c1493f76e
17 changed files with 351 additions and 273 deletions

View File

@ -36,7 +36,7 @@ namespace Epost.DAL
#region
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block)
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block,string usercode)
{
try
{
@ -45,10 +45,15 @@ namespace Epost.DAL
{
strwhere = "and matchid= '" + matchid + "'";
}
if (!string.IsNullOrEmpty(usercode))
{
strwhere += "and info= '" + usercode + "'";
}
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,shopname from v_orders where state = 0 and oprationstate <>3 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,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sku,
block, area);
@ -1068,17 +1073,17 @@ namespace Epost.DAL
}
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres;
LogHelper.WriteLogInfo("判断当前sku是否为已完成" + sql);
LogHelper.WriteLogInfo("判断当前门店是否为已完成" + sql);
DataTable dt = db.GetsqlForDT(sql);
if (dt == null || dt.Rows.Count == 0)
{
LogHelper.WriteLogInfo("判断当前sku是否为已完成true");
LogHelper.WriteLogInfo("判断当前门店是否为已完成true");
return true;
}
else
{
LogHelper.WriteLogInfo("判断订单状态为已完成false");
LogHelper.WriteLogInfo("判断当前门店是否为已完成false");
return false;
}
}
@ -2539,6 +2544,46 @@ namespace Epost.DAL
}
#endregion
#region
public bool ChangeBox(string shopid, string boxcode,int boxno,int totalcount)
{
string upstr = string.Empty;
if (totalcount != 0)
{
upstr = ",totalcount='"+totalcount+"'";
}
string sql = string.Format("update orders set boxcode='{0}',state =3 where shopid = '{1}' and oprationstate=3 and (boxcode is null or boxcode='') ",
boxcode, shopid);
long x = db.UpdateSql(sql);
LogHelper.WriteLogInfo(x+"换箱" +sql);
if (x > 0)
{
string newsql = string.Format("update orders set boxno='{0}'" + upstr + " where shopid = '{1}' ",
boxno, shopid);
long l = db.UpdateSql(newsql);
LogHelper.WriteLogInfo(l + "更新箱数" + newsql);
return true;
}
else { return false; }
}
#endregion
#region
public int GetStoreInfo(string shopid)
{
string sql = string.Format("select top 1 isnull(max(boxno),0) as boxno from orders where shopid = '{0}' and state = 0 ",
shopid);
DataTable dt= db.GetsqlForDT(sql);
if (dt != null && dt.Rows.Count > 0)
{
return Convert.ToInt32(dt.Rows[0]["boxno"].ToString()) ;
}
else { return 0; }
}
#endregion
}
}