This commit is contained in:
@ -317,7 +317,7 @@ namespace Epost.DAL
|
||||
{
|
||||
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
||||
HttpHelper http = new HttpHelper();
|
||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":8000/param/";
|
||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":81/cgi-bin/rpc.cgi";
|
||||
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
||||
string result = "";
|
||||
List<SendParamModel> list = new List<SendParamModel>();
|
||||
@ -363,7 +363,7 @@ namespace Epost.DAL
|
||||
foreach (ResultsModel res in resultModel)
|
||||
{
|
||||
|
||||
if (res.Status == "ERROR")
|
||||
if (res.Status == "ERROR"&&res.Command!= "START_POLLING")
|
||||
{
|
||||
LogHelper.WriteLogInfo("初始化指令" + postStr);
|
||||
rest.result = "-1";
|
||||
@ -572,7 +572,7 @@ namespace Epost.DAL
|
||||
{
|
||||
ResultsModel resultModel = new ResultsModel();
|
||||
HttpHelper http = new HttpHelper();
|
||||
string ControlIP = "http://" + model.ControlIP + ":8000/param/";
|
||||
string ControlIP = "http://" + model.ControlIP + ":81/cgi-bin/rpc.cgi";
|
||||
string result = "";
|
||||
SendParamModel sendModel = new SendParamModel();
|
||||
sendModel.Address = model.Address;
|
||||
@ -627,7 +627,7 @@ namespace Epost.DAL
|
||||
{
|
||||
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
||||
HttpHelper http = new HttpHelper();
|
||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":8000/param/";
|
||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":81/cgi-bin/rpc.cgi";
|
||||
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
||||
string result = "";
|
||||
List<SendParamModel> list = new List<SendParamModel>();
|
||||
@ -671,8 +671,8 @@ namespace Epost.DAL
|
||||
LogHelper.WriteLogInfo("点亮指令" + postStr);
|
||||
ErrorLogDAL errdal = new ErrorLogDAL();
|
||||
ErrorLogModel errmodel = new ErrorLogModel();
|
||||
errmodel.Address = res.Address;
|
||||
errmodel.ControlIP = item["ControlIP"].ToString();
|
||||
errmodel.Remark = res.Address;
|
||||
errmodel.Title = item["ControlIP"].ToString();
|
||||
|
||||
//if (res.Parameter.Contains("E16"))
|
||||
//{
|
||||
|
@ -10,24 +10,21 @@ using static Epost.DAL.Enum.SqlLogType;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class ErrorLogDAL
|
||||
public class ErrorLogDAL
|
||||
{
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 添加日志
|
||||
public bool InsertErrorLog(ErrorLogModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string sql = string.Format("insert into errorlog(username,ControlIP,ControlID,Address,ErrorDate,Type,BkAddress,Remark) values('{0}','{1}','{2}','{3}','{4}',{5},'{6}','{7}')",
|
||||
|
||||
string sql = string.Format("insert into errorlog(username,ErrorDate,Type,title,Remark) values('{0}','{1}','{2}','{3}','{4}')",
|
||||
model.UserName,
|
||||
model.ControlIP,
|
||||
model.ControlID,
|
||||
model.Address,
|
||||
|
||||
DateTime.Now.ToString(),
|
||||
model.Type,
|
||||
model.BkAddress,
|
||||
model.Title,
|
||||
model.Remark);
|
||||
int x = db.InsertSql(sql);
|
||||
if (x > 0)
|
||||
@ -84,7 +81,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by Id asc");
|
||||
strSql.Append("order by Id desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from ErrorLog T WITH(NOLOCK) ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
@ -114,10 +111,25 @@ namespace Epost.DAL
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<Model.ErrorLogModel>();
|
||||
return new List<ErrorLogModel>();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public long DeleteLog(string type)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(type))
|
||||
{
|
||||
strwhere = " and type ='" + type + "'";
|
||||
|
||||
|
||||
}
|
||||
|
||||
string sql = string.Format("delete from errorlog where 1=1 " + strwhere + "");
|
||||
return db.DeleteSql(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select distinct fromlocation,sku,block,area from v_orders where state = 0 and oprationstate <>3 and (sku = '{0}' or fromlocation='{0}') and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
sql = string.Format("select distinct tolocation,fromlocation,sku,block,area,address,controlip from v_orders where state = 0 and oprationstate <>3 and (sku = '{0}' or tolocation='{0}') and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -56,7 +56,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select distinct fromlocation,block,area from v_orders where state = 0 and oprationstate <>3 (and sku = '{0}'or fromlocation='{0}') and block = '{1}' " + strwhere + "",
|
||||
sql = string.Format("select distinct tolocation,fromlocation,block,area ,address,controlip from v_orders where state = 0 and oprationstate <>3 (and sku = '{0}'or tolocation='{0}') and block = '{1}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -622,17 +622,17 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改当前标签拣货状态
|
||||
public bool UpdateWorkState_Car(string matchid,string fromlocation,string oprationstate )
|
||||
public bool UpdateWorkState_Car(string matchid,string tolocation, string oprationstate )
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (uplock)
|
||||
{
|
||||
string upsql = string.Format("update orders set oprationstate = '{0}' ,oprationtime='{1}' ,truequantity=quantity where matchid='{2}' and fromlocation='{3}' ",
|
||||
string upsql = string.Format("update orders set oprationstate = '{0}' ,oprationtime='{1}' ,truequantity=quantity where matchid='{2}' and tolocation='{3}' ",
|
||||
oprationstate,
|
||||
DateTime.Now.ToString(),
|
||||
matchid,
|
||||
fromlocation
|
||||
tolocation
|
||||
);
|
||||
long x = db.UpdateSql(upsql);
|
||||
if (x > 0)
|
||||
|
Reference in New Issue
Block a user