This commit is contained in:
@ -696,7 +696,7 @@ namespace Epost.DAL
|
||||
#region 获取所有地址列表
|
||||
public DataTable GetALLList(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from v_address where 1=1 " + strwhere + " ");
|
||||
string sql = string.Format("select * from addressstorage where 1=1 " + strwhere + " ");
|
||||
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
|
@ -2493,6 +2493,78 @@ namespace Epost.DAL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 查询小格口是否都已绑定
|
||||
public bool getSmallLocList(string loc)
|
||||
{
|
||||
string sql = string.Format("select top 1 * from orders where (partcode is null or partcode='') and oprationstate=3 and fromlocation='{0}'", loc);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 生成箱号
|
||||
public bool CreateBoxInfo(string boxcode, string loc, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
//添加打印信息
|
||||
string printsql = string.Format("insert into print_sku(orderid,matchid,state,addtime,type) values('{0}','{1}','{2}','{3}','{4}')",
|
||||
boxcode, loc, "0", DateTime.Now.ToString(), type);
|
||||
int x = db.InsertSql(printsql);
|
||||
if (x > 0)
|
||||
{
|
||||
//更新订单状态为已完成
|
||||
string sql = string.Format("update orders set state =3,boxcode='{0}' where fromlocation='{1}' and state<>3 and oprationstate=3",
|
||||
boxcode, loc);
|
||||
long y = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo(y + "更新订单完成" + sql);
|
||||
//查询此货位是否存在未播商品
|
||||
//string querysql = string.Format("select * from orders where oprationstate<>3 and fromlocation='{0}'",loc);
|
||||
//DataTable querydt = db.GetsqlForDT(querysql);
|
||||
//if (querydt != null && querydt.Rows.Count > 0)
|
||||
//{
|
||||
// LogHelper.WriteLogInfo(loc+"还有商品未分配完,不释放格口");
|
||||
// //不释放格口
|
||||
// return true;
|
||||
//}
|
||||
//else {
|
||||
// //释放格口
|
||||
// string upsql = string.Format("update addressstorage set bkaddress=0,addresstype='' where location='{0}'", loc);
|
||||
// long b = db.UpdateSql(upsql);
|
||||
// if (b > 0)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LogHelper.WriteLogInfo("释放格口失败" + upsql);
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加打印箱标签失败" + printsql);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("完成格口异常" + ex.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user